linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] netxen: remove timespec usage
@ 2017-11-27 11:39 Arnd Bergmann
  2017-11-30 14:27 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2017-11-27 11:39 UTC (permalink / raw)
  To: Manish Chopra, Rahul Verma, Dept-GELinuxNICDev
  Cc: y2038, Arnd Bergmann, David S. Miller, netdev, linux-kernel

netxen_collect_minidump() evidently just wants to get a monotonic
timestamp. Using jiffies_to_timespec(jiffies, &ts) is not
appropriate here, since it will overflow after 2^32 jiffies,
which may be as short as 49 days of uptime.

ktime_get_seconds() is the correct interface here.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c
index 0a66389c06c2..1cd39c9a0345 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c
@@ -2502,12 +2502,10 @@ netxen_collect_minidump(struct netxen_adapter *adapter)
 {
 	int ret = 0;
 	struct netxen_minidump_template_hdr *hdr;
-	struct timespec val;
 	hdr = (struct netxen_minidump_template_hdr *)
 				adapter->mdump.md_template;
 	hdr->driver_capture_mask = adapter->mdump.md_capture_mask;
-	jiffies_to_timespec(jiffies, &val);
-	hdr->driver_timestamp = (u32) val.tv_sec;
+	hdr->driver_timestamp = ktime_get_seconds();
 	hdr->driver_info_word2 = adapter->fw_version;
 	hdr->driver_info_word3 = NXRD32(adapter, CRB_DRIVER_VERSION);
 	ret = netxen_parse_md_template(adapter);
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] netxen: remove timespec usage
  2017-11-27 11:39 [PATCH] netxen: remove timespec usage Arnd Bergmann
@ 2017-11-30 14:27 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-11-30 14:27 UTC (permalink / raw)
  To: arnd
  Cc: manish.chopra, rahul.verma, Dept-GELinuxNICDev, y2038, netdev,
	linux-kernel

From: Arnd Bergmann <arnd@arndb.de>
Date: Mon, 27 Nov 2017 12:39:57 +0100

> netxen_collect_minidump() evidently just wants to get a monotonic
> timestamp. Using jiffies_to_timespec(jiffies, &ts) is not
> appropriate here, since it will overflow after 2^32 jiffies,
> which may be as short as 49 days of uptime.
> 
> ktime_get_seconds() is the correct interface here.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-11-30 14:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-27 11:39 [PATCH] netxen: remove timespec usage Arnd Bergmann
2017-11-30 14:27 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).