arch: avr32: uapi: be sure of "_UAPI" prefix for all guard macros
PATCH 1/1 arch: avr32: uapi: be sure of "_UAPI" prefix for all guard macros
For all uapi headers, need use "_UAPI" prefix for its guard macro (which will be stripped by "scripts/headers_installer.sh").
Also remove redundant files (bitsperlong.h, errno.h, fcntl.h, ioctl.h, ioctls.h, ipcbuf.h, kvm_para.h, mman.h, poll.h, resource.h, siginfo.h, statfs.h, and unistd.h) which are already in Kbuild.
Also be sure that all "#endif" only have one empty line above, and each file has guard macro.
--- arch/avr32/include/uapi/asm/auxvec.h | 6 +++--- arch/avr32/include/uapi/asm/bitsperlong.h | 1 - arch/avr32/include/uapi/asm/byteorder.h | 6 +++--- arch/avr32/include/uapi/asm/cachectl.h | 6 +++--- arch/avr32/include/uapi/asm/errno.h | 6 ------ arch/avr32/include/uapi/asm/fcntl.h | 6 ------ arch/avr32/include/uapi/asm/ioctl.h | 6 ------ arch/avr32/include/uapi/asm/ioctls.h | 6 ------ arch/avr32/include/uapi/asm/ipcbuf.h | 1 - arch/avr32/include/uapi/asm/kvm_para.h | 1 - arch/avr32/include/uapi/asm/mman.h | 1 - arch/avr32/include/uapi/asm/msgbuf.h | 6 +++--- arch/avr32/include/uapi/asm/poll.h | 1 - arch/avr32/include/uapi/asm/posix_types.h | 6 +++--- arch/avr32/include/uapi/asm/resource.h | 6 ------ arch/avr32/include/uapi/asm/sembuf.h | 6 +++--- arch/avr32/include/uapi/asm/setup.h | 1 - arch/avr32/include/uapi/asm/shmbuf.h | 6 +++--- arch/avr32/include/uapi/asm/sigcontext.h | 6 +++--- arch/avr32/include/uapi/asm/siginfo.h | 6 ------ arch/avr32/include/uapi/asm/signal.h | 1 - arch/avr32/include/uapi/asm/socket.h | 6 +++--- arch/avr32/include/uapi/asm/sockios.h | 6 +++--- arch/avr32/include/uapi/asm/stat.h | 6 +++--- arch/avr32/include/uapi/asm/statfs.h | 6 ------ arch/avr32/include/uapi/asm/swab.h | 6 +++--- arch/avr32/include/uapi/asm/termbits.h | 6 +++--- arch/avr32/include/uapi/asm/termios.h | 1 - arch/avr32/include/uapi/asm/types.h | 5 +++++ arch/avr32/include/uapi/asm/unistd.h | 1 - 30 files changed, 44 insertions(+), 90 deletions(-) delete mode 100644 arch/avr32/include/uapi/asm/bitsperlong.h delete mode 100644 arch/avr32/include/uapi/asm/errno.h delete mode 100644 arch/avr32/include/uapi/asm/fcntl.h delete mode 100644 arch/avr32/include/uapi/asm/ioctl.h delete mode 100644 arch/avr32/include/uapi/asm/ioctls.h delete mode 100644 arch/avr32/include/uapi/asm/ipcbuf.h delete mode 100644 arch/avr32/include/uapi/asm/kvm_para.h delete mode 100644 arch/avr32/include/uapi/asm/mman.h delete mode 100644 arch/avr32/include/uapi/asm/poll.h delete mode 100644 arch/avr32/include/uapi/asm/resource.h delete mode 100644 arch/avr32/include/uapi/asm/siginfo.h delete mode 100644 arch/avr32/include/uapi/asm/statfs.h
arch/avr32/include/uapi/asm/auxvec.h +3 -3
@@ -1,4 +1,4 @@ -#ifndef __ASM_AVR32_AUXVEC_H -#define __ASM_AVR32_AUXVEC_H +#ifndef _UAPI__ASM_AVR32_AUXVEC_H +#define _UAPI__ASM_AVR32_AUXVEC_H -#endif /* __ASM_AVR32_AUXVEC_H */ +#endif /* _UAPI__ASM_AVR32_AUXVEC_H */
arch/avr32/include/uapi/asm/bitsperlong.h deleted +0 -1
@@ -1 +0,0 @@ -#include <asm-generic/bitsperlong.h>
arch/avr32/include/uapi/asm/byteorder.h +3 -3
@@ -1,9 +1,9 @@/* * AVR32 endian-conversion functions. */ -#ifndef __ASM_AVR32_BYTEORDER_H -#define __ASM_AVR32_BYTEORDER_H +#ifndef _UAPI__ASM_AVR32_BYTEORDER_H +#define _UAPI__ASM_AVR32_BYTEORDER_H#include <linux/byteorder/big_endian.h> -#endif /* __ASM_AVR32_BYTEORDER_H */ +#endif /* _UAPI__ASM_AVR32_BYTEORDER_H */
arch/avr32/include/uapi/asm/cachectl.h +3 -3
@@ -1,5 +1,5 @@ -#ifndef __ASM_AVR32_CACHECTL_H -#define __ASM_AVR32_CACHECTL_H +#ifndef _UAPI__ASM_AVR32_CACHECTL_H +#define _UAPI__ASM_AVR32_CACHECTL_H/* * Operations that can be performed through the cacheflush system call
@@ -8,4 +8,4 @@/* Clean the data cache, then invalidate the icache */ #define CACHE_IFLUSH 0 -#endif /* __ASM_AVR32_CACHECTL_H */ +#endif /* _UAPI__ASM_AVR32_CACHECTL_H */
arch/avr32/include/uapi/asm/errno.h deleted +0 -6
@@ -1,6 +0,0 @@ -#ifndef __ASM_AVR32_ERRNO_H -#define __ASM_AVR32_ERRNO_H - -#include <asm-generic/errno.h> - -#endif /* __ASM_AVR32_ERRNO_H */
arch/avr32/include/uapi/asm/fcntl.h deleted +0 -6
@@ -1,6 +0,0 @@ -#ifndef __ASM_AVR32_FCNTL_H -#define __ASM_AVR32_FCNTL_H - -#include <asm-generic/fcntl.h> - -#endif /* __ASM_AVR32_FCNTL_H */
arch/avr32/include/uapi/asm/ioctl.h deleted +0 -6
@@ -1,6 +0,0 @@ -#ifndef __ASM_AVR32_IOCTL_H -#define __ASM_AVR32_IOCTL_H - -#include <asm-generic/ioctl.h> - -#endif /* __ASM_AVR32_IOCTL_H */
arch/avr32/include/uapi/asm/ioctls.h deleted +0 -6
@@ -1,6 +0,0 @@ -#ifndef __ASM_AVR32_IOCTLS_H -#define __ASM_AVR32_IOCTLS_H - -#include <asm-generic/ioctls.h> - -#endif /* __ASM_AVR32_IOCTLS_H */
arch/avr32/include/uapi/asm/ipcbuf.h deleted +0 -1
@@ -1 +0,0 @@ -#include <asm-generic/ipcbuf.h>
arch/avr32/include/uapi/asm/kvm_para.h deleted +0 -1
@@ -1 +0,0 @@ -#include <asm-generic/kvm_para.h>
arch/avr32/include/uapi/asm/mman.h deleted +0 -1
@@ -1 +0,0 @@ -#include <asm-generic/mman.h>
arch/avr32/include/uapi/asm/msgbuf.h +3 -3
@@ -1,5 +1,5 @@ -#ifndef __ASM_AVR32_MSGBUF_H -#define __ASM_AVR32_MSGBUF_H +#ifndef _UAPI__ASM_AVR32_MSGBUF_H +#define _UAPI__ASM_AVR32_MSGBUF_H/* * The msqid64_ds structure for i386 architecture.
@@ -28,4 +28,4 @@ struct msqid64_ds { unsigned long __unused5; }; -#endif /* __ASM_AVR32_MSGBUF_H */ +#endif /* _UAPI__ASM_AVR32_MSGBUF_H */
arch/avr32/include/uapi/asm/poll.h deleted +0 -1
@@ -1 +0,0 @@ -#include <asm-generic/poll.h>
arch/avr32/include/uapi/asm/posix_types.h +3 -3
@@ -5,8 +5,8 @@* it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ -#ifndef __ASM_AVR32_POSIX_TYPES_H -#define __ASM_AVR32_POSIX_TYPES_H +#ifndef _UAPI__ASM_AVR32_POSIX_TYPES_H +#define _UAPI__ASM_AVR32_POSIX_TYPES_H/* * This file is generally used by user-level software, so you need to
@@ -34,4 +34,4 @@ typedef unsigned short __kernel_old_dev_t;#include <asm-generic/posix_types.h> -#endif /* __ASM_AVR32_POSIX_TYPES_H */ +#endif /* _UAPI__ASM_AVR32_POSIX_TYPES_H */
arch/avr32/include/uapi/asm/resource.h deleted +0 -6
@@ -1,6 +0,0 @@ -#ifndef __ASM_AVR32_RESOURCE_H -#define __ASM_AVR32_RESOURCE_H - -#include <asm-generic/resource.h> - -#endif /* __ASM_AVR32_RESOURCE_H */
arch/avr32/include/uapi/asm/sembuf.h +3 -3
@@ -1,5 +1,5 @@ -#ifndef __ASM_AVR32_SEMBUF_H -#define __ASM_AVR32_SEMBUF_H +#ifndef _UAPI__ASM_AVR32_SEMBUF_H +#define _UAPI__ASM_AVR32_SEMBUF_H/* * The semid64_ds structure for AVR32 architecture.
@@ -22,4 +22,4 @@ struct semid64_ds { unsigned long __unused4; }; -#endif /* __ASM_AVR32_SEMBUF_H */ +#endif /* _UAPI__ASM_AVR32_SEMBUF_H */
arch/avr32/include/uapi/asm/setup.h +0 -1
@@ -13,5 +13,4 @@#define COMMAND_LINE_SIZE 256 -#endif /* _UAPI__ASM_AVR32_SETUP_H__ */
arch/avr32/include/uapi/asm/shmbuf.h +3 -3
@@ -1,5 +1,5 @@ -#ifndef __ASM_AVR32_SHMBUF_H -#define __ASM_AVR32_SHMBUF_H +#ifndef _UAPI__ASM_AVR32_SHMBUF_H +#define _UAPI__ASM_AVR32_SHMBUF_H/* * The shmid64_ds structure for i386 architecture.
@@ -39,4 +39,4 @@ struct shminfo64 { unsigned long __unused4; }; -#endif /* __ASM_AVR32_SHMBUF_H */ +#endif /* _UAPI__ASM_AVR32_SHMBUF_H */
arch/avr32/include/uapi/asm/sigcontext.h +3 -3
@@ -5,8 +5,8 @@* it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ -#ifndef __ASM_AVR32_SIGCONTEXT_H -#define __ASM_AVR32_SIGCONTEXT_H +#ifndef _UAPI__ASM_AVR32_SIGCONTEXT_H +#define _UAPI__ASM_AVR32_SIGCONTEXT_H struct sigcontext { unsigned long oldmask;
@@ -31,4 +31,4 @@ struct sigcontext { unsigned long r0; }; -#endif /* __ASM_AVR32_SIGCONTEXT_H */ +#endif /* _UAPI__ASM_AVR32_SIGCONTEXT_H */
arch/avr32/include/uapi/asm/siginfo.h deleted +0 -6
@@ -1,6 +0,0 @@ -#ifndef _AVR32_SIGINFO_H -#define _AVR32_SIGINFO_H - -#include <asm-generic/siginfo.h> - -#endif
arch/avr32/include/uapi/asm/signal.h +0 -1
@@ -118,5 +118,4 @@ typedef struct sigaltstack { size_t ss_size; } stack_t; -#endif /* _UAPI__ASM_AVR32_SIGNAL_H */
arch/avr32/include/uapi/asm/socket.h +3 -3
@@ -1,5 +1,5 @@ -#ifndef __ASM_AVR32_SOCKET_H -#define __ASM_AVR32_SOCKET_H +#ifndef _UAPI__ASM_AVR32_SOCKET_H +#define _UAPI__ASM_AVR32_SOCKET_H#include <asm/sockios.h>
@@ -78,4 +78,4 @@#define SO_MAX_PACING_RATE 47 -#endif /* __ASM_AVR32_SOCKET_H */ +#endif /* _UAPI__ASM_AVR32_SOCKET_H */
arch/avr32/include/uapi/asm/sockios.h +3 -3
@@ -1,5 +1,5 @@ -#ifndef __ASM_AVR32_SOCKIOS_H -#define __ASM_AVR32_SOCKIOS_H +#ifndef _UAPI__ASM_AVR32_SOCKIOS_H +#define _UAPI__ASM_AVR32_SOCKIOS_H/* Socket-level I/O control calls. */ #define FIOSETOWN 0x8901
@@ -10,4 +10,4 @@#define SIOCGSTAMP 0x8906/* Get stamp (timeval) */ #define SIOCGSTAMPNS 0x8907/* Get stamp (timespec) */ -#endif /* __ASM_AVR32_SOCKIOS_H */ +#endif /* _UAPI__ASM_AVR32_SOCKIOS_H */
arch/avr32/include/uapi/asm/stat.h +3 -3
@@ -5,8 +5,8 @@* it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ -#ifndef __ASM_AVR32_STAT_H -#define __ASM_AVR32_STAT_H +#ifndef _UAPI__ASM_AVR32_STAT_H +#define _UAPI__ASM_AVR32_STAT_H struct __old_kernel_stat { unsigned short st_dev;
@@ -76,4 +76,4 @@ struct stat64 { unsigned long __unused2; }; -#endif /* __ASM_AVR32_STAT_H */ +#endif /* _UAPI__ASM_AVR32_STAT_H */
arch/avr32/include/uapi/asm/statfs.h deleted +0 -6
@@ -1,6 +0,0 @@ -#ifndef __ASM_AVR32_STATFS_H -#define __ASM_AVR32_STATFS_H - -#include <asm-generic/statfs.h> - -#endif /* __ASM_AVR32_STATFS_H */
arch/avr32/include/uapi/asm/swab.h +3 -3
@@ -1,8 +1,8 @@/* * AVR32 byteswapping functions. */ -#ifndef __ASM_AVR32_SWAB_H -#define __ASM_AVR32_SWAB_H +#ifndef _UAPI__ASM_AVR32_SWAB_H +#define _UAPI__ASM_AVR32_SWAB_H#include <linux/types.h> #include <linux/compiler.h>
@@ -32,4 +32,4 @@ static inline __attribute_const__ __u32 __arch_swab32(__u32 val)#define __arch_swab32 __arch_swab32#endif -#endif /* __ASM_AVR32_SWAB_H */ +#endif /* _UAPI__ASM_AVR32_SWAB_H */
arch/avr32/include/uapi/asm/termbits.h +3 -3
@@ -1,5 +1,5 @@ -#ifndef __ASM_AVR32_TERMBITS_H -#define __ASM_AVR32_TERMBITS_H +#ifndef _UAPI__ASM_AVR32_TERMBITS_H +#define _UAPI__ASM_AVR32_TERMBITS_H#include <linux/posix_types.h>
@@ -193,4 +193,4 @@ struct ktermios {#define TCSADRAIN 1#define TCSAFLUSH 2 -#endif /* __ASM_AVR32_TERMBITS_H */ +#endif /* _UAPI__ASM_AVR32_TERMBITS_H */
arch/avr32/include/uapi/asm/termios.h +0 -1
@@ -46,5 +46,4 @@ struct termio {/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ -#endif /* _UAPI__ASM_AVR32_TERMIOS_H */
arch/avr32/include/uapi/asm/types.h +5 -0
@@ -5,4 +5,9 @@* it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ +#ifndef _UAPI__ASM_AVR32_TYPES_H +#define _UAPI__ASM_AVR32_TYPES_H +#include <asm-generic/int-ll64.h> + +#endif /* _UAPI__ASM_AVR32_TYPES_H */
arch/avr32/include/uapi/asm/unistd.h +0 -1
@@ -301,5 +301,4 @@#define __NR_eventfd 281#define __NR_setns 283 -#endif /* _UAPI__ASM_AVR32_UNISTD_H */
Signature · 1 line
1.7.7.6
Quoted 9 lines · Chen Gang
For all uapi headers, need use "
_UAPI" prefix for its guard macro (which will be stripped by "scripts/headers_installer.sh").Also remove redundant files (
bitsperlong.h,errno.h,fcntl.h,ioctl.h,ioctls.h,ipcbuf.h,kvm_para.h,mman.h,poll.h,resource.h,siginfo.h,statfs.h, andunistd.h) which are already inKbuild.Also be sure that all "#endif" only have one empty line above, and each file has guard macro.
Thank you for fixing and cleaning, but this current patch does not build after applying. The deleted files needs to be added in Kbuild to pick the generic header files instead.
Something ala
arch/avr32/include/uapi/asm/Kbuild +12 -12
@@ -2,35 +2,35 @@ include include/uapi/asm-generic/Kbuild.asm header-y += auxvec.h -header-y += bitsperlong.h header-y += byteorder.h header-y += cachectl.h -header-y += errno.h -header-y += fcntl.h -header-y += ioctl.h -header-y += ioctls.h -header-y += ipcbuf.h -header-y += kvm_para.h -header-y += mman.h header-y += msgbuf.h header-y += param.h -header-y += poll.h header-y += posix_types.h header-y += ptrace.h -header-y += resource.h header-y += sembuf.h header-y += setup.h header-y += shmbuf.h header-y += sigcontext.h -header-y += siginfo.h header-y += signal.h header-y += socket.h header-y += sockios.h header-y += stat.h -header-y += statfs.h header-y += swab.h header-y += termbits.h header-y += termios.h header-y += types.h header-y += unistd.h +generic-y += bitsperlong.h +generic-y += errno.h +generic-y += fcntl.h +generic-y += ioctl.h +generic-y += ioctls.h +generic-y += ipcbuf.h +generic-y += kvm_para.h +generic-y += mman.h generic-y += param.h +generic-y += poll.h +generic-y += resource.h +generic-y += siginfo.h +generic-y += statfs.h
I can amend this change, and add the patch to my for-linus branch.
Quoted 1 line
Signed-off-by Chen Gang <[email protected]>
Quoted 36 lines
--- arch/avr32/include/uapi/asm/auxvec.h | 6 +++--- arch/avr32/include/uapi/asm/bitsperlong.h | 1 - arch/avr32/include/uapi/asm/byteorder.h | 6 +++--- arch/avr32/include/uapi/asm/cachectl.h | 6 +++--- arch/avr32/include/uapi/asm/errno.h | 6 ------ arch/avr32/include/uapi/asm/fcntl.h | 6 ------ arch/avr32/include/uapi/asm/ioctl.h | 6 ------ arch/avr32/include/uapi/asm/ioctls.h | 6 ------ arch/avr32/include/uapi/asm/ipcbuf.h | 1 - arch/avr32/include/uapi/asm/kvm_para.h | 1 - arch/avr32/include/uapi/asm/mman.h | 1 - arch/avr32/include/uapi/asm/msgbuf.h | 6 +++--- arch/avr32/include/uapi/asm/poll.h | 1 - arch/avr32/include/uapi/asm/posix_types.h | 6 +++--- arch/avr32/include/uapi/asm/resource.h | 6 ------ arch/avr32/include/uapi/asm/sembuf.h | 6 +++--- arch/avr32/include/uapi/asm/setup.h | 1 - arch/avr32/include/uapi/asm/shmbuf.h | 6 +++--- arch/avr32/include/uapi/asm/sigcontext.h | 6 +++--- arch/avr32/include/uapi/asm/siginfo.h | 6 ------ arch/avr32/include/uapi/asm/signal.h | 1 - arch/avr32/include/uapi/asm/socket.h | 6 +++--- arch/avr32/include/uapi/asm/sockios.h | 6 +++--- arch/avr32/include/uapi/asm/stat.h | 6 +++--- arch/avr32/include/uapi/asm/statfs.h | 6 ------ arch/avr32/include/uapi/asm/swab.h | 6 +++--- arch/avr32/include/uapi/asm/termbits.h | 6 +++--- arch/avr32/include/uapi/asm/termios.h | 1 - arch/avr32/include/uapi/asm/types.h | 5 +++++ arch/avr32/include/uapi/asm/unistd.h | 1 - 30 files changed, 44 insertions(+), 90 deletions(-) delete mode 100644 arch/avr32/include/uapi/asm/bitsperlong.h delete mode 100644 arch/avr32/include/uapi/asm/errno.h delete mode 100644 arch/avr32/include/uapi/asm/fcntl.h delete mode 100644 arch/avr32/include/uapi/asm/ioctl.h
Quoted 8 lines
delete mode 100644 arch/avr32/include/uapi/asm/ioctls.h delete mode 100644 arch/avr32/include/uapi/asm/ipcbuf.h delete mode 100644 arch/avr32/include/uapi/asm/kvm_para.h delete mode 100644 arch/avr32/include/uapi/asm/mman.h delete mode 100644 arch/avr32/include/uapi/asm/poll.h delete mode 100644 arch/avr32/include/uapi/asm/resource.h delete mode 100644 arch/avr32/include/uapi/asm/siginfo.h delete mode 100644 arch/avr32/include/uapi/asm/statfs.h
<snipp diff>
Signature · 1 line
HcE
Quoted 8 lines · Hans-Christian Egtvedt
Quoted 7 lines · Chen Gang
For all uapi headers, need use "
_UAPI" prefix for its guard macro (which will be stripped by "scripts/headers_installer.sh").Also remove redundant files (
bitsperlong.h,errno.h,fcntl.h,ioctl.h,ioctls.h,ipcbuf.h,kvm_para.h,mman.h,poll.h,resource.h,siginfo.h,statfs.h, andunistd.h) which are already inKbuild.
Quoted 7 lines
Quoted 2 lines
Also be sure that all "#endif" only have one empty line above, and each file has guard macro.
Thank you for fixing and cleaning, but this current patch does not build after applying. The deleted files needs to be added in
Kbuildto pick the generic header files instead.
Oh, it is my fault, thanks. :-)
Quoted 44 lines
Something ala
arch/avr32/include/uapi/asm/Kbuild +3
-12@@ -2,35 +2,35 @@ include include/uapi/asm-generic/Kbuild.asm header-y += auxvec.h -header-y += bitsperlong.h header-y += byteorder.h header-y += cachectl.h -header-y += errno.h -header-y += fcntl.h -header-y += ioctl.h -header-y += ioctls.h -header-y += ipcbuf.h -header-y += kvm_para.h -header-y += mman.h header-y += msgbuf.h header-y += param.h -header-y += poll.h header-y += posix_types.h header-y += ptrace.h -header-y += resource.h header-y += sembuf.h header-y += setup.h header-y += shmbuf.h header-y += sigcontext.h -header-y += siginfo.h header-y += signal.h header-y += socket.h header-y += sockios.h header-y += stat.h -header-y += statfs.h header-y += swab.h header-y += termbits.h header-y += termios.h header-y += types.h header-y += unistd.h +generic-y += bitsperlong.h +generic-y += errno.h +generic-y += fcntl.h
arch/avr32/include/uapi/asm/Kbuild line 36
Quoted 10 lines
arch/avr32/include/uapi/asm/Kbuild +9
-0+generic-y += ioctl.h +generic-y += ioctls.h +generic-y += ipcbuf.h +generic-y += kvm_para.h +generic-y += mman.h generic-y += param.h +generic-y += poll.h +generic-y += resource.h +generic-y += siginfo.h +generic-y += statfs.h
And I should check my original another architectures' 'same' patches for 'header-y' and 'generic-y'.
Quoted 6 lines
I can amend this change, and add the patch to my for-linus branch.
Quoted 1 line
Signed-off-by Chen Gang <[email protected]>Signed-off-by Hans-Christian Egtvedt <[email protected]>
Thank you very much.
Quoted 3 lines
<snipp diff>
Thanks.
Signature · 1 line
Chen Gang