IB/iser: use sector_div instead of do_div
Subsystems (2)
PATCH 1/1 IB/iser: use sector_div instead of do_div
do_div is the wrong way to divide a sector_t, as it is less efficient when sector_t is 32-bit wide. With the upcoming do_div optimizations, the kernel starts warning about this:
drivers/infiniband/ulp/iser/iser_verbs.c:1296:4: note: in expansion of macro 'do_div' include/asm-generic/div64.h:224:22: warning: passing argument 1 of '__div64_32' from incompatible pointer type
This changes the code to use sector_div instead, which always produces optimal code.
drivers/infiniband/ulp/iser/iser_verbs.c +1 -1
@@ -1293,7 +1293,7 @@ u8 iser_check_task_pi_status(struct iscsi_iser_task *iser_task,if (mr_status.fail_status &IB_MR_CHECK_SIG_STATUS ) {sector_t sector_off = mr_status.sig_err.sig_err_offset; -do_div (sector_off, sector_size +8 ); +sector_div (sector_off, sector_size +8 ); *sector =scsi_get_lba (iser_task->sc) + sector_off; pr_err("PI error found type %d at sector %llx "
Quoted 5 lines
do_divis the wrong way to divide asector_t, as it is less efficient whensector_tis 32-bit wide. With the upcomingdo_divoptimizations, the kernel starts warning about this:
Quoted 7 lines
drivers/infiniband/ulp/iser/iser_verbs.c:1296:4: note: in expansion of macro 'do_div'include/asm-generic/div64.h:224:22: warning: passing argument 1 of '__div64_32' from incompatible pointer typeThis changes the code to use
sector_divinstead, which always produces optimal code.Signed-off-by Arnd Bergmann <[email protected]>
Thanks Arnd,