]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: sd: Improve sd_completed_bytes
authorDamien Le Moal <damien.lemoal@wdc.com>
Mon, 24 Apr 2017 07:51:10 +0000 (16:51 +0900)
committerMartin K. Petersen <martin.petersen@oracle.com>
Mon, 24 Apr 2017 23:00:29 +0000 (19:00 -0400)
commit9111dad610d2a0f09c9a0ad9fcd27baaef39ce8d
treeb14107bc46373d10b1727c2b0f348de0b5ad7e50
parent67854f490a2198fe7afa4c67480fe58d6b11b129
scsi: sd: Improve sd_completed_bytes

Re-shuffle the code to be more efficient by not initializing variables
upfront (i.e. do it only when necessary).  Also replace the do_div calls
with calls to sectors_to_logical().

No functional change is introduced by this patch.

[mkp: bytes_to_logical()]

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/sd.c
drivers/scsi/sd.h