From: Geert Uytterhoeven Date: Mon, 4 Nov 2013 13:00:06 +0000 (+0100) Subject: block: Do not call sector_div() with a 64-bit divisor X-Git-Tag: v3.13-rc1~101^2~3 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=97597dc08f58e25bc74154b7d1c387a4c0432950;p=pandora-kernel.git block: Do not call sector_div() with a 64-bit divisor do_div() (called by sector_div() if CONFIG_LBDAF=y) is meant for divisions of 64-bit number by 32-bit numbers. Passing 64-bit divisor types caused issues in the past on 32-bit platforms, cfr. commit ea077b1b96e073eac5c3c5590529e964767fc5f7 ("m68k: Truncate base in do_div()"). As queue_limits.max_discard_sectors and .discard_granularity are unsigned int, max_discard_sectors and granularity should be unsigned int. As bdev_discard_alignment() returns int, alignment should be int. Now 2 calls to sector_div() can be replaced by 32-bit arithmetic: - The 64-bit modulo operation can become a 32-bit modulo operation, - The 64-bit division and multiplication can be replaced by a 32-bit modulo operation and a subtraction. Signed-off-by: Geert Uytterhoeven Signed-off-by: Jens Axboe --- Reading git-diff-tree failed