]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: sd: Improve sd_print_capacity()
authorDamien Le Moal <damien.lemoal@wdc.com>
Wed, 30 Jan 2019 07:07:34 +0000 (16:07 +0900)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 5 Feb 2019 03:07:24 +0000 (22:07 -0500)
commit6005e6e6d114f656089a2ec37534a06a83d92044
tree2fcc6f26bb7b30d006713d8129c3b5ee26d0ac9c
parent0d3daf0c567656a4dc93f997c368751432d9949c
scsi: sd: Improve sd_print_capacity()

There is no need to call twice string_get_size() when the capacity messages
are not going to be printed. Reverse the message output condition to return
early and avoid executing string_get_size() when it is not necessary.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/sd.c