On Fri, 13 Feb 2015 16:05:54 -0800 James Bottomley <James.Bottomley@xxxxxxxxxxxxxxxxxxxxx> wrote: > @@ -42,31 +44,60 @@ void string_get_size(u64 size, const enum string_size_units units, > [STRING_UNITS_2] = 1024, > }; > int i, j; > - u32 remainder = 0, sf_cap; > + u32 remainder = 0, sf_cap, exp; > char tmp[8]; > + const char *unit; > > tmp[0] = '\0'; > i = 0; > + if (!size) > + goto out; whitespace wart. > + if (blk_size >= divisor[units]) { > + while (blk_size >= divisor[units]) { > + remainder = do_div(blk_size, divisor[units]); > + i++; > + } > + } The `if' doesn't do anything. > + exp = divisor[units]; > + do_div(exp, blk_size); > + if (size >= exp) { > + remainder = do_div(size, divisor[units]); > + remainder *= blk_size; > + i++; > + } else { > + remainder *= size; > + } > + size *= blk_size; > + size += (remainder/divisor[units]); > + remainder %= divisor[units]; > + > if (size >= divisor[units]) { > while (size >= divisor[units]) { > remainder = do_div(size, divisor[units]); > i++; > } > + } Here too. -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html