Commit 3c62ecda authored by Colin Ian King's avatar Colin Ian King Committed by Martin K. Petersen

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: default avatarColin Ian King <colin.king@canonical.com>
Acked-by: default avatarChing Huang <ching2048@areca.com.tw>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 8c5a50e8
...@@ -3679,10 +3679,6 @@ static void arcmsr_set_iop_datetime(struct timer_list *t) ...@@ -3679,10 +3679,6 @@ static void arcmsr_set_iop_datetime(struct timer_list *t)
secs = (u32)(tv.tv_sec - (sys_tz.tz_minuteswest * 60)); secs = (u32)(tv.tv_sec - (sys_tz.tz_minuteswest * 60));
days = secs / 86400; days = secs / 86400;
secs = secs - 86400 * days; secs = secs - 86400 * days;
if (secs < 0) {
days = days - 1;
secs = secs + 86400;
}
j = days / 146097; j = days / 146097;
i = days - 146097 * j; i = days - 146097 * j;
a = i + 719468; a = i + 719468;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment