linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] linux/coff.h: add include guard
@ 2019-07-28 15:47 Masahiro Yamada
  2019-07-30 19:52 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Masahiro Yamada @ 2019-07-28 15:47 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Arnd Bergmann, Masahiro Yamada, linux-kernel

Add a header include guard just in case.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

Looks like this file is unused at least in the kernel tree,
but I am not it is OK to delete it.

I am just adding the include guard for the header compile-testing.



 include/uapi/linux/coff.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/uapi/linux/coff.h b/include/uapi/linux/coff.h
index e4a79f80b9a0..ab5c7e847eed 100644
--- a/include/uapi/linux/coff.h
+++ b/include/uapi/linux/coff.h
@@ -11,6 +11,9 @@
    more information about COFF, then O'Reilly has a very excellent book.
 */
 
+#ifndef _UAPI_LINUX_COFF_H
+#define _UAPI_LINUX_COFF_H
+
 #define  E_SYMNMLEN  8   /* Number of characters in a symbol name         */
 #define  E_FILNMLEN 14   /* Number of characters in a file name           */
 #define  E_DIMNUM    4   /* Number of array dimensions in auxiliary entry */
@@ -350,3 +353,5 @@ struct COFF_reloc {
 
 /* For new sections we haven't heard of before */
 #define COFF_DEF_SECTION_ALIGNMENT       4
+
+#endif /* _UAPI_LINUX_COFF_H */
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] linux/coff.h: add include guard
  2019-07-28 15:47 [PATCH] linux/coff.h: add include guard Masahiro Yamada
@ 2019-07-30 19:52 ` Andrew Morton
  2019-07-31  9:23   ` Masahiro Yamada
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2019-07-30 19:52 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: Arnd Bergmann, linux-kernel

On Mon, 29 Jul 2019 00:47:28 +0900 Masahiro Yamada <yamada.masahiro@socionext.com> wrote:

> Add a header include guard just in case.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
> 
> Looks like this file is unused at least in the kernel tree,
> but I am not it is OK to delete it.

arch/alpha/boot/tools/objstrip.c includes it but I don't think it's
actually needed.  Yes, it would be nice to kill coff.h.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] linux/coff.h: add include guard
  2019-07-30 19:52 ` Andrew Morton
@ 2019-07-31  9:23   ` Masahiro Yamada
  0 siblings, 0 replies; 3+ messages in thread
From: Masahiro Yamada @ 2019-07-31  9:23 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Arnd Bergmann, Linux Kernel Mailing List

Hi Andrew,

On Wed, Jul 31, 2019 at 4:52 AM Andrew Morton <akpm@linux-foundation.org> wrote:
>
> On Mon, 29 Jul 2019 00:47:28 +0900 Masahiro Yamada <yamada.masahiro@socionext.com> wrote:
>
> > Add a header include guard just in case.
> >
> > Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> > ---
> >
> > Looks like this file is unused at least in the kernel tree,
> > but I am not it is OK to delete it.
>
> arch/alpha/boot/tools/objstrip.c includes it but I don't think it's
> actually needed.  Yes, it would be nice to kill coff.h.

After some consideration, I think it is better to keep it
until we dump the alpha support entirely.

The following line in arch/alpha/boot/tools/objstrip.c
references a macro in <linux/coff.h>:

        if (!(aout->fh.f_flags & COFF_F_EXEC)) {


I was not able to build objstrip.c anyway,
but I think it is better to keep the can of worms closed for now.


Could you apply this as-is please?


My motivation is to allow Kbuild to detect missing include guard:

https://patchwork.kernel.org/patch/11063011/


Before I enable this checker,
I want to fix as many headers as possible.



-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-07-31  9:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-28 15:47 [PATCH] linux/coff.h: add include guard Masahiro Yamada
2019-07-30 19:52 ` Andrew Morton
2019-07-31  9:23   ` Masahiro Yamada

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).