public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] linux: Use same type for MMAP2_PAGE_UNIT
@ 2022-08-31 18:14 Adhemerval Zanella
  2022-09-20 12:45 ` Florian Weimer
  0 siblings, 1 reply; 2+ messages in thread
From: Adhemerval Zanella @ 2022-08-31 18:14 UTC (permalink / raw)
  To: libc-alpha

It avoid a possible compiler warning where right size of operator
is converted from a negative value to unsigned.
---
 sysdeps/unix/sysv/linux/arc/mmap_internal.h  | 2 +-
 sysdeps/unix/sysv/linux/ia64/mmap_internal.h | 2 +-
 sysdeps/unix/sysv/linux/m68k/mmap_internal.h | 2 +-
 sysdeps/unix/sysv/linux/mmap_internal.h      | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/sysdeps/unix/sysv/linux/arc/mmap_internal.h b/sysdeps/unix/sysv/linux/arc/mmap_internal.h
index d8bbcab0a1..59e8260b5c 100644
--- a/sysdeps/unix/sysv/linux/arc/mmap_internal.h
+++ b/sysdeps/unix/sysv/linux/arc/mmap_internal.h
@@ -20,7 +20,7 @@
 #define MMAP_ARC_INTERNAL_H
 
 /* 8K is default but determine the shift dynamically with getpagesize.  */
-#define MMAP2_PAGE_UNIT -1
+#define MMAP2_PAGE_UNIT -1ULL
 
 #include_next <mmap_internal.h>
 
diff --git a/sysdeps/unix/sysv/linux/ia64/mmap_internal.h b/sysdeps/unix/sysv/linux/ia64/mmap_internal.h
index 0c0a0ced99..465d589281 100644
--- a/sysdeps/unix/sysv/linux/ia64/mmap_internal.h
+++ b/sysdeps/unix/sysv/linux/ia64/mmap_internal.h
@@ -22,7 +22,7 @@
 /* Linux allows PAGE_SHIFT in range of [12-16] and expect
    mmap2 offset to be provided in based on the configured pagesize.
    Determine the shift dynamically with getpagesize.  */
-#define MMAP2_PAGE_UNIT -1
+#define MMAP2_PAGE_UNIT -1ULL
 
 #include_next <mmap_internal.h>
 
diff --git a/sysdeps/unix/sysv/linux/m68k/mmap_internal.h b/sysdeps/unix/sysv/linux/m68k/mmap_internal.h
index 8e6f1ed84c..9330edfc05 100644
--- a/sysdeps/unix/sysv/linux/m68k/mmap_internal.h
+++ b/sysdeps/unix/sysv/linux/m68k/mmap_internal.h
@@ -22,7 +22,7 @@
 /* ColdFire and Sun 3 kernels have PAGE_SHIFT set to 13 and expect
    mmap2 offset to be provided in 8K pages.  Determine the shift
    dynamically with getpagesize.  */
-#define MMAP2_PAGE_UNIT -1
+#define MMAP2_PAGE_UNIT -1ULL
 
 #include_next <mmap_internal.h>
 
diff --git a/sysdeps/unix/sysv/linux/mmap_internal.h b/sysdeps/unix/sysv/linux/mmap_internal.h
index aebf97d064..2d118b0d8a 100644
--- a/sysdeps/unix/sysv/linux/mmap_internal.h
+++ b/sysdeps/unix/sysv/linux/mmap_internal.h
@@ -28,7 +28,7 @@
 # define MMAP2_PAGE_UNIT 4096ULL
 #endif
 
-#if MMAP2_PAGE_UNIT == -1
+#if MMAP2_PAGE_UNIT == -1ULL
 static uint64_t page_unit;
 # define MMAP_CHECK_PAGE_UNIT()			\
   if (page_unit == 0)				\
-- 
2.34.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] linux: Use same type for MMAP2_PAGE_UNIT
  2022-08-31 18:14 [PATCH] linux: Use same type for MMAP2_PAGE_UNIT Adhemerval Zanella
@ 2022-09-20 12:45 ` Florian Weimer
  0 siblings, 0 replies; 2+ messages in thread
From: Florian Weimer @ 2022-09-20 12:45 UTC (permalink / raw)
  To: Adhemerval Zanella via Libc-alpha; +Cc: Adhemerval Zanella

* Adhemerval Zanella via Libc-alpha:

> It avoid a possible compiler warning where right size of operator
> is converted from a negative value to unsigned.
> ---
>  sysdeps/unix/sysv/linux/arc/mmap_internal.h  | 2 +-
>  sysdeps/unix/sysv/linux/ia64/mmap_internal.h | 2 +-
>  sysdeps/unix/sysv/linux/m68k/mmap_internal.h | 2 +-
>  sysdeps/unix/sysv/linux/mmap_internal.h      | 2 +-
>  4 files changed, 4 insertions(+), 4 deletions(-)

This looks okay.

Reviewed-by: Florian Weimer <fweimer@redhat.com>

Thanks,
Florian


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-20 12:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-31 18:14 [PATCH] linux: Use same type for MMAP2_PAGE_UNIT Adhemerval Zanella
2022-09-20 12:45 ` Florian Weimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).