Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix lpfc_parse_bg_err()'s use of do_div()

Fix lpfc_parse_bg_err()'s use of do_div(). It should be passing a 64-bit
variable as the first parameter. However, since it's only using a 32-bit
variable, it doesn't need to use do_div() at all, but can instead use the
division operator.

This deals with the following warnings:

CC drivers/scsi/lpfc/lpfc_scsi.o
drivers/scsi/lpfc/lpfc_scsi.c: In function 'lpfc_parse_bg_err':
drivers/scsi/lpfc/lpfc_scsi.c:1397: warning: comparison of distinct pointer types lacks a cast
drivers/scsi/lpfc/lpfc_scsi.c:1397: warning: right shift count >= width of type
drivers/scsi/lpfc/lpfc_scsi.c:1397: warning: passing argument 1 of '__div64_32' from incompatible pointer type

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

David Howells and committed by
Linus Torvalds
2344b5b6 78c5b82e

+1 -1
+1 -1
drivers/scsi/lpfc/lpfc_scsi.c
··· 1394 1394 */ 1395 1395 cmd->sense_buffer[8] = 0; /* Information */ 1396 1396 cmd->sense_buffer[9] = 0xa; /* Add. length */ 1397 - do_div(bghm, cmd->device->sector_size); 1397 + bghm /= cmd->device->sector_size; 1398 1398 1399 1399 failing_sector = scsi_get_lba(cmd); 1400 1400 failing_sector += bghm;