LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] Remove "#ifdef linux" from include/linux/a.out.h
@ 2015-03-10 13:03 Alexander Ivchenko
  2015-03-31 12:20 ` Alexander Ivchenko
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Ivchenko @ 2015-03-10 13:03 UTC (permalink / raw)
  To: linux-kernel

Hi,

I'm resending the patch from here:
http://lkml.iu.edu/hypermail/linux/kernel/1502.3/00286.html

GCC fixincludes always change that header to comply with C standard.
Here is the comment from fixincludes code:
/* Fix for machine name #ifdefs that are not in the namespace reserved
   by the C standard.  They won't be defined if compiling with -ansi,
   and the headers will break.  We go to some trouble to only change
   #ifdefs where the macro is defined by GCC in non-ansi mode; this
   minimizes the number of headers touched.  */

So gcc build system will change "#ifdef linux" to "#ifdef __linux__".

After talking to Andi Kleen, I was proposed to remove that ifdef completely
(instead of changing linux to __linux__ in the header), since it does
not make much sense to include linux/a.out.h on a non linux system.

The following patch does that, is it ok?

From: Alexander Ivchenko <alexander.ivchenko@intel.com>
Date: Tue, 24 Feb 2015 11:28:20 +0300
Subject: [PATCH] Remove "ifdef linux" guard from include/linux/a.out.h.

Signed-off-by: Alexander Ivchenko <alexander.ivchenko@intel.com>
---
 include/linux/a.out.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/include/linux/a.out.h b/include/linux/a.out.h
index e86dfca..47e647f 100644
--- a/include/linux/a.out.h
+++ b/include/linux/a.out.h
@@ -129,7 +129,6 @@ enum machine_type {
 #define SEGMENT_SIZE PAGE_SIZE
 #endif

-#ifdef linux
 #ifdef __KERNEL__
 #include <asm/page.h>
 #else
@@ -146,7 +145,6 @@ enum machine_type {
 #endif
 #endif
 #endif
-#endif

 #define _N_SEGMENT_ROUND(x) ALIGN(x, SEGMENT_SIZE)

--
1.9.3



thanks,
Alexander

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

* Re: [PATCH] Remove "#ifdef linux" from include/linux/a.out.h
  2015-03-10 13:03 [PATCH] Remove "#ifdef linux" from include/linux/a.out.h Alexander Ivchenko
@ 2015-03-31 12:20 ` Alexander Ivchenko
  0 siblings, 0 replies; 2+ messages in thread
From: Alexander Ivchenko @ 2015-03-31 12:20 UTC (permalink / raw)
  To: linux-kernel

Hi,

Could somebody please take a look at the patch?

thanks,
Alexander

2015-03-10 16:03 GMT+03:00 Alexander Ivchenko <aivchenk@gmail.com>:
> Hi,
>
> I'm resending the patch from here:
> http://lkml.iu.edu/hypermail/linux/kernel/1502.3/00286.html
>
> GCC fixincludes always change that header to comply with C standard.
> Here is the comment from fixincludes code:
> /* Fix for machine name #ifdefs that are not in the namespace reserved
>    by the C standard.  They won't be defined if compiling with -ansi,
>    and the headers will break.  We go to some trouble to only change
>    #ifdefs where the macro is defined by GCC in non-ansi mode; this
>    minimizes the number of headers touched.  */
>
> So gcc build system will change "#ifdef linux" to "#ifdef __linux__".
>
> After talking to Andi Kleen, I was proposed to remove that ifdef completely
> (instead of changing linux to __linux__ in the header), since it does
> not make much sense to include linux/a.out.h on a non linux system.
>
> The following patch does that, is it ok?
>
> From: Alexander Ivchenko <alexander.ivchenko@intel.com>
> Date: Tue, 24 Feb 2015 11:28:20 +0300
> Subject: [PATCH] Remove "ifdef linux" guard from include/linux/a.out.h.
>
> Signed-off-by: Alexander Ivchenko <alexander.ivchenko@intel.com>
> ---
>  include/linux/a.out.h | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/include/linux/a.out.h b/include/linux/a.out.h
> index e86dfca..47e647f 100644
> --- a/include/linux/a.out.h
> +++ b/include/linux/a.out.h
> @@ -129,7 +129,6 @@ enum machine_type {
>  #define SEGMENT_SIZE PAGE_SIZE
>  #endif
>
> -#ifdef linux
>  #ifdef __KERNEL__
>  #include <asm/page.h>
>  #else
> @@ -146,7 +145,6 @@ enum machine_type {
>  #endif
>  #endif
>  #endif
> -#endif
>
>  #define _N_SEGMENT_ROUND(x) ALIGN(x, SEGMENT_SIZE)
>
> --
> 1.9.3
>
>
>
> thanks,
> Alexander

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

end of thread, other threads:[~2015-03-31 12:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-10 13:03 [PATCH] Remove "#ifdef linux" from include/linux/a.out.h Alexander Ivchenko
2015-03-31 12:20 ` Alexander Ivchenko

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