* [PATCH] vdso: Fix powerpc build U64_MAX undeclared error
@ 2024-04-09 6:26 ` Adrian Hunter
0 siblings, 0 replies; 7+ messages in thread
From: Adrian Hunter @ 2024-04-09 6:26 UTC (permalink / raw)
To: Thomas Gleixner, Stephen Rothwell
Cc: Peter Zijlstra, Dave Hansen, John Stultz, H. Peter Anvin,
Alexander Gordeev, Vincenzo Frascino, linux-s390, Arnd Bergmann,
x86, Aneesh Kumar K.V, Ingo Molnar, Naveen N. Rao,
Christian Borntraeger, Vasily Gorbik, Heiko Carstens,
Nicholas Piggin, Borislav Petkov, Andy Lutomirski, Bjorn Helgaas,
Anna-Maria Behnsen, Stephen Boyd, Randy Dunlap, linux-kernel,
Sven Schnelle, linuxppc-dev
U64_MAX is not in include/vdso/limits.h, although that isn't noticed on x86
because x86 includes include/linux/limits.h indirectly. However powerpc
is more selective, resulting in the following build error:
In file included from <command-line>:
lib/vdso/gettimeofday.c: In function 'vdso_calc_ns':
lib/vdso/gettimeofday.c:11:33: error: 'U64_MAX' undeclared
11 | # define VDSO_DELTA_MASK(vd) U64_MAX
| ^~~~~~~
Use ULLONG_MAX instead which will work just as well and is in
include/vdso/limits.h.
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Closes: https://lore.kernel.org/all/20240409124905.6816db37@canb.auug.org.au/
Fixes: c8e3a8b6f2e6 ("vdso: Consolidate vdso_calc_delta()")
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
lib/vdso/gettimeofday.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/vdso/gettimeofday.c b/lib/vdso/gettimeofday.c
index 9c3a8d2440c9..899850bd6f0b 100644
--- a/lib/vdso/gettimeofday.c
+++ b/lib/vdso/gettimeofday.c
@@ -8,7 +8,7 @@
#ifndef vdso_calc_ns
#ifdef VDSO_DELTA_NOMASK
-# define VDSO_DELTA_MASK(vd) U64_MAX
+# define VDSO_DELTA_MASK(vd) ULLONG_MAX
#else
# define VDSO_DELTA_MASK(vd) (vd->mask)
#endif
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [tip: timers/core] vdso: Fix powerpc build U64_MAX undeclared error
2024-04-09 6:26 ` Adrian Hunter
(?)
@ 2024-04-09 10:39 ` tip-bot2 for Adrian Hunter
-1 siblings, 0 replies; 7+ messages in thread
From: tip-bot2 for Adrian Hunter @ 2024-04-09 10:39 UTC (permalink / raw)
To: linux-tip-commits
Cc: Stephen Rothwell, Adrian Hunter, Thomas Gleixner, x86, linux-kernel
The following commit has been merged into the timers/core branch of tip:
Commit-ID: 8ff1e6c5aca5fd908e81c33c460c45f9555e1c22
Gitweb: https://git.kernel.org/tip/8ff1e6c5aca5fd908e81c33c460c45f9555e1c22
Author: Adrian Hunter <adrian.hunter@intel.com>
AuthorDate: Tue, 09 Apr 2024 09:26:39 +03:00
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Tue, 09 Apr 2024 12:35:19 +02:00
vdso: Fix powerpc build U64_MAX undeclared error
U64_MAX is not in include/vdso/limits.h, although that isn't noticed on x86
because x86 includes include/linux/limits.h indirectly. However powerpc is
more selective, resulting in the following build error:
In file included from <command-line>:
lib/vdso/gettimeofday.c: In function 'vdso_calc_ns':
lib/vdso/gettimeofday.c:11:33: error: 'U64_MAX' undeclared
11 | # define VDSO_DELTA_MASK(vd) U64_MAX
| ^~~~~~~
Use ULLONG_MAX instead which will work just as well and is in
include/vdso/limits.h.
Fixes: c8e3a8b6f2e6 ("vdso: Consolidate vdso_calc_delta()")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20240409062639.3393-1-adrian.hunter@intel.com
Closes: https://lore.kernel.org/all/20240409124905.6816db37@canb.auug.org.au/
---
lib/vdso/gettimeofday.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/vdso/gettimeofday.c b/lib/vdso/gettimeofday.c
index 9c3a8d2..899850b 100644
--- a/lib/vdso/gettimeofday.c
+++ b/lib/vdso/gettimeofday.c
@@ -8,7 +8,7 @@
#ifndef vdso_calc_ns
#ifdef VDSO_DELTA_NOMASK
-# define VDSO_DELTA_MASK(vd) U64_MAX
+# define VDSO_DELTA_MASK(vd) ULLONG_MAX
#else
# define VDSO_DELTA_MASK(vd) (vd->mask)
#endif
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] vdso: Fix powerpc build U64_MAX undeclared error
2024-04-09 6:26 ` Adrian Hunter
@ 2024-04-09 17:07 ` John Stultz
-1 siblings, 0 replies; 7+ messages in thread
From: John Stultz @ 2024-04-09 17:07 UTC (permalink / raw)
To: Adrian Hunter
Cc: Thomas Gleixner, Stephen Rothwell, Michael Ellerman,
Nicholas Piggin, Christophe Leroy, Aneesh Kumar K.V,
Naveen N. Rao, Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
Christian Borntraeger, Sven Schnelle, Ingo Molnar,
Borislav Petkov, Dave Hansen, x86, H. Peter Anvin,
Andy Lutomirski, Vincenzo Frascino, Stephen Boyd, Peter Zijlstra,
Randy Dunlap, Bjorn Helgaas, Arnd Bergmann, Anna-Maria Behnsen,
linuxppc-dev, linux-kernel, linux-s390
On Mon, Apr 8, 2024 at 11:27 PM Adrian Hunter <adrian.hunter@intel.com> wrote:
>
> U64_MAX is not in include/vdso/limits.h, although that isn't noticed on x86
> because x86 includes include/linux/limits.h indirectly. However powerpc
> is more selective, resulting in the following build error:
>
> In file included from <command-line>:
> lib/vdso/gettimeofday.c: In function 'vdso_calc_ns':
> lib/vdso/gettimeofday.c:11:33: error: 'U64_MAX' undeclared
> 11 | # define VDSO_DELTA_MASK(vd) U64_MAX
> | ^~~~~~~
>
> Use ULLONG_MAX instead which will work just as well and is in
> include/vdso/limits.h.
>
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Closes: https://lore.kernel.org/all/20240409124905.6816db37@canb.auug.org.au/
> Fixes: c8e3a8b6f2e6 ("vdso: Consolidate vdso_calc_delta()")
> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Acked-by: John Stultz <jstultz@google.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] vdso: Fix powerpc build U64_MAX undeclared error
@ 2024-04-09 17:07 ` John Stultz
0 siblings, 0 replies; 7+ messages in thread
From: John Stultz @ 2024-04-09 17:07 UTC (permalink / raw)
To: Adrian Hunter
Cc: Peter Zijlstra, Dave Hansen, H. Peter Anvin, Alexander Gordeev,
Vincenzo Frascino, Stephen Rothwell, Arnd Bergmann, x86,
Aneesh Kumar K.V, Ingo Molnar, Naveen N. Rao,
Christian Borntraeger, Vasily Gorbik, linux-s390, Heiko Carstens,
Nicholas Piggin, Borislav Petkov, Andy Lutomirski, Bjorn Helgaas,
Thomas Gleixner, Anna-Maria Behnsen, Stephen Boyd, Randy Dunlap,
linux-kernel, Sven Schnelle, linuxppc-dev
On Mon, Apr 8, 2024 at 11:27 PM Adrian Hunter <adrian.hunter@intel.com> wrote:
>
> U64_MAX is not in include/vdso/limits.h, although that isn't noticed on x86
> because x86 includes include/linux/limits.h indirectly. However powerpc
> is more selective, resulting in the following build error:
>
> In file included from <command-line>:
> lib/vdso/gettimeofday.c: In function 'vdso_calc_ns':
> lib/vdso/gettimeofday.c:11:33: error: 'U64_MAX' undeclared
> 11 | # define VDSO_DELTA_MASK(vd) U64_MAX
> | ^~~~~~~
>
> Use ULLONG_MAX instead which will work just as well and is in
> include/vdso/limits.h.
>
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Closes: https://lore.kernel.org/all/20240409124905.6816db37@canb.auug.org.au/
> Fixes: c8e3a8b6f2e6 ("vdso: Consolidate vdso_calc_delta()")
> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Acked-by: John Stultz <jstultz@google.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] vdso: Fix powerpc build U64_MAX undeclared error
2024-04-09 6:26 ` Adrian Hunter
@ 2024-04-10 2:47 ` Stephen Rothwell
-1 siblings, 0 replies; 7+ messages in thread
From: Stephen Rothwell @ 2024-04-10 2:47 UTC (permalink / raw)
To: Adrian Hunter
Cc: Thomas Gleixner, Michael Ellerman, Nicholas Piggin,
Christophe Leroy, Aneesh Kumar K.V, Naveen N. Rao,
Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
Christian Borntraeger, Sven Schnelle, Ingo Molnar,
Borislav Petkov, Dave Hansen, x86, H. Peter Anvin,
Andy Lutomirski, Vincenzo Frascino, John Stultz, Stephen Boyd,
Peter Zijlstra, Randy Dunlap, Bjorn Helgaas, Arnd Bergmann,
Anna-Maria Behnsen, linuxppc-dev, linux-kernel, linux-s390
[-- Attachment #1: Type: text/plain, Size: 1634 bytes --]
Hi Adrian,
On Tue, 9 Apr 2024 09:26:39 +0300 Adrian Hunter <adrian.hunter@intel.com> wrote:
>
> U64_MAX is not in include/vdso/limits.h, although that isn't noticed on x86
> because x86 includes include/linux/limits.h indirectly. However powerpc
> is more selective, resulting in the following build error:
>
> In file included from <command-line>:
> lib/vdso/gettimeofday.c: In function 'vdso_calc_ns':
> lib/vdso/gettimeofday.c:11:33: error: 'U64_MAX' undeclared
> 11 | # define VDSO_DELTA_MASK(vd) U64_MAX
> | ^~~~~~~
>
> Use ULLONG_MAX instead which will work just as well and is in
> include/vdso/limits.h.
>
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Closes: https://lore.kernel.org/all/20240409124905.6816db37@canb.auug.org.au/
> Fixes: c8e3a8b6f2e6 ("vdso: Consolidate vdso_calc_delta()")
> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
> ---
> lib/vdso/gettimeofday.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/vdso/gettimeofday.c b/lib/vdso/gettimeofday.c
> index 9c3a8d2440c9..899850bd6f0b 100644
> --- a/lib/vdso/gettimeofday.c
> +++ b/lib/vdso/gettimeofday.c
> @@ -8,7 +8,7 @@
> #ifndef vdso_calc_ns
>
> #ifdef VDSO_DELTA_NOMASK
> -# define VDSO_DELTA_MASK(vd) U64_MAX
> +# define VDSO_DELTA_MASK(vd) ULLONG_MAX
> #else
> # define VDSO_DELTA_MASK(vd) (vd->mask)
> #endif
> --
> 2.34.1
>
I have applied that to linux-next today and it builds for me.
Tested-by: Stephen Rothwell <sfr@canb.auug.org.au> # build only
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] vdso: Fix powerpc build U64_MAX undeclared error
@ 2024-04-10 2:47 ` Stephen Rothwell
0 siblings, 0 replies; 7+ messages in thread
From: Stephen Rothwell @ 2024-04-10 2:47 UTC (permalink / raw)
To: Adrian Hunter
Cc: Peter Zijlstra, Dave Hansen, John Stultz, H. Peter Anvin,
Alexander Gordeev, Vincenzo Frascino, linux-s390, Arnd Bergmann,
x86, Aneesh Kumar K.V, Ingo Molnar, Naveen N. Rao,
Christian Borntraeger, Vasily Gorbik, Heiko Carstens,
Nicholas Piggin, Borislav Petkov, Andy Lutomirski, Bjorn Helgaas,
Thomas Gleixner, Anna-Maria Behnsen, Stephen Boyd, Randy Dunlap,
linux-kernel, Sven Schnelle, linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 1634 bytes --]
Hi Adrian,
On Tue, 9 Apr 2024 09:26:39 +0300 Adrian Hunter <adrian.hunter@intel.com> wrote:
>
> U64_MAX is not in include/vdso/limits.h, although that isn't noticed on x86
> because x86 includes include/linux/limits.h indirectly. However powerpc
> is more selective, resulting in the following build error:
>
> In file included from <command-line>:
> lib/vdso/gettimeofday.c: In function 'vdso_calc_ns':
> lib/vdso/gettimeofday.c:11:33: error: 'U64_MAX' undeclared
> 11 | # define VDSO_DELTA_MASK(vd) U64_MAX
> | ^~~~~~~
>
> Use ULLONG_MAX instead which will work just as well and is in
> include/vdso/limits.h.
>
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Closes: https://lore.kernel.org/all/20240409124905.6816db37@canb.auug.org.au/
> Fixes: c8e3a8b6f2e6 ("vdso: Consolidate vdso_calc_delta()")
> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
> ---
> lib/vdso/gettimeofday.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/vdso/gettimeofday.c b/lib/vdso/gettimeofday.c
> index 9c3a8d2440c9..899850bd6f0b 100644
> --- a/lib/vdso/gettimeofday.c
> +++ b/lib/vdso/gettimeofday.c
> @@ -8,7 +8,7 @@
> #ifndef vdso_calc_ns
>
> #ifdef VDSO_DELTA_NOMASK
> -# define VDSO_DELTA_MASK(vd) U64_MAX
> +# define VDSO_DELTA_MASK(vd) ULLONG_MAX
> #else
> # define VDSO_DELTA_MASK(vd) (vd->mask)
> #endif
> --
> 2.34.1
>
I have applied that to linux-next today and it builds for me.
Tested-by: Stephen Rothwell <sfr@canb.auug.org.au> # build only
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread