Link: https://lore.kernel.org/all/20240517-b4-sio-ntp-usec-v2-1-d539180f2b79@google.com
Closes: https://github.com/KSPP/linux/issues/354
Signed-off-by: Sasha Levin <sashal@kernel.org>
+[ cast things to __kernel_long_t to fix compiler warnings - gregkh ]
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
- kernel/time/ntp.c | 4 ++--
+ kernel/time/ntp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
-diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c
-index e1110a7bd3e64..a082403a079ea 100644
--- a/kernel/time/ntp.c
+++ b/kernel/time/ntp.c
-@@ -686,10 +686,10 @@ static inline void process_adjtimex_modes(const struct timex *txc, s32 *time_tai
+@@ -686,10 +686,10 @@ static inline void process_adjtimex_mode
}
if (txc->modes & ADJ_MAXERROR)
- time_maxerror = txc->maxerror;
-+ time_maxerror = clamp(txc->maxerror, 0, NTP_PHASE_LIMIT);
++ time_maxerror = clamp(txc->maxerror, (__kernel_long_t)0, (__kernel_long_t)NTP_PHASE_LIMIT);
if (txc->modes & ADJ_ESTERROR)
- time_esterror = txc->esterror;
-+ time_esterror = clamp(txc->esterror, 0, NTP_PHASE_LIMIT);
++ time_esterror = clamp(txc->esterror, (__kernel_long_t)0, (__kernel_long_t)NTP_PHASE_LIMIT);
if (txc->modes & ADJ_TIMECONST) {
time_constant = txc->constant;
---
-2.43.0
-
-From 114037b9143925e35dc78e7ee35e8a590f7b9319 Mon Sep 17 00:00:00 2001
+From 430345cf6107334938107ba507d3a351e97193f1 Mon Sep 17 00:00:00 2001
From: Sasha Levin <sashal@kernel.org>
Date: Fri, 17 May 2024 20:22:44 +0000
Subject: ntp: Clamp maxerror and esterror to operating range
Link: https://lore.kernel.org/all/20240517-b4-sio-ntp-usec-v2-1-d539180f2b79@google.com
Closes: https://github.com/KSPP/linux/issues/354
Signed-off-by: Sasha Levin <sashal@kernel.org>
+[ cast things to long long to fix compiler warnings - gregkh ]
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
- kernel/time/ntp.c | 4 ++--
+ kernel/time/ntp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
-diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c
-index 069ca78fb0bfa..568bf37849aea 100644
--- a/kernel/time/ntp.c
+++ b/kernel/time/ntp.c
-@@ -679,10 +679,10 @@ static inline void process_adjtimex_modes(const struct __kernel_timex *txc,
+@@ -679,10 +679,10 @@ static inline void process_adjtimex_mode
}
if (txc->modes & ADJ_MAXERROR)
- time_maxerror = txc->maxerror;
-+ time_maxerror = clamp(txc->maxerror, 0, NTP_PHASE_LIMIT);
++ time_maxerror = clamp(txc->maxerror, (long long)0, (long long)NTP_PHASE_LIMIT);
if (txc->modes & ADJ_ESTERROR)
- time_esterror = txc->esterror;
-+ time_esterror = clamp(txc->esterror, 0, NTP_PHASE_LIMIT);
++ time_esterror = clamp(txc->esterror, (long long)0, (long long)NTP_PHASE_LIMIT);
if (txc->modes & ADJ_TIMECONST) {
time_constant = txc->constant;
---
-2.43.0
-
-From 62c54b4b1871ab6dd7a1ec9d3e820612ccb82202 Mon Sep 17 00:00:00 2001
+From 430345cf6107334938107ba507d3a351e97193f1 Mon Sep 17 00:00:00 2001
From: Sasha Levin <sashal@kernel.org>
Date: Fri, 17 May 2024 20:22:44 +0000
Subject: ntp: Clamp maxerror and esterror to operating range
Link: https://lore.kernel.org/all/20240517-b4-sio-ntp-usec-v2-1-d539180f2b79@google.com
Closes: https://github.com/KSPP/linux/issues/354
Signed-off-by: Sasha Levin <sashal@kernel.org>
+[ cast things to long long to fix compiler warnings - gregkh ]
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
- kernel/time/ntp.c | 4 ++--
+ kernel/time/ntp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
-diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c
-index 069ca78fb0bfa..568bf37849aea 100644
--- a/kernel/time/ntp.c
+++ b/kernel/time/ntp.c
-@@ -679,10 +679,10 @@ static inline void process_adjtimex_modes(const struct __kernel_timex *txc,
+@@ -679,10 +679,10 @@ static inline void process_adjtimex_mode
}
if (txc->modes & ADJ_MAXERROR)
- time_maxerror = txc->maxerror;
-+ time_maxerror = clamp(txc->maxerror, 0, NTP_PHASE_LIMIT);
++ time_maxerror = clamp(txc->maxerror, (long long)0, (long long)NTP_PHASE_LIMIT);
if (txc->modes & ADJ_ESTERROR)
- time_esterror = txc->esterror;
-+ time_esterror = clamp(txc->esterror, 0, NTP_PHASE_LIMIT);
++ time_esterror = clamp(txc->esterror, (long long)0, (long long)NTP_PHASE_LIMIT);
if (txc->modes & ADJ_TIMECONST) {
time_constant = txc->constant;
---
-2.43.0
-