diff options
author | Colin Ian King <colin.king@canonical.com> | 2017-12-09 03:34:14 +0300 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2017-12-12 05:37:08 +0300 |
commit | 3c62ecda0e24f4ae84181184457d4e37f5250c7f (patch) | |
tree | 24ed2f0f85c2b1f0a5fdb90a07ed15b39c6148b6 | |
parent | 8c5a50e8e7ad812a62f7ccf28d9a5e74fddf3000 (diff) | |
download | linux-3c62ecda0e24f4ae84181184457d4e37f5250c7f.tar.xz |
scsi: arcmsr: remove redundant check for secs < 0
The check for secs being less than zero is redundant for two reasons.
Firstly, secs is unsigned so the check is always going to be false.
Secondly, if secs was signed the proceeding calculation of secs is never
going to be negative. Hence we can remove this redundant check and day
and secs re-adjustment.
Detected by static analysis with smatch:
arcmsr_set_iop_datetime() warn: unsigned 'secs' is never less than zero.
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Ching Huang <ching2048@areca.com.tw>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r-- | drivers/scsi/arcmsr/arcmsr_hba.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c index 0707a60bf5c0..e4258b69f4be 100644 --- a/drivers/scsi/arcmsr/arcmsr_hba.c +++ b/drivers/scsi/arcmsr/arcmsr_hba.c @@ -3679,10 +3679,6 @@ static void arcmsr_set_iop_datetime(struct timer_list *t) secs = (u32)(tv.tv_sec - (sys_tz.tz_minuteswest * 60)); days = secs / 86400; secs = secs - 86400 * days; - if (secs < 0) { - days = days - 1; - secs = secs + 86400; - } j = days / 146097; i = days - 146097 * j; a = i + 719468; |