On Fri, 2015-02-13 at 17:02 -0800, Andrew Morton wrote: > 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. Yes, I'll run it through checkpatch before submitting. > > + if (blk_size >= divisor[units]) { > > + while (blk_size >= divisor[units]) { > > + remainder = do_div(blk_size, divisor[units]); > > + i++; > > + } > > + } > > The `if' doesn't do anything. Right ... I just copied from the original, but it's true we can unwrap this. > > + 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. Certainly, James -- 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