Skip to contentSkip to conversation

vdso: Fix powerpc build U64_MAX undeclared error

PATCH Applied Adrian Hunter 4 participants 4 messages Apr 9, 2024 – Apr 10, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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()")
---
 lib/vdso/gettimeofday.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/vdso/gettimeofday.c +1 -1
index 9c3a8d2440c9..899850bd6f0b 100644
@@ -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
Signature · 1 line
2.34.1
merge bot Applied
#1 lore raw
The following commit has been merged into the timers/core branch of tip:

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 <[email protected]>
AuthorDate:    Tue, 09 Apr 2024 09:26:39 +03:00
Committer:     Thomas Gleixner <[email protected]>
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.

---
 lib/vdso/gettimeofday.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/vdso/gettimeofday.c +1 -1
index 9c3a8d2..899850b 100644
@@ -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
Acked-by on v1 1/1
#2 lore raw
In reply to Adrian Hunter
Quoted 11 lines · Adrian Hunter

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
        |                                 ^~~~~~~
Quoted 7 lines

Use ULLONG_MAX instead which will work just as well and is in include/vdso/limits.h.

Fixes c8e3a8b6f2e6 ("vdso: Consolidate vdso_calc_delta()")
Tested-by on v1 1/1
#3 lore raw
In reply to Adrian Hunter

Hi Adrian,

Quoted 38 lines · On Tue, 9 Apr 2024 09:26:39 +0300 Adrian Hunter <[email protected]>…

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()")
---
 lib/vdso/gettimeofday.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/vdso/gettimeofday.c +1 -1
index 9c3a8d2440c9..899850bd6f0b 100644
@@ -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
Signature · 1 line
2.34.1

I have applied that to linux-next today and it builds for me.

Signature · 2 lines
Cheers,
Stephen Rothwell