From: Greg Kroah-Hartman Date: Mon, 12 Aug 2024 10:48:04 +0000 (+0200) Subject: fix up ntp patch on older kernels X-Git-Tag: v6.1.105~80 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=208e7f357113fb49076a94ad9da88eaec6ab9d59;p=thirdparty%2Fkernel%2Fstable-queue.git fix up ntp patch on older kernels --- diff --git a/queue-4.19/ntp-clamp-maxerror-and-esterror-to-operating-range.patch b/queue-4.19/ntp-clamp-maxerror-and-esterror-to-operating-range.patch index 90a5b8e4e76..a31c068955f 100644 --- a/queue-4.19/ntp-clamp-maxerror-and-esterror-to-operating-range.patch +++ b/queue-4.19/ntp-clamp-maxerror-and-esterror-to-operating-range.patch @@ -48,27 +48,24 @@ Cc: Miroslav Lichvar 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 +[ cast things to __kernel_long_t to fix compiler warnings - gregkh ] +Signed-off-by: Greg Kroah-Hartman --- - 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 - diff --git a/queue-5.10/ntp-clamp-maxerror-and-esterror-to-operating-range.patch b/queue-5.10/ntp-clamp-maxerror-and-esterror-to-operating-range.patch index 82862baa62d..3c3eddaedbd 100644 --- a/queue-5.10/ntp-clamp-maxerror-and-esterror-to-operating-range.patch +++ b/queue-5.10/ntp-clamp-maxerror-and-esterror-to-operating-range.patch @@ -1,4 +1,4 @@ -From 114037b9143925e35dc78e7ee35e8a590f7b9319 Mon Sep 17 00:00:00 2001 +From 430345cf6107334938107ba507d3a351e97193f1 Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Fri, 17 May 2024 20:22:44 +0000 Subject: ntp: Clamp maxerror and esterror to operating range @@ -48,27 +48,24 @@ Cc: Miroslav Lichvar 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 +[ cast things to long long to fix compiler warnings - gregkh ] +Signed-off-by: Greg Kroah-Hartman --- - 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 - diff --git a/queue-5.4/ntp-clamp-maxerror-and-esterror-to-operating-range.patch b/queue-5.4/ntp-clamp-maxerror-and-esterror-to-operating-range.patch index d3038542f92..3c3eddaedbd 100644 --- a/queue-5.4/ntp-clamp-maxerror-and-esterror-to-operating-range.patch +++ b/queue-5.4/ntp-clamp-maxerror-and-esterror-to-operating-range.patch @@ -1,4 +1,4 @@ -From 62c54b4b1871ab6dd7a1ec9d3e820612ccb82202 Mon Sep 17 00:00:00 2001 +From 430345cf6107334938107ba507d3a351e97193f1 Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Fri, 17 May 2024 20:22:44 +0000 Subject: ntp: Clamp maxerror and esterror to operating range @@ -48,27 +48,24 @@ Cc: Miroslav Lichvar 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 +[ cast things to long long to fix compiler warnings - gregkh ] +Signed-off-by: Greg Kroah-Hartman --- - 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 -