U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "J. Neuschäfer" <j.ne@posteo.net>
To: Sinan Akman <sinan@writeme.com>
Cc: j.ne@posteo.net, Mario Six <mario.six@gdsys.cc>,
	Tom Rini <trini@konsulko.com>,
	u-boot@lists.denx.de
Subject: Re: [PATCH 2/4] powerpc: mpc83xx: Allow including initreg.h into multiple files
Date: Thu, 19 Dec 2024 12:55:52 +0000	[thread overview]
Message-ID: <Z2QX2B911TzstWge@probook> (raw)
In-Reply-To: <8941d7ad-84d8-480b-be64-fcc0a3e48dd0@writeme.com>

On Wed, Dec 18, 2024 at 02:18:48PM -0500, Sinan Akman wrote:
> Hi
> 
> On 2024-12-15 10:18, J. Neuschäfer via B4 Relay wrote:
> > From: "J. Neuschäfer"<j.ne@posteo.net>
> > 
> > Globals defined in headers can result in multiple-definition errors
> > while linking, if they are visible beyond the current translation unit.
> 
> Is this happening anywhere ? It seems you introduced this in your other
> patch :
> [PATCH 3/4] powerpc: mpc83xx: Use defined constant for SPCR[TBEN]

Right, I should have mentioned it: The problem appears only due to the
next patch.

> If this is the only place you are seeing the problem, can we not protect
> that the file is not included multiple times ?

The problem here is the inclusion of initreg.h into multiple .c files,
rather than multiple times into the same .c file. I don't think there's
an easy guard pattern against that (the proprocessor won't help here).

I think the benefit of being able to use these constants is big enough
to justify this change.


Thanks for your review,
 -- jn



> 
> > 
> > Signed-off-by: J. Neuschäfer<j.ne@posteo.net>
> > ---
> >   arch/powerpc/cpu/mpc83xx/initreg/initreg.h | 8 ++++----
> >   1 file changed, 4 insertions(+), 4 deletions(-)
> > 
> > diff --git a/arch/powerpc/cpu/mpc83xx/initreg/initreg.h b/arch/powerpc/cpu/mpc83xx/initreg/initreg.h
> > index 63aa5c946696ee0368bb3453b40ff0110f0fbcfd..ea1176e7fe10dbb549125ab6b2706fee05a92734 100644
> > --- a/arch/powerpc/cpu/mpc83xx/initreg/initreg.h
> > +++ b/arch/powerpc/cpu/mpc83xx/initreg/initreg.h
> > @@ -13,7 +13,7 @@
> >   #define SPCR_TSECBDP_MASK	0x00000C00
> >   #define SPCR_TSECEP_MASK	0x00000300
> > 
> > -	const __be32 spcr_mask =
> > +	static const __be32 spcr_mask =
[...]

  reply	other threads:[~2024-12-19 12:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-15 15:18 [PATCH 0/4] Misc. PowerPC MPC83xx fixes/cleanups J. Neuschäfer via B4 Relay
2024-12-15 15:18 ` [PATCH 1/4] powerpc: mpc83xx: Fix timer value calculation J. Neuschäfer via B4 Relay
2024-12-18 19:24   ` Sinan Akman
2024-12-15 15:18 ` [PATCH 2/4] powerpc: mpc83xx: Allow including initreg.h into multiple files J. Neuschäfer via B4 Relay
2024-12-18 19:18   ` Sinan Akman
2024-12-19 12:55     ` J. Neuschäfer [this message]
2024-12-19 16:16       ` Sinan Akman
2024-12-15 15:18 ` [PATCH 3/4] powerpc: mpc83xx: Use defined constant for SPCR[TBEN] J. Neuschäfer via B4 Relay
2024-12-18 19:25   ` Sinan Akman
2024-12-15 15:18 ` [PATCH 4/4] gpio: mpc8xxx: Preserve pre-init state of outputs J. Neuschäfer via B4 Relay
2024-12-18 19:20   ` Sinan Akman
2024-12-19 13:06     ` J. Neuschäfer
2024-12-19 16:13       ` Sinan Akman
2024-12-15 18:03 ` [PATCH 0/4] Misc. PowerPC MPC83xx fixes/cleanups Tom Rini

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=Z2QX2B911TzstWge@probook \
    --to=j.ne@posteo.net \
    --cc=mario.six@gdsys.cc \
    --cc=sinan@writeme.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /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