Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

shmbuf.h: add asm/shmbuf.h to UAPI compile-test coverage

asm/shmbuf.h is currently excluded from the UAPI compile-test because of
the errors like follows:

HDRTEST usr/include/asm/shmbuf.h
In file included from ./usr/include/asm/shmbuf.h:6,
from <command-line>:
./usr/include/asm-generic/shmbuf.h:26:33: error: field ‘shm_perm’ has incomplete type
26 | struct ipc64_perm shm_perm; /* operation perms */
| ^~~~~~~~
./usr/include/asm-generic/shmbuf.h:27:9: error: unknown type name ‘size_t’
27 | size_t shm_segsz; /* size of segment (bytes) */
| ^~~~~~
./usr/include/asm-generic/shmbuf.h:40:9: error: unknown type name ‘__kernel_pid_t’
40 | __kernel_pid_t shm_cpid; /* pid of creator */
| ^~~~~~~~~~~~~~
./usr/include/asm-generic/shmbuf.h:41:9: error: unknown type name ‘__kernel_pid_t’
41 | __kernel_pid_t shm_lpid; /* pid of last operator */
| ^~~~~~~~~~~~~~

The errors can be fixed by replacing size_t with __kernel_size_t and by
including proper headers.

Then, remove the no-header-test entry from user/include/Makefile.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

authored by

Masahiro Yamada and committed by
Arnd Bergmann
4a3233c1 72113d0a

+27 -8
+5 -2
arch/mips/include/uapi/asm/shmbuf.h
··· 2 2 #ifndef _ASM_SHMBUF_H 3 3 #define _ASM_SHMBUF_H 4 4 5 + #include <asm/ipcbuf.h> 6 + #include <asm/posix_types.h> 7 + 5 8 /* 6 9 * The shmid64_ds structure for the MIPS architecture. 7 10 * Note extra padding because this structure is passed back and forth ··· 19 16 #ifdef __mips64 20 17 struct shmid64_ds { 21 18 struct ipc64_perm shm_perm; /* operation perms */ 22 - size_t shm_segsz; /* size of segment (bytes) */ 19 + __kernel_size_t shm_segsz; /* size of segment (bytes) */ 23 20 long shm_atime; /* last attach time */ 24 21 long shm_dtime; /* last detach time */ 25 22 long shm_ctime; /* last change time */ ··· 32 29 #else 33 30 struct shmid64_ds { 34 31 struct ipc64_perm shm_perm; /* operation perms */ 35 - size_t shm_segsz; /* size of segment (bytes) */ 32 + __kernel_size_t shm_segsz; /* size of segment (bytes) */ 36 33 unsigned long shm_atime; /* last attach time */ 37 34 unsigned long shm_dtime; /* last detach time */ 38 35 unsigned long shm_ctime; /* last change time */
+2
arch/parisc/include/uapi/asm/shmbuf.h
··· 3 3 #define _PARISC_SHMBUF_H 4 4 5 5 #include <asm/bitsperlong.h> 6 + #include <asm/ipcbuf.h> 7 + #include <asm/posix_types.h> 6 8 7 9 /* 8 10 * The shmid64_ds structure for parisc architecture.
+4 -1
arch/powerpc/include/uapi/asm/shmbuf.h
··· 2 2 #ifndef _ASM_POWERPC_SHMBUF_H 3 3 #define _ASM_POWERPC_SHMBUF_H 4 4 5 + #include <asm/ipcbuf.h> 6 + #include <asm/posix_types.h> 7 + 5 8 /* 6 9 * This program is free software; you can redistribute it and/or 7 10 * modify it under the terms of the GNU General Public License ··· 37 34 unsigned long shm_ctime; /* last change time */ 38 35 unsigned long __unused4; 39 36 #endif 40 - size_t shm_segsz; /* size of segment (bytes) */ 37 + __kernel_size_t shm_segsz; /* size of segment (bytes) */ 41 38 __kernel_pid_t shm_cpid; /* pid of creator */ 42 39 __kernel_pid_t shm_lpid; /* pid of last operator */ 43 40 unsigned long shm_nattch; /* no. of current attaches */
+4 -1
arch/sparc/include/uapi/asm/shmbuf.h
··· 2 2 #ifndef _SPARC_SHMBUF_H 3 3 #define _SPARC_SHMBUF_H 4 4 5 + #include <asm/ipcbuf.h> 6 + #include <asm/posix_types.h> 7 + 5 8 /* 6 9 * The shmid64_ds structure for sparc architecture. 7 10 * Note extra padding because this structure is passed back and forth ··· 28 25 unsigned long shm_ctime_high; 29 26 unsigned long shm_ctime; /* last change time */ 30 27 #endif 31 - size_t shm_segsz; /* size of segment (bytes) */ 28 + __kernel_size_t shm_segsz; /* size of segment (bytes) */ 32 29 __kernel_pid_t shm_cpid; /* pid of creator */ 33 30 __kernel_pid_t shm_lpid; /* pid of last operator */ 34 31 unsigned long shm_nattch; /* no. of current attaches */
+5 -1
arch/x86/include/uapi/asm/shmbuf.h
··· 5 5 #if !defined(__x86_64__) || !defined(__ILP32__) 6 6 #include <asm-generic/shmbuf.h> 7 7 #else 8 + 9 + #include <asm/ipcbuf.h> 10 + #include <asm/posix_types.h> 11 + 8 12 /* 9 13 * The shmid64_ds structure for x86 architecture with x32 ABI. 10 14 * ··· 19 15 20 16 struct shmid64_ds { 21 17 struct ipc64_perm shm_perm; /* operation perms */ 22 - size_t shm_segsz; /* size of segment (bytes) */ 18 + __kernel_size_t shm_segsz; /* size of segment (bytes) */ 23 19 __kernel_long_t shm_atime; /* last attach time */ 24 20 __kernel_long_t shm_dtime; /* last detach time */ 25 21 __kernel_long_t shm_ctime; /* last change time */
+4 -1
arch/xtensa/include/uapi/asm/shmbuf.h
··· 20 20 #ifndef _XTENSA_SHMBUF_H 21 21 #define _XTENSA_SHMBUF_H 22 22 23 + #include <asm/ipcbuf.h> 24 + #include <asm/posix_types.h> 25 + 23 26 struct shmid64_ds { 24 27 struct ipc64_perm shm_perm; /* operation perms */ 25 - size_t shm_segsz; /* size of segment (bytes) */ 28 + __kernel_size_t shm_segsz; /* size of segment (bytes) */ 26 29 unsigned long shm_atime; /* last attach time */ 27 30 unsigned long shm_atime_high; 28 31 unsigned long shm_dtime; /* last detach time */
+3 -1
include/uapi/asm-generic/shmbuf.h
··· 3 3 #define __ASM_GENERIC_SHMBUF_H 4 4 5 5 #include <asm/bitsperlong.h> 6 + #include <asm/ipcbuf.h> 7 + #include <asm/posix_types.h> 6 8 7 9 /* 8 10 * The shmid64_ds structure for x86 architecture. ··· 26 24 27 25 struct shmid64_ds { 28 26 struct ipc64_perm shm_perm; /* operation perms */ 29 - size_t shm_segsz; /* size of segment (bytes) */ 27 + __kernel_size_t shm_segsz; /* size of segment (bytes) */ 30 28 #if __BITS_PER_LONG == 64 31 29 long shm_atime; /* last attach time */ 32 30 long shm_dtime; /* last detach time */
-1
usr/include/Makefile
··· 20 20 # Please consider to fix the header first. 21 21 # 22 22 # Sorted alphabetically. 23 - no-header-test += asm/shmbuf.h 24 23 no-header-test += asm/ucontext.h 25 24 no-header-test += drm/vmwgfx_drm.h 26 25 no-header-test += linux/am437x-vpfe.h