Commit fe7f4e5d authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Martin K. Petersen

scsi: scsi_transport_fc: use 64-bit timestamps consistently

The get_seconds() helper returns an 'unsigned long' value, which can
overflow on 32-bit architectures. Since the interface we pass it into
already uses a 64-bit type, we can just use ktime_get_real_seconds()
instead.

While we generally prefer local timestamps in CLOCK_MONOTONIC format
(ktime_get_seconds), this keeps using the CLOCK_REALTIME version in order
to maintain compatibility with existing code.
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Reviewed-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: default avatarTyrel Datwyler <tyreld@linux.vnet.ibm.com>
Reviewed-by: default avatarJames Smart <james.smart@broadcom.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 38150f7a
...@@ -567,7 +567,7 @@ fc_host_post_event(struct Scsi_Host *shost, u32 event_number, ...@@ -567,7 +567,7 @@ fc_host_post_event(struct Scsi_Host *shost, u32 event_number,
INIT_SCSI_NL_HDR(&event->snlh, SCSI_NL_TRANSPORT_FC, INIT_SCSI_NL_HDR(&event->snlh, SCSI_NL_TRANSPORT_FC,
FC_NL_ASYNC_EVENT, len); FC_NL_ASYNC_EVENT, len);
event->seconds = get_seconds(); event->seconds = ktime_get_real_seconds();
event->vendor_id = 0; event->vendor_id = 0;
event->host_no = shost->host_no; event->host_no = shost->host_no;
event->event_datalen = sizeof(u32); /* bytes */ event->event_datalen = sizeof(u32); /* bytes */
...@@ -635,7 +635,7 @@ fc_host_post_vendor_event(struct Scsi_Host *shost, u32 event_number, ...@@ -635,7 +635,7 @@ fc_host_post_vendor_event(struct Scsi_Host *shost, u32 event_number,
INIT_SCSI_NL_HDR(&event->snlh, SCSI_NL_TRANSPORT_FC, INIT_SCSI_NL_HDR(&event->snlh, SCSI_NL_TRANSPORT_FC,
FC_NL_ASYNC_EVENT, len); FC_NL_ASYNC_EVENT, len);
event->seconds = get_seconds(); event->seconds = ktime_get_real_seconds();
event->vendor_id = vendor_id; event->vendor_id = vendor_id;
event->host_no = shost->host_no; event->host_no = shost->host_no;
event->event_datalen = data_len; /* bytes */ event->event_datalen = data_len; /* bytes */
......
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