]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
fix up ntp patch on older kernels
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 12 Aug 2024 10:48:04 +0000 (12:48 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 12 Aug 2024 10:48:04 +0000 (12:48 +0200)
queue-4.19/ntp-clamp-maxerror-and-esterror-to-operating-range.patch
queue-5.10/ntp-clamp-maxerror-and-esterror-to-operating-range.patch
queue-5.4/ntp-clamp-maxerror-and-esterror-to-operating-range.patch

index 90a5b8e4e767408c2405a8e439c100e8e2600240..a31c068955fad29cb76017c4e235fc7963ed92f6 100644 (file)
@@ -48,27 +48,24 @@ Cc: Miroslav Lichvar <mlichvar@redhat.com>
 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
-
index 82862baa62d0f86040eed030a13ead90b652b28d..3c3eddaedbde0dce900108d0d02563bc1ef6e56a 100644 (file)
@@ -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 <sashal@kernel.org>
 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 <mlichvar@redhat.com>
 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
-
index d3038542f9209374e8f0d5656bbed48c04dbb676..3c3eddaedbde0dce900108d0d02563bc1ef6e56a 100644 (file)
@@ -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 <sashal@kernel.org>
 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 <mlichvar@redhat.com>
 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
-