diff options
author | Tina Ruchandani <ruchandani.tina@gmail.com> | 2015-10-30 01:30:40 -0700 |
---|---|---|
committer | James Bottomley <JBottomley@Odin.com> | 2015-11-09 17:42:19 -0800 |
commit | 0da39687a15403251bdfd1c6fb18025c0607326b (patch) | |
tree | 624cc14dc0979e97981332ae81c1b5725b2908b2 /drivers/scsi/stex.c | |
parent | 5cb9b40d6127fed91b00abe44498f19f6ed6a77f (diff) | |
download | linux-0da39687a15403251bdfd1c6fb18025c0607326b.tar.bz2 |
stex: Remove use of struct timeval
Function stex_gettime uses 'struct timeval' whose tv_sec value
will overflow on 32-bit systems in year 2038 and beyond. This patch
replaces the use of struct timeval and do_gettimeofday with
ktime_get_real_seconds, which returns a 64-bit seconds value.
Suggested-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Tina Ruchandani <ruchandani.tina@gmail.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
Diffstat (limited to 'drivers/scsi/stex.c')
-rw-r--r-- | drivers/scsi/stex.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/scsi/stex.c b/drivers/scsi/stex.c index 56353cd9abd3..2de28d7a0b04 100644 --- a/drivers/scsi/stex.c +++ b/drivers/scsi/stex.c @@ -25,6 +25,7 @@ #include <linux/types.h> #include <linux/module.h> #include <linux/spinlock.h> +#include <linux/ktime.h> #include <asm/io.h> #include <asm/irq.h> #include <asm/byteorder.h> @@ -362,14 +363,6 @@ MODULE_DESCRIPTION("Promise Technology SuperTrak EX Controllers"); MODULE_LICENSE("GPL"); MODULE_VERSION(ST_DRIVER_VERSION); -static void stex_gettime(__le64 *time) -{ - struct timeval tv; - - do_gettimeofday(&tv); - *time = cpu_to_le64(tv.tv_sec); -} - static struct status_msg *stex_get_status(struct st_hba *hba) { struct status_msg *status = hba->status_buffer + hba->status_tail; @@ -1002,7 +995,7 @@ static int stex_common_handshake(struct st_hba *hba) h->req_cnt = cpu_to_le16(hba->rq_count+1); h->status_sz = cpu_to_le16(sizeof(struct status_msg)); h->status_cnt = cpu_to_le16(hba->sts_count+1); - stex_gettime(&h->hosttime); + h->hosttime = cpu_to_le64(ktime_get_real_seconds()); h->partner_type = HMU_PARTNER_TYPE; if (hba->extra_offset) { h->extra_offset = cpu_to_le32(hba->extra_offset); @@ -1076,7 +1069,7 @@ static int stex_ss_handshake(struct st_hba *hba) h->req_cnt = cpu_to_le16(hba->rq_count+1); h->status_sz = cpu_to_le16(sizeof(struct status_msg)); h->status_cnt = cpu_to_le16(hba->sts_count+1); - stex_gettime(&h->hosttime); + h->hosttime = cpu_to_le64(ktime_get_real_seconds()); h->partner_type = HMU_PARTNER_TYPE; h->extra_offset = h->extra_size = 0; scratch_size = (hba->sts_count+1)*sizeof(u32); |