mirror of
https://github.com/torvalds/linux.git
synced 2024-11-14 16:12:02 +00:00
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. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Sagi Grimberg <sagig@mellanox.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:
parent
d144da8c6f
commit
2c63d1072a
@ -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 "
|
||||
|
Loading…
Reference in New Issue
Block a user