All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Jon Hunter <jon-hunter@ti.com>
Cc: linux-omap <linux-omap@vger.kernel.org>,
	linux-arm <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] ARM: OMAP2+: Prevent redefinition errors for soc.h
Date: Fri, 9 Nov 2012 08:22:59 -0800	[thread overview]
Message-ID: <20121109162259.GO6801@atomide.com> (raw)
In-Reply-To: <1352477961-7634-1-git-send-email-jon-hunter@ti.com>

* Jon Hunter <jon-hunter@ti.com> [121109 08:21]:
> If the header soc.h is included more than once in a source (for example
> once directly by the source file and once indirectly by another header
> file), then the compiler will generate redefintion errors for the macros
> in soc.h. Prevent this by only allowing the content in soc.h to be
> included once.
> 
> Signed-off-by: Jon Hunter <jon-hunter@ti.com>
> ---
> 
> Please note that I ran into this problem when rebasing my dmtimer fixes
> series [1] on Tony's Linux-OMAP master branch. I am including plat/cpu.h
> in dmtimer.h and I found several other files including dmtimer.h are also
> including soc.h and so generate a lot of errors.
> 
> [1] http://marc.info/?l=linux-omap&m=135231490218361&w=2

As these headers are private to mach-omap2, I'd rather not allow including
them more than once so we can eventually clean up the includes further.

We should include the headers directly where used, except for the
legacy board-*.c files that will be going away anyways.

Including the files directly should fix this easily, if not let me
know.

Regards,

Tony
 
>  arch/arm/mach-omap2/soc.h |    4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/arm/mach-omap2/soc.h b/arch/arm/mach-omap2/soc.h
> index 0700964..6b270a0 100644
> --- a/arch/arm/mach-omap2/soc.h
> +++ b/arch/arm/mach-omap2/soc.h
> @@ -25,6 +25,9 @@
>   *
>   */
>  
> +#ifndef __ARCH_ARM_MACH_OMAP2_SOC_H
> +#define __ARCH_ARM_MACH_OMAP2_SOC_H
> +
>  #include "omap24xx.h"
>  #include "omap34xx.h"
>  #include "omap44xx.h"
> @@ -471,3 +474,4 @@ OMAP4_HAS_FEATURE(mpu_1_5ghz, MPU_1_5GHZ)
>  
>  #endif	/* __ASSEMBLY__ */
>  
> +#endif	/* __ARCH_ARM_MACH_OMAP2_SOC_H */
> -- 
> 1.7.9.5
> 

WARNING: multiple messages have this Message-ID (diff)
From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: OMAP2+: Prevent redefinition errors for soc.h
Date: Fri, 9 Nov 2012 08:22:59 -0800	[thread overview]
Message-ID: <20121109162259.GO6801@atomide.com> (raw)
In-Reply-To: <1352477961-7634-1-git-send-email-jon-hunter@ti.com>

* Jon Hunter <jon-hunter@ti.com> [121109 08:21]:
> If the header soc.h is included more than once in a source (for example
> once directly by the source file and once indirectly by another header
> file), then the compiler will generate redefintion errors for the macros
> in soc.h. Prevent this by only allowing the content in soc.h to be
> included once.
> 
> Signed-off-by: Jon Hunter <jon-hunter@ti.com>
> ---
> 
> Please note that I ran into this problem when rebasing my dmtimer fixes
> series [1] on Tony's Linux-OMAP master branch. I am including plat/cpu.h
> in dmtimer.h and I found several other files including dmtimer.h are also
> including soc.h and so generate a lot of errors.
> 
> [1] http://marc.info/?l=linux-omap&m=135231490218361&w=2

As these headers are private to mach-omap2, I'd rather not allow including
them more than once so we can eventually clean up the includes further.

We should include the headers directly where used, except for the
legacy board-*.c files that will be going away anyways.

Including the files directly should fix this easily, if not let me
know.

Regards,

Tony
 
>  arch/arm/mach-omap2/soc.h |    4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/arm/mach-omap2/soc.h b/arch/arm/mach-omap2/soc.h
> index 0700964..6b270a0 100644
> --- a/arch/arm/mach-omap2/soc.h
> +++ b/arch/arm/mach-omap2/soc.h
> @@ -25,6 +25,9 @@
>   *
>   */
>  
> +#ifndef __ARCH_ARM_MACH_OMAP2_SOC_H
> +#define __ARCH_ARM_MACH_OMAP2_SOC_H
> +
>  #include "omap24xx.h"
>  #include "omap34xx.h"
>  #include "omap44xx.h"
> @@ -471,3 +474,4 @@ OMAP4_HAS_FEATURE(mpu_1_5ghz, MPU_1_5GHZ)
>  
>  #endif	/* __ASSEMBLY__ */
>  
> +#endif	/* __ARCH_ARM_MACH_OMAP2_SOC_H */
> -- 
> 1.7.9.5
> 

  reply	other threads:[~2012-11-09 16:23 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-09 16:19 [PATCH] ARM: OMAP2+: Prevent redefinition errors for soc.h Jon Hunter
2012-11-09 16:19 ` Jon Hunter
2012-11-09 16:22 ` Tony Lindgren [this message]
2012-11-09 16:22   ` Tony Lindgren
2012-11-09 16:29   ` Jon Hunter
2012-11-09 16:29     ` Jon Hunter
2012-11-09 21:10     ` Tony Lindgren
2012-11-09 21:10       ` Tony Lindgren
2012-11-09 23:42       ` Jon Hunter
2012-11-09 23:42         ` Jon Hunter
2012-11-09 23:50         ` Tony Lindgren
2012-11-09 23:50           ` Tony Lindgren
2012-11-09 23:57           ` Jon Hunter
2012-11-09 23:57             ` Jon Hunter
2012-11-10  0:21             ` Tony Lindgren
2012-11-10  0:21               ` Tony Lindgren
2012-11-10  2:52               ` Jon Hunter
2012-11-10  2:52                 ` Jon Hunter

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=20121109162259.GO6801@atomide.com \
    --to=tony@atomide.com \
    --cc=jon-hunter@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.