powerpc: mpc83xx: Allow including initreg.h into multiple files

Globals defined in headers can result in multiple-definition errors
while linking, if they are visible beyond the current translation unit.

This hasn't been a problem for initreg.h so far, but would become a
problem in the next patch, where I use a constant from initreg.h in a
second C file.

Reviewed-by: Sinan Akman <sinan@writeme.com>
Signed-off-by: J. Neuschäfer <j.ne@posteo.net>
This commit is contained in:
J. Neuschäfer 2024-12-20 11:37:52 +01:00 committed by Tom Rini
parent deb26b6c29
commit b3e8c67a91

View file

@ -13,7 +13,7 @@
#define SPCR_TSECBDP_MASK 0x00000C00 #define SPCR_TSECBDP_MASK 0x00000C00
#define SPCR_TSECEP_MASK 0x00000300 #define SPCR_TSECEP_MASK 0x00000300
const __be32 spcr_mask = static const __be32 spcr_mask =
#if defined(CONFIG_SPCR_OPT) && !defined(CONFIG_SPCR_OPT_UNSET) #if defined(CONFIG_SPCR_OPT) && !defined(CONFIG_SPCR_OPT_UNSET)
SPCR_OPT_MASK | SPCR_OPT_MASK |
#endif #endif
@ -27,7 +27,7 @@
SPCR_TSEC2EP_MASK | SPCR_TSEC2EP_MASK |
#endif #endif
0; 0;
const __be32 spcr_val = static const __be32 spcr_val =
#if defined(CONFIG_SPCR_OPT) && !defined(CONFIG_SPCR_OPT_UNSET) #if defined(CONFIG_SPCR_OPT) && !defined(CONFIG_SPCR_OPT_UNSET)
CONFIG_SPCR_OPT | CONFIG_SPCR_OPT |
#endif #endif
@ -42,7 +42,7 @@
#endif #endif
0; 0;
const __be32 lcrr_mask = static const __be32 lcrr_mask =
#if defined(CONFIG_LCRR_DBYP) && !defined(CONFIG_LCRR_DBYP_UNSET) #if defined(CONFIG_LCRR_DBYP) && !defined(CONFIG_LCRR_DBYP_UNSET)
LCRR_DBYP | LCRR_DBYP |
#endif #endif
@ -60,7 +60,7 @@
#endif #endif
0; 0;
const __be32 lcrr_val = static const __be32 lcrr_val =
#if defined(CONFIG_LCRR_DBYP) && !defined(CONFIG_LCRR_DBYP_UNSET) #if defined(CONFIG_LCRR_DBYP) && !defined(CONFIG_LCRR_DBYP_UNSET)
CONFIG_LCRR_DBYP | CONFIG_LCRR_DBYP |
#endif #endif