shmbuf.h: add asm/shmbuf.h to UAPI compile-test coverage
authorMasahiro Yamada <masahiroy@kernel.org>
Thu, 10 Feb 2022 02:11:25 +0000 (11:11 +0900)
committerArnd Bergmann <arnd@arndb.de>
Thu, 17 Feb 2022 08:09:37 +0000 (09:09 +0100)
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>
arch/mips/include/uapi/asm/shmbuf.h
arch/parisc/include/uapi/asm/shmbuf.h
arch/powerpc/include/uapi/asm/shmbuf.h
arch/sparc/include/uapi/asm/shmbuf.h
arch/x86/include/uapi/asm/shmbuf.h
arch/xtensa/include/uapi/asm/shmbuf.h
include/uapi/asm-generic/shmbuf.h
usr/include/Makefile

index 680bb95b2240aaa6dd5ade82ceb5b7b6d19b4242..eb74d304b77997424f5d97980065635ba2993934 100644 (file)
@@ -2,6 +2,9 @@
 #ifndef _ASM_SHMBUF_H
 #define _ASM_SHMBUF_H
 
+#include <asm/ipcbuf.h>
+#include <asm/posix_types.h>
+
 /*
  * The shmid64_ds structure for the MIPS architecture.
  * Note extra padding because this structure is passed back and forth
@@ -16,7 +19,7 @@
 #ifdef __mips64
 struct shmid64_ds {
        struct ipc64_perm       shm_perm;       /* operation perms */
-       size_t                  shm_segsz;      /* size of segment (bytes) */
+       __kernel_size_t         shm_segsz;      /* size of segment (bytes) */
        long                    shm_atime;      /* last attach time */
        long                    shm_dtime;      /* last detach time */
        long                    shm_ctime;      /* last change time */
@@ -29,7 +32,7 @@ struct shmid64_ds {
 #else
 struct shmid64_ds {
        struct ipc64_perm       shm_perm;       /* operation perms */
-       size_t                  shm_segsz;      /* size of segment (bytes) */
+       __kernel_size_t         shm_segsz;      /* size of segment (bytes) */
        unsigned long           shm_atime;      /* last attach time */
        unsigned long           shm_dtime;      /* last detach time */
        unsigned long           shm_ctime;      /* last change time */
index 5da3089be65ec537d4cc377e2b10d210ed7aa713..532da742fb560796148df66613039510def6e685 100644 (file)
@@ -3,6 +3,8 @@
 #define _PARISC_SHMBUF_H
 
 #include <asm/bitsperlong.h>
+#include <asm/ipcbuf.h>
+#include <asm/posix_types.h>
 
 /* 
  * The shmid64_ds structure for parisc architecture.
index 00422b2f3c63e72ac8abd3ca92485fa12e2f566c..439a3a02ba641041ae010fcec9ade04637687784 100644 (file)
@@ -2,6 +2,9 @@
 #ifndef _ASM_POWERPC_SHMBUF_H
 #define _ASM_POWERPC_SHMBUF_H
 
+#include <asm/ipcbuf.h>
+#include <asm/posix_types.h>
+
 /*
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -34,7 +37,7 @@ struct shmid64_ds {
        unsigned long           shm_ctime;      /* last change time */
        unsigned long           __unused4;
 #endif
-       size_t                  shm_segsz;      /* size of segment (bytes) */
+       __kernel_size_t         shm_segsz;      /* size of segment (bytes) */
        __kernel_pid_t          shm_cpid;       /* pid of creator */
        __kernel_pid_t          shm_lpid;       /* pid of last operator */
        unsigned long           shm_nattch;     /* no. of current attaches */
index a5d7d8d681c41446e6d087ed24b12447456aa7d6..ed4f061c7a159682cd726a67cc58949b93409bb6 100644 (file)
@@ -2,6 +2,9 @@
 #ifndef _SPARC_SHMBUF_H
 #define _SPARC_SHMBUF_H
 
+#include <asm/ipcbuf.h>
+#include <asm/posix_types.h>
+
 /* 
  * The shmid64_ds structure for sparc architecture.
  * Note extra padding because this structure is passed back and forth
@@ -25,7 +28,7 @@ struct shmid64_ds {
        unsigned long           shm_ctime_high;
        unsigned long           shm_ctime;      /* last change time */
 #endif
-       size_t                  shm_segsz;      /* size of segment (bytes) */
+       __kernel_size_t         shm_segsz;      /* size of segment (bytes) */
        __kernel_pid_t          shm_cpid;       /* pid of creator */
        __kernel_pid_t          shm_lpid;       /* pid of last operator */
        unsigned long           shm_nattch;     /* no. of current attaches */
index fce18eaa070c1b39b2293a8acb747d41f79519c0..13775bfdfee209aa2590d90346de4629920cdca4 100644 (file)
@@ -5,6 +5,10 @@
 #if !defined(__x86_64__) || !defined(__ILP32__)
 #include <asm-generic/shmbuf.h>
 #else
+
+#include <asm/ipcbuf.h>
+#include <asm/posix_types.h>
+
 /*
  * The shmid64_ds structure for x86 architecture with x32 ABI.
  *
@@ -15,7 +19,7 @@
 
 struct shmid64_ds {
        struct ipc64_perm       shm_perm;       /* operation perms */
-       size_t                  shm_segsz;      /* size of segment (bytes) */
+       __kernel_size_t         shm_segsz;      /* size of segment (bytes) */
        __kernel_long_t         shm_atime;      /* last attach time */
        __kernel_long_t         shm_dtime;      /* last detach time */
        __kernel_long_t         shm_ctime;      /* last change time */
index 554a57a6a90f9b0daa366c4137bd2d9f474ebe85..bb8bdddae9b5093a9c71abf1d0648a8cfbc2193a 100644 (file)
 #ifndef _XTENSA_SHMBUF_H
 #define _XTENSA_SHMBUF_H
 
+#include <asm/ipcbuf.h>
+#include <asm/posix_types.h>
+
 struct shmid64_ds {
        struct ipc64_perm       shm_perm;       /* operation perms */
-       size_t                  shm_segsz;      /* size of segment (bytes) */
+       __kernel_size_t         shm_segsz;      /* size of segment (bytes) */
        unsigned long           shm_atime;      /* last attach time */
        unsigned long           shm_atime_high;
        unsigned long           shm_dtime;      /* last detach time */
index 2bab955e0fed6a3166e33b2bed49ed3415748497..2979b6dd2c56f800759f44ff1fa09c4d995e6845 100644 (file)
@@ -3,6 +3,8 @@
 #define __ASM_GENERIC_SHMBUF_H
 
 #include <asm/bitsperlong.h>
+#include <asm/ipcbuf.h>
+#include <asm/posix_types.h>
 
 /*
  * The shmid64_ds structure for x86 architecture.
@@ -24,7 +26,7 @@
 
 struct shmid64_ds {
        struct ipc64_perm       shm_perm;       /* operation perms */
-       size_t                  shm_segsz;      /* size of segment (bytes) */
+       __kernel_size_t         shm_segsz;      /* size of segment (bytes) */
 #if __BITS_PER_LONG == 64
        long                    shm_atime;      /* last attach time */
        long                    shm_dtime;      /* last detach time */
index 3150b86748e91bddfa69b1cae7085c92120ef1bb..1aa725a3cbbc12a814340e2ec78cb8b85dc8122c 100644 (file)
@@ -20,7 +20,6 @@ override c_flags = $(UAPI_CFLAGS) -Wp,-MMD,$(depfile) -I$(objtree)/usr/include
 # Please consider to fix the header first.
 #
 # Sorted alphabetically.
-no-header-test += asm/shmbuf.h
 no-header-test += asm/ucontext.h
 no-header-test += drm/vmwgfx_drm.h
 no-header-test += linux/am437x-vpfe.h