]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: libfc: fix seconds_since_last_reset calculation
authorArnd Bergmann <arnd@arndb.de>
Fri, 17 Jun 2016 15:47:25 +0000 (17:47 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 13 Jul 2016 03:16:31 +0000 (23:16 -0400)
commit9425aaf0581a1bbbe997022290f3612e0ea1c6d3
tree7828470058aa0b677333fb23e332f6f75642b349
parent8d61d84ba007f4a192691efbbe848ffc755c48be
scsi: libfc: fix seconds_since_last_reset calculation

The fc_get_host_stats() function contains a complex conversion from
jiffies to timespec to seconds. As we try to get rid of uses of struct
timespec, we can clean this up and replace it with a simpler
computation.

Simply dividing the difference in jiffies by HZ is not only much more
efficient, it also avoids a problem that causes the
seconds_since_last_reset value to be incorrect if jiffies has overrun
since the 'boot_time' value was recorded.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/libfc/fc_lport.c