Skip to contentSkip to conversation

HSI: cmt_speech: use timespec64 instead of timespec

PATCH In review Arnd Bergmann 2 participants 2 messages Nov 27, 2017 – Dec 1, 2017 HSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 HSI: cmt_speech: use timespec64 instead of timespec

struct timespec should no longer be used because of the y2038 overflow problem. This code does not suffer from the overflow, but it's trivial to change it to use timespec64 without changing the interface, so let's do that.

---
 drivers/hsi/clients/cmt_speech.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/hsi/clients/cmt_speech.c +2 -2
index 727f968ac1cb..05b80723d39d 100644
@@ -451,11 +451,11 @@ static void cs_hsi_read_on_control_complete(struct hsi_msg *msg)
 	dev_dbg(&hi->cl->device, "Read on control: %08X\n", cmd);
 	cs_release_cmd(msg);
 	if (hi->flags & CS_FEAT_TSTAMP_RX_CTRL) {
-		struct timespec tspec;
+		struct timespec64 tspec;
 		struct cs_timestamp *tstamp =
 			&hi->mmap_cfg->tstamp_rx_ctrl;
 
-		ktime_get_ts(&tspec);
+		ktime_get_ts64(&tspec);
 
 		tstamp->tv_sec = (__u32) tspec.tv_sec;
 		tstamp->tv_nsec = (__u32) tspec.tv_nsec;
Signature · 1 line
2.9.0
#1 lore raw

Hi Arnd,

Quoted 7 lines · Arnd Bergmann

struct timespec should no longer be used because of the y2038 overflow problem. This code does not suffer from the overflow, but it's trivial to change it to use timespec64 without changing the interface, so let's do that.

---

Thanks, queued.

-- Sebastian

Quoted 24 lines
 drivers/hsi/clients/cmt_speech.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/hsi/clients/cmt_speech.c +2 -2
index 727f968ac1cb..05b80723d39d 100644
@@ -451,11 +451,11 @@ static void cs_hsi_read_on_control_complete(struct hsi_msg *msg)
 	dev_dbg(&hi->cl->device, "Read on control: %08X\n", cmd);
 	cs_release_cmd(msg);
 	if (hi->flags & CS_FEAT_TSTAMP_RX_CTRL) {
-		struct timespec tspec;
+		struct timespec64 tspec;
 		struct cs_timestamp *tstamp =
 			&hi->mmap_cfg->tstamp_rx_ctrl;
 
-		ktime_get_ts(&tspec);
+		ktime_get_ts64(&tspec);
 
 		tstamp->tv_sec = (__u32) tspec.tv_sec;
 		tstamp->tv_nsec = (__u32) tspec.tv_nsec;
Signature · 1 line
2.9.0