From: Chen Gang <gang.chen@asianux.com>
To: "vgupta@synopsys.com" <vgupta@synopsys.com>,
Arnd Bergmann <arnd@arndb.de>, Jonas Bonn <jonas@southpole.se>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"dhowells@redhat.com" <dhowells@redhat.com>
Subject: Re: [PATCH] arch: arc: uapi: be sure of "_UAPI" prefix for all guard macros
Date: Fri, 08 Nov 2013 10:39:07 +0800 [thread overview]
Message-ID: <527C4ECB.9050504@asianux.com> (raw)
In-Reply-To: <527C4E10.4070408@asianux.com>
On 11/08/2013 10:36 AM, Chen Gang wrote:
> For all uapi headers, need use "_UAPI" prefix for its guard macro
> (which will be stripped by "scripts/headers_installler.sh").
>
> And be sure of all "endif" append (or have correct) related comment.
>
> Also reserve guard macro in empty file, since some of "usr/include/*"
> header files may check guard macro to know whether content related
> header file.
>
Oh, sorry.
Need add additional comment for the normal header file which missing
guard macro.
And also need cc to David Howells which provide many valuable suggestions.
I will send patch v2 for it.
>
> Signed-off-by: Chen Gang <gang.chen@asianux.com>
> ---
> arch/arc/include/uapi/asm/byteorder.h | 6 +++---
> arch/arc/include/uapi/asm/cachectl.h | 6 +++---
> arch/arc/include/uapi/asm/elf.h | 2 +-
> arch/arc/include/uapi/asm/setup.h | 9 +++++++--
> arch/arc/include/uapi/asm/sigcontext.h | 6 +++---
> arch/arc/include/uapi/asm/signal.h | 6 +++---
> arch/arc/include/uapi/asm/swab.h | 6 +++---
> arch/arc/include/uapi/asm/unistd.h | 4 ++++
> 8 files changed, 27 insertions(+), 18 deletions(-)
>
> diff --git a/arch/arc/include/uapi/asm/byteorder.h b/arch/arc/include/uapi/asm/byteorder.h
> index 9da71d4..859fde2 100644
> --- a/arch/arc/include/uapi/asm/byteorder.h
> +++ b/arch/arc/include/uapi/asm/byteorder.h
> @@ -6,8 +6,8 @@
> * published by the Free Software Foundation.
> */
>
> -#ifndef __ASM_ARC_BYTEORDER_H
> -#define __ASM_ARC_BYTEORDER_H
> +#ifndef _UAPI__ASM_ARC_BYTEORDER_H
> +#define _UAPI__ASM_ARC_BYTEORDER_H
>
> #ifdef CONFIG_CPU_BIG_ENDIAN
> #include <linux/byteorder/big_endian.h>
> @@ -15,4 +15,4 @@
> #include <linux/byteorder/little_endian.h>
> #endif
>
> -#endif /* ASM_ARC_BYTEORDER_H */
> +#endif /* _UAPI__ASM_ARC_BYTEORDER_H */
> diff --git a/arch/arc/include/uapi/asm/cachectl.h b/arch/arc/include/uapi/asm/cachectl.h
> index 51c73f0..2437fc6 100644
> --- a/arch/arc/include/uapi/asm/cachectl.h
> +++ b/arch/arc/include/uapi/asm/cachectl.h
> @@ -6,8 +6,8 @@
> * published by the Free Software Foundation.
> */
>
> -#ifndef __ARC_ASM_CACHECTL_H
> -#define __ARC_ASM_CACHECTL_H
> +#ifndef _UAPI__ARC_ASM_CACHECTL_H
> +#define _UAPI__ARC_ASM_CACHECTL_H
>
> /*
> * ARC ABI flags defined for Android's finegrained cacheflush requirements
> @@ -25,4 +25,4 @@
> #define DCACHE CF_D_FLUSH
> #define BCACHE (CF_I_INV | CF_D_FLUSH)
>
> -#endif
> +#endif /* _UAPI__ARC_ASM_CACHECTL_H */
> diff --git a/arch/arc/include/uapi/asm/elf.h b/arch/arc/include/uapi/asm/elf.h
> index 0f99ac8..4e82dc6 100644
> --- a/arch/arc/include/uapi/asm/elf.h
> +++ b/arch/arc/include/uapi/asm/elf.h
> @@ -23,4 +23,4 @@ typedef unsigned long elf_fpregset_t;
>
> typedef elf_greg_t elf_gregset_t[ELF_NGREG];
>
> -#endif
> +#endif /* _UAPI__ASM_ARC_ELF_H */
> diff --git a/arch/arc/include/uapi/asm/setup.h b/arch/arc/include/uapi/asm/setup.h
> index a6d4e44..09a8df7 100644
> --- a/arch/arc/include/uapi/asm/setup.h
> +++ b/arch/arc/include/uapi/asm/setup.h
> @@ -1,6 +1,11 @@
> /*
> * setup.h is part of userspace header ABI so UAPI scripts have to generate it
> * even if there's nothing to export - causing empty <uapi/asm/setup.h>
> - * However to prevent "patch" from discarding it we add this placeholder
> - * comment
> + *
> + * And some user programs may check guard macro to know whether content related
> + * header file (e.g. some of "/usr/include/ *" header files check guard macro),
> + * so recommend to still reserve guard macro in empty file.
> */
> +#ifndef _UAPI__ASM_ARC_SETUP_H
> +#define _UAPI__ASM_ARC_SETUP_H
> +#endif /* _UAPI__ASM_ARC_SETUP_H */
> diff --git a/arch/arc/include/uapi/asm/sigcontext.h b/arch/arc/include/uapi/asm/sigcontext.h
> index 9678a11..b2063ff 100644
> --- a/arch/arc/include/uapi/asm/sigcontext.h
> +++ b/arch/arc/include/uapi/asm/sigcontext.h
> @@ -6,8 +6,8 @@
> * published by the Free Software Foundation.
> */
>
> -#ifndef _ASM_ARC_SIGCONTEXT_H
> -#define _ASM_ARC_SIGCONTEXT_H
> +#ifndef _UAPI_ASM_ARC_SIGCONTEXT_H
> +#define _UAPI_ASM_ARC_SIGCONTEXT_H
>
> #include <asm/ptrace.h>
>
> @@ -19,4 +19,4 @@ struct sigcontext {
> struct user_regs_struct regs;
> };
>
> -#endif /* _ASM_ARC_SIGCONTEXT_H */
> +#endif /* _UAPI_ASM_ARC_SIGCONTEXT_H */
> diff --git a/arch/arc/include/uapi/asm/signal.h b/arch/arc/include/uapi/asm/signal.h
> index fad62f7..f212d83 100644
> --- a/arch/arc/include/uapi/asm/signal.h
> +++ b/arch/arc/include/uapi/asm/signal.h
> @@ -8,8 +8,8 @@
> * Amit Bhor, Sameer Dhavale: Codito Technologies 2004
> */
>
> -#ifndef _ASM_ARC_SIGNAL_H
> -#define _ASM_ARC_SIGNAL_H
> +#ifndef _UAPI_ASM_ARC_SIGNAL_H
> +#define _UAPI_ASM_ARC_SIGNAL_H
>
> /*
> * This is much needed for ARC sigreturn optimization.
> @@ -24,4 +24,4 @@
>
> #include <asm-generic/signal.h>
>
> -#endif /* _ASM_ARC_SIGNAL_H */
> +#endif /* _UAPI_ASM_ARC_SIGNAL_H */
> diff --git a/arch/arc/include/uapi/asm/swab.h b/arch/arc/include/uapi/asm/swab.h
> index 095599a..7237a21 100644
> --- a/arch/arc/include/uapi/asm/swab.h
> +++ b/arch/arc/include/uapi/asm/swab.h
> @@ -13,8 +13,8 @@
> * -Hardware assisted single cycle bswap (Use Case of ARC custom instrn)
> */
>
> -#ifndef __ASM_ARC_SWAB_H
> -#define __ASM_ARC_SWAB_H
> +#ifndef _UAPI__ASM_ARC_SWAB_H
> +#define _UAPI__ASM_ARC_SWAB_H
>
> #include <linux/types.h>
>
> @@ -95,4 +95,4 @@
> #define __SWAB_64_THRU_32__
> #endif
>
> -#endif
> +#endif /* _UAPI__ASM_ARC_SWAB_H */
> diff --git a/arch/arc/include/uapi/asm/unistd.h b/arch/arc/include/uapi/asm/unistd.h
> index 6f30484..109f32c 100644
> --- a/arch/arc/include/uapi/asm/unistd.h
> +++ b/arch/arc/include/uapi/asm/unistd.h
> @@ -7,6 +7,8 @@
> */
>
> /******** no-legacy-syscalls-ABI *******/
> +#ifndef _UAPI_ASM_ARC_UNISTD_H
> +#define _UAPI_ASM_ARC_UNISTD_H
>
> #define __ARCH_WANT_SYS_EXECVE
> #define __ARCH_WANT_SYS_CLONE
> @@ -32,3 +34,5 @@ __SYSCALL(__NR_arc_gettls, sys_arc_gettls)
> /* Generic syscall (fs/filesystems.c - lost in asm-generic/unistd.h */
> #define __NR_sysfs (__NR_arch_specific_syscall + 3)
> __SYSCALL(__NR_sysfs, sys_sysfs)
> +
> +#endif /* _UAPI_ASM_ARC_UNISTD_H */
>
--
Chen Gang
next prev parent reply other threads:[~2013-11-08 2:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-08 2:36 [PATCH] arch: arc: uapi: be sure of "_UAPI" prefix for all guard macros Chen Gang
2013-11-08 2:39 ` Chen Gang [this message]
2013-11-08 2:48 ` [PATCH v2] " Chen Gang
2013-11-21 9:46 ` Vineet Gupta
2013-11-21 10:25 ` Chen Gang
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=527C4ECB.9050504@asianux.com \
--to=gang.chen@asianux.com \
--cc=arnd@arndb.de \
--cc=dhowells@redhat.com \
--cc=jonas@southpole.se \
--cc=linux-kernel@vger.kernel.org \
--cc=vgupta@synopsys.com \
/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