linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Masahiro Yamada <masahiroy@kernel.org>
To: Arnd Bergmann <arnd@arndb.de>, linux-kernel@vger.kernel.org
Cc: linux-kbuild@vger.kernel.org, linux-arch@vger.kernel.org,
	Masahiro Yamada <masahiroy@kernel.org>
Subject: [PATCH 7/8] posix_types.h: add __kernel_uintptr_t to UAPI posix_types.h
Date: Mon,  4 Apr 2022 15:19:47 +0900	[thread overview]
Message-ID: <20220404061948.2111820-8-masahiroy@kernel.org> (raw)
In-Reply-To: <20220404061948.2111820-1-masahiroy@kernel.org>

This will allow us to replace uintptr_t with __kernel_uintptr_t in
exported headers. I think this is acceptable because we already have
__kernel_ptrdiff_t.

Define __kernel_uintptr_t in the same ways as __kernel_ptrdiff_t
but with 'unsigned' qualifier.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 arch/h8300/include/uapi/asm/posix_types.h  | 1 +
 arch/s390/include/uapi/asm/posix_types.h   | 2 ++
 arch/sparc/include/uapi/asm/posix_types.h  | 1 +
 arch/xtensa/include/uapi/asm/posix_types.h | 1 +
 include/linux/types.h                      | 2 +-
 include/uapi/asm-generic/posix_types.h     | 2 ++
 tools/arch/h8300/include/asm/bitsperlong.h | 1 +
 7 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/arch/h8300/include/uapi/asm/posix_types.h b/arch/h8300/include/uapi/asm/posix_types.h
index 3efc9dd59476..9728120c6742 100644
--- a/arch/h8300/include/uapi/asm/posix_types.h
+++ b/arch/h8300/include/uapi/asm/posix_types.h
@@ -7,6 +7,7 @@
 typedef unsigned long	__kernel_size_t;
 typedef long		__kernel_ssize_t;
 typedef long		__kernel_ptrdiff_t;
+typedef unsigned long	__kernel_uintptr_t;
 
 #include <asm-generic/posix_types.h>
 
diff --git a/arch/s390/include/uapi/asm/posix_types.h b/arch/s390/include/uapi/asm/posix_types.h
index 1913613e71b6..2c700a44bf83 100644
--- a/arch/s390/include/uapi/asm/posix_types.h
+++ b/arch/s390/include/uapi/asm/posix_types.h
@@ -34,6 +34,7 @@ typedef unsigned short  __kernel_ipc_pid_t;
 typedef unsigned short  __kernel_uid_t;
 typedef unsigned short  __kernel_gid_t;
 typedef int             __kernel_ptrdiff_t;
+typedef unsigned int    __kernel_uintptr_t;
 
 #else /* __s390x__ */
 
@@ -43,6 +44,7 @@ typedef int             __kernel_ipc_pid_t;
 typedef unsigned int    __kernel_uid_t;
 typedef unsigned int    __kernel_gid_t;
 typedef long            __kernel_ptrdiff_t;
+typedef unsigned long   __kernel_uintptr_t;
 typedef unsigned long   __kernel_sigset_t;      /* at least 32 bits */
 
 #endif /* __s390x__ */
diff --git a/arch/sparc/include/uapi/asm/posix_types.h b/arch/sparc/include/uapi/asm/posix_types.h
index f139e0048628..402e1656e3b5 100644
--- a/arch/sparc/include/uapi/asm/posix_types.h
+++ b/arch/sparc/include/uapi/asm/posix_types.h
@@ -35,6 +35,7 @@ struct __kernel_old_timeval {
 typedef unsigned int           __kernel_size_t;
 typedef int                    __kernel_ssize_t;
 typedef long int               __kernel_ptrdiff_t;
+typedef unsigned long          __kernel_uintptr_t;
 #define __kernel_size_t __kernel_size_t
 
 typedef unsigned short         __kernel_ipc_pid_t;
diff --git a/arch/xtensa/include/uapi/asm/posix_types.h b/arch/xtensa/include/uapi/asm/posix_types.h
index 1dc67592881f..5ba366f6c789 100644
--- a/arch/xtensa/include/uapi/asm/posix_types.h
+++ b/arch/xtensa/include/uapi/asm/posix_types.h
@@ -26,6 +26,7 @@ typedef unsigned short	__kernel_ipc_pid_t;
 typedef unsigned int	__kernel_size_t;
 typedef int		__kernel_ssize_t;
 typedef long		__kernel_ptrdiff_t;
+typedef unsigned long	__kernel_uintptr_t;
 #define __kernel_size_t __kernel_size_t
 
 typedef unsigned short	__kernel_old_uid_t;
diff --git a/include/linux/types.h b/include/linux/types.h
index ea8cf60a8a79..a54335007fe2 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -34,7 +34,7 @@ typedef __kernel_gid32_t	gid_t;
 typedef __kernel_uid16_t        uid16_t;
 typedef __kernel_gid16_t        gid16_t;
 
-typedef unsigned long		uintptr_t;
+typedef __kernel_uintptr_t	uintptr_t;
 
 #ifdef CONFIG_HAVE_UID16
 /* This is defined by include/asm-{arch}/posix_types.h */
diff --git a/include/uapi/asm-generic/posix_types.h b/include/uapi/asm-generic/posix_types.h
index b5f7594eee7a..4a7c5b852e38 100644
--- a/include/uapi/asm-generic/posix_types.h
+++ b/include/uapi/asm-generic/posix_types.h
@@ -68,10 +68,12 @@ typedef unsigned int	__kernel_old_dev_t;
 typedef unsigned int	__kernel_size_t;
 typedef int		__kernel_ssize_t;
 typedef int		__kernel_ptrdiff_t;
+typedef unsigned int	__kernel_uintptr_t;
 #else
 typedef __kernel_ulong_t __kernel_size_t;
 typedef __kernel_long_t	__kernel_ssize_t;
 typedef __kernel_long_t	__kernel_ptrdiff_t;
+typedef __kernel_ulong_t __kernel_uintptr_t;
 #endif
 #endif
 
diff --git a/tools/arch/h8300/include/asm/bitsperlong.h b/tools/arch/h8300/include/asm/bitsperlong.h
index fa1508337ffc..fea7dc923006 100644
--- a/tools/arch/h8300/include/asm/bitsperlong.h
+++ b/tools/arch/h8300/include/asm/bitsperlong.h
@@ -10,6 +10,7 @@
 typedef unsigned long	__kernel_size_t;
 typedef long		__kernel_ssize_t;
 typedef long		__kernel_ptrdiff_t;
+typedef unsigned long	__kernel_uintptr_t;
 #endif
 
 #endif /* __ASM_H8300_BITS_PER_LONG */
-- 
2.32.0


  parent reply	other threads:[~2022-04-04  6:20 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-04  6:19 [PATCH 0/8] UAPI: make more exported headers self-contained, and put them into test coverage Masahiro Yamada
2022-04-04  6:19 ` [PATCH 1/8] agpgart.h: do not include <stdlib.h> from exported header Masahiro Yamada
2022-04-04  7:40   ` Christoph Hellwig
2022-04-04 17:27   ` Nick Desaulniers
2022-04-04  6:19 ` [PATCH 2/8] kbuild: prevent exported headers from including <stdlib.h>, <stdbool.h> Masahiro Yamada
2022-04-04  7:41   ` Christoph Hellwig
2022-04-04  8:01     ` Arnd Bergmann
2022-04-04  8:03     ` Masahiro Yamada
2022-04-04 17:34     ` Nick Desaulniers
2022-04-05  1:12       ` Masahiro Yamada
2022-04-04  6:19 ` [PATCH 3/8] riscv: add linux/bpf_perf_event.h to UAPI compile-test coverage Masahiro Yamada
2022-04-04  7:41   ` Christoph Hellwig
2022-04-04  6:19 ` [PATCH 4/8] mips: add asm/stat.h " Masahiro Yamada
2022-04-04  7:42   ` Christoph Hellwig
2022-04-04  6:19 ` [PATCH 5/8] powerpc: " Masahiro Yamada
2022-04-04  7:42   ` Christoph Hellwig
2022-04-04  6:19 ` [PATCH 6/8] sparc: " Masahiro Yamada
2022-04-04  7:43   ` Christoph Hellwig
2022-04-04  6:19 ` Masahiro Yamada [this message]
2022-04-04 11:30   ` [PATCH 7/8] posix_types.h: add __kernel_uintptr_t to UAPI posix_types.h kernel test robot
2022-04-04 11:51     ` Masahiro Yamada
2022-04-04 12:02       ` Masahiro Yamada
2022-04-04 11:51   ` kernel test robot
2022-04-04 13:04   ` kernel test robot
2022-04-04  6:19 ` [PATCH 8/8] virtio_ring.h: do not include <stdint.h> from exported header Masahiro Yamada
2022-04-04  7:44   ` Christoph Hellwig
2022-04-04  7:58     ` Masahiro Yamada
2022-04-04  8:04     ` Arnd Bergmann
2022-04-05  5:35       ` Christoph Hellwig
2022-04-05  6:29         ` Arnd Bergmann
2022-04-05  7:01           ` Christoph Hellwig
2022-04-05 11:55             ` Michael S. Tsirkin
2022-04-05 11:57           ` Michael S. Tsirkin
2022-04-05 11:59     ` Michael S. Tsirkin
2022-04-05 11:57   ` Michael S. Tsirkin
2022-04-04  7:34 ` [PATCH 0/8] UAPI: make more exported headers self-contained, and put them into test coverage Arnd Bergmann
2022-05-13  8:43   ` Masahiro Yamada
2022-05-13  9:01     ` Arnd Bergmann
2022-05-13  9:13       ` Masahiro Yamada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220404061948.2111820-8-masahiroy@kernel.org \
    --to=masahiroy@kernel.org \
    --cc=arnd@arndb.de \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).