On Wed, 21 March 2012 18:00:13 -0700, Roland Dreier wrote: > On Wed, Mar 21, 2012 at 5:34 PM, Nicholas A. Bellinger > <nab@xxxxxxxxxxxxxxx> wrote: > > - tmp = rounddown((max_sectors * block_size), PAGE_SIZE); > > - aligned_max_sectors = (tmp / block_size); > > + aligned_max_sectors = rounddown(max_sectors, PAGE_SIZE / block_size); > > > > The PAGE_SIZE / block_size calculation looks bogus to me here.. > > What's bogus about it? As long as block_size is a power of 2 (which I believe > we assume many other places), it should be fine. And indeed I had an embryonic patch sometime back to add block_size_bits and replace various fairly complicated logic with shifts. Seeing a do_div in the general area should trigger the use of profanities. If this cannot be done with masks and shifts, what on earth can? Jörn -- To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html