* [linux-next:master 9019/10049] drivers/irqchip/irq-gic-v3.c:47:23: warning: 'broken_rdists' defined but not used
@ 2024-07-02 10:40 kernel test robot
2024-07-04 8:52 ` Catalin Marinas
0 siblings, 1 reply; 7+ messages in thread
From: kernel test robot @ 2024-07-02 10:40 UTC (permalink / raw)
To: James Morse
Cc: oe-kbuild-all, Linux Memory Management List, Catalin Marinas,
Russell King (Oracle),
Jonathan Cameron
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 82e4255305c554b0bb18b7ccf2db86041b4c8b6e
commit: d633da5d3ab1a0eb26a2213d65da1e189e82f8ab [9019/10049] irqchip/gic-v3: Add support for ACPI's disabled but 'online capable' CPUs
config: arm-randconfig-r034-20220810 (https://download.01.org/0day-ci/archive/20240702/202407021807.cBuWVBVa-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240702/202407021807.cBuWVBVa-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202407021807.cBuWVBVa-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/irqchip/irq-gic-v3.c:47:23: warning: 'broken_rdists' defined but not used [-Wunused-variable]
47 | static struct cpumask broken_rdists __read_mostly;
| ^~~~~~~~~~~~~
vim +/broken_rdists +47 drivers/irqchip/irq-gic-v3.c
46
> 47 static struct cpumask broken_rdists __read_mostly;
48
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [linux-next:master 9019/10049] drivers/irqchip/irq-gic-v3.c:47:23: warning: 'broken_rdists' defined but not used
2024-07-02 10:40 [linux-next:master 9019/10049] drivers/irqchip/irq-gic-v3.c:47:23: warning: 'broken_rdists' defined but not used kernel test robot
@ 2024-07-04 8:52 ` Catalin Marinas
2024-07-04 9:05 ` Marc Zyngier
0 siblings, 1 reply; 7+ messages in thread
From: Catalin Marinas @ 2024-07-04 8:52 UTC (permalink / raw)
To: kernel test robot, Marc Zyngier
Cc: James Morse, oe-kbuild-all, Linux Memory Management List,
Russell King (Oracle),
Jonathan Cameron
On Tue, Jul 02, 2024 at 06:40:12PM +0800, kernel test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head: 82e4255305c554b0bb18b7ccf2db86041b4c8b6e
> commit: d633da5d3ab1a0eb26a2213d65da1e189e82f8ab [9019/10049] irqchip/gic-v3: Add support for ACPI's disabled but 'online capable' CPUs
> config: arm-randconfig-r034-20220810 (https://download.01.org/0day-ci/archive/20240702/202407021807.cBuWVBVa-lkp@intel.com/config)
> compiler: arm-linux-gnueabi-gcc (GCC) 13.2.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240702/202407021807.cBuWVBVa-lkp@intel.com/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202407021807.cBuWVBVa-lkp@intel.com/
>
> All warnings (new ones prefixed by >>):
>
> >> drivers/irqchip/irq-gic-v3.c:47:23: warning: 'broken_rdists' defined but not used [-Wunused-variable]
> 47 | static struct cpumask broken_rdists __read_mostly;
> | ^~~~~~~~~~~~~
>
>
> vim +/broken_rdists +47 drivers/irqchip/irq-gic-v3.c
This can happen when building on arm32 with SMP disabled. So we either
add a __maybe_unused annotation or we move the variable further down in
the CONFIG_SMP block. Marc, what's your preference?
-----------8<----------------------
diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
index c29b424d1d0c..6393f3d780e9 100644
--- a/drivers/irqchip/irq-gic-v3.c
+++ b/drivers/irqchip/irq-gic-v3.c
@@ -47,7 +47,7 @@ static u8 dist_prio_nmi __ro_after_init = GICV3_PRIO_NMI;
#define GIC_IRQ_TYPE_PARTITION (GIC_IRQ_TYPE_LPI + 1)
-static struct cpumask broken_rdists __read_mostly;
+static struct cpumask broken_rdists __read_mostly __maybe_unused;
struct redist_region {
void __iomem *redist_base;
-----------8<----------------------
or,
-----------8<----------------------
diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
index c29b424d1d0c..187948f41bb3 100644
--- a/drivers/irqchip/irq-gic-v3.c
+++ b/drivers/irqchip/irq-gic-v3.c
@@ -47,8 +47,6 @@ static u8 dist_prio_nmi __ro_after_init = GICV3_PRIO_NMI;
#define GIC_IRQ_TYPE_PARTITION (GIC_IRQ_TYPE_LPI + 1)
-static struct cpumask broken_rdists __read_mostly;
-
struct redist_region {
void __iomem *redist_base;
phys_addr_t phys_base;
@@ -1316,6 +1314,8 @@ static void gic_cpu_init(void)
#ifdef CONFIG_SMP
+static struct cpumask broken_rdists __read_mostly;
+
#define MPIDR_TO_SGI_RS(mpidr) (MPIDR_RS(mpidr) << ICC_SGI1R_RS_SHIFT)
#define MPIDR_TO_SGI_CLUSTER_ID(mpidr) ((mpidr) & ~0xFUL)
--
Catalin
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [linux-next:master 9019/10049] drivers/irqchip/irq-gic-v3.c:47:23: warning: 'broken_rdists' defined but not used
2024-07-04 8:52 ` Catalin Marinas
@ 2024-07-04 9:05 ` Marc Zyngier
2024-07-04 10:15 ` Catalin Marinas
2024-07-04 10:27 ` Catalin Marinas
0 siblings, 2 replies; 7+ messages in thread
From: Marc Zyngier @ 2024-07-04 9:05 UTC (permalink / raw)
To: Catalin Marinas
Cc: kernel test robot, James Morse, oe-kbuild-all,
Linux Memory Management List, Russell King (Oracle),
Jonathan Cameron
On Thu, 04 Jul 2024 09:52:16 +0100,
Catalin Marinas <catalin.marinas@arm.com> wrote:
>
> On Tue, Jul 02, 2024 at 06:40:12PM +0800, kernel test robot wrote:
> > tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> > head: 82e4255305c554b0bb18b7ccf2db86041b4c8b6e
> > commit: d633da5d3ab1a0eb26a2213d65da1e189e82f8ab [9019/10049] irqchip/gic-v3: Add support for ACPI's disabled but 'online capable' CPUs
> > config: arm-randconfig-r034-20220810 (https://download.01.org/0day-ci/archive/20240702/202407021807.cBuWVBVa-lkp@intel.com/config)
> > compiler: arm-linux-gnueabi-gcc (GCC) 13.2.0
> > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240702/202407021807.cBuWVBVa-lkp@intel.com/reproduce)
> >
> > If you fix the issue in a separate patch/commit (i.e. not just a new version of
> > the same patch/commit), kindly add following tags
> > | Reported-by: kernel test robot <lkp@intel.com>
> > | Closes: https://lore.kernel.org/oe-kbuild-all/202407021807.cBuWVBVa-lkp@intel.com/
> >
> > All warnings (new ones prefixed by >>):
> >
> > >> drivers/irqchip/irq-gic-v3.c:47:23: warning: 'broken_rdists' defined but not used [-Wunused-variable]
> > 47 | static struct cpumask broken_rdists __read_mostly;
> > | ^~~~~~~~~~~~~
> >
> >
> > vim +/broken_rdists +47 drivers/irqchip/irq-gic-v3.c
>
> This can happen when building on arm32 with SMP disabled. So we either
> add a __maybe_unused annotation or we move the variable further down in
> the CONFIG_SMP block. Marc, what's your preference?
>
> -----------8<----------------------
> diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
> index c29b424d1d0c..6393f3d780e9 100644
> --- a/drivers/irqchip/irq-gic-v3.c
> +++ b/drivers/irqchip/irq-gic-v3.c
> @@ -47,7 +47,7 @@ static u8 dist_prio_nmi __ro_after_init = GICV3_PRIO_NMI;
>
> #define GIC_IRQ_TYPE_PARTITION (GIC_IRQ_TYPE_LPI + 1)
>
> -static struct cpumask broken_rdists __read_mostly;
> +static struct cpumask broken_rdists __read_mostly __maybe_unused;
>
> struct redist_region {
> void __iomem *redist_base;
> -----------8<----------------------
>
> or,
>
> -----------8<----------------------
> diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
> index c29b424d1d0c..187948f41bb3 100644
> --- a/drivers/irqchip/irq-gic-v3.c
> +++ b/drivers/irqchip/irq-gic-v3.c
> @@ -47,8 +47,6 @@ static u8 dist_prio_nmi __ro_after_init = GICV3_PRIO_NMI;
>
> #define GIC_IRQ_TYPE_PARTITION (GIC_IRQ_TYPE_LPI + 1)
>
> -static struct cpumask broken_rdists __read_mostly;
> -
> struct redist_region {
> void __iomem *redist_base;
> phys_addr_t phys_base;
> @@ -1316,6 +1314,8 @@ static void gic_cpu_init(void)
>
> #ifdef CONFIG_SMP
>
> +static struct cpumask broken_rdists __read_mostly;
> +
> #define MPIDR_TO_SGI_RS(mpidr) (MPIDR_RS(mpidr) << ICC_SGI1R_RS_SHIFT)
> #define MPIDR_TO_SGI_CLUSTER_ID(mpidr) ((mpidr) & ~0xFUL)
The second version seems to be the most logical one, since we already
have this SMP-only block (note to self: constraint GICv3 support to
SMP only at the earliest opportunity).
Feel free to add my
Acked-by: Marc Zyngier <maz@kernel.org>
if you decide to push a fix on top of this branch.
Thanks,
M.
--
Without deviation from the norm, progress is not possible.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [linux-next:master 9019/10049] drivers/irqchip/irq-gic-v3.c:47:23: warning: 'broken_rdists' defined but not used
2024-07-04 9:05 ` Marc Zyngier
@ 2024-07-04 10:15 ` Catalin Marinas
2024-07-04 10:27 ` Catalin Marinas
1 sibling, 0 replies; 7+ messages in thread
From: Catalin Marinas @ 2024-07-04 10:15 UTC (permalink / raw)
To: Marc Zyngier
Cc: kernel test robot, James Morse, oe-kbuild-all,
Linux Memory Management List, Russell King (Oracle),
Jonathan Cameron
On Thu, Jul 04, 2024 at 10:05:05AM +0100, Marc Zyngier wrote:
> On Thu, 04 Jul 2024 09:52:16 +0100,
> Catalin Marinas <catalin.marinas@arm.com> wrote:
> >
> > On Tue, Jul 02, 2024 at 06:40:12PM +0800, kernel test robot wrote:
> > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> > > head: 82e4255305c554b0bb18b7ccf2db86041b4c8b6e
> > > commit: d633da5d3ab1a0eb26a2213d65da1e189e82f8ab [9019/10049] irqchip/gic-v3: Add support for ACPI's disabled but 'online capable' CPUs
> > > config: arm-randconfig-r034-20220810 (https://download.01.org/0day-ci/archive/20240702/202407021807.cBuWVBVa-lkp@intel.com/config)
> > > compiler: arm-linux-gnueabi-gcc (GCC) 13.2.0
> > > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240702/202407021807.cBuWVBVa-lkp@intel.com/reproduce)
> > >
> > > If you fix the issue in a separate patch/commit (i.e. not just a new version of
> > > the same patch/commit), kindly add following tags
> > > | Reported-by: kernel test robot <lkp@intel.com>
> > > | Closes: https://lore.kernel.org/oe-kbuild-all/202407021807.cBuWVBVa-lkp@intel.com/
> > >
> > > All warnings (new ones prefixed by >>):
> > >
> > > >> drivers/irqchip/irq-gic-v3.c:47:23: warning: 'broken_rdists' defined but not used [-Wunused-variable]
> > > 47 | static struct cpumask broken_rdists __read_mostly;
> > > | ^~~~~~~~~~~~~
> > >
> > >
> > > vim +/broken_rdists +47 drivers/irqchip/irq-gic-v3.c
> >
> > This can happen when building on arm32 with SMP disabled. So we either
> > add a __maybe_unused annotation or we move the variable further down in
> > the CONFIG_SMP block. Marc, what's your preference?
> >
> > -----------8<----------------------
> > diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
> > index c29b424d1d0c..6393f3d780e9 100644
> > --- a/drivers/irqchip/irq-gic-v3.c
> > +++ b/drivers/irqchip/irq-gic-v3.c
> > @@ -47,7 +47,7 @@ static u8 dist_prio_nmi __ro_after_init = GICV3_PRIO_NMI;
> >
> > #define GIC_IRQ_TYPE_PARTITION (GIC_IRQ_TYPE_LPI + 1)
> >
> > -static struct cpumask broken_rdists __read_mostly;
> > +static struct cpumask broken_rdists __read_mostly __maybe_unused;
> >
> > struct redist_region {
> > void __iomem *redist_base;
> > -----------8<----------------------
> >
> > or,
> >
> > -----------8<----------------------
> > diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
> > index c29b424d1d0c..187948f41bb3 100644
> > --- a/drivers/irqchip/irq-gic-v3.c
> > +++ b/drivers/irqchip/irq-gic-v3.c
> > @@ -47,8 +47,6 @@ static u8 dist_prio_nmi __ro_after_init = GICV3_PRIO_NMI;
> >
> > #define GIC_IRQ_TYPE_PARTITION (GIC_IRQ_TYPE_LPI + 1)
> >
> > -static struct cpumask broken_rdists __read_mostly;
> > -
> > struct redist_region {
> > void __iomem *redist_base;
> > phys_addr_t phys_base;
> > @@ -1316,6 +1314,8 @@ static void gic_cpu_init(void)
> >
> > #ifdef CONFIG_SMP
> >
> > +static struct cpumask broken_rdists __read_mostly;
> > +
> > #define MPIDR_TO_SGI_RS(mpidr) (MPIDR_RS(mpidr) << ICC_SGI1R_RS_SHIFT)
> > #define MPIDR_TO_SGI_CLUSTER_ID(mpidr) ((mpidr) & ~0xFUL)
>
> The second version seems to be the most logical one, since we already
> have this SMP-only block (note to self: constraint GICv3 support to
> SMP only at the earliest opportunity).
>
> Feel free to add my
>
> Acked-by: Marc Zyngier <maz@kernel.org>
>
> if you decide to push a fix on top of this branch.
Thanks.
--
Catalin
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [linux-next:master 9019/10049] drivers/irqchip/irq-gic-v3.c:47:23: warning: 'broken_rdists' defined but not used
2024-07-04 9:05 ` Marc Zyngier
2024-07-04 10:15 ` Catalin Marinas
@ 2024-07-04 10:27 ` Catalin Marinas
2024-07-04 16:27 ` Marc Zyngier
1 sibling, 1 reply; 7+ messages in thread
From: Catalin Marinas @ 2024-07-04 10:27 UTC (permalink / raw)
To: Marc Zyngier
Cc: kernel test robot, James Morse, oe-kbuild-all,
Linux Memory Management List, Russell King (Oracle),
Jonathan Cameron
On Thu, Jul 04, 2024 at 10:05:05AM +0100, Marc Zyngier wrote:
> On Thu, 04 Jul 2024 09:52:16 +0100,
> Catalin Marinas <catalin.marinas@arm.com> wrote:
> >
> > On Tue, Jul 02, 2024 at 06:40:12PM +0800, kernel test robot wrote:
> > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> > > head: 82e4255305c554b0bb18b7ccf2db86041b4c8b6e
> > > commit: d633da5d3ab1a0eb26a2213d65da1e189e82f8ab [9019/10049] irqchip/gic-v3: Add support for ACPI's disabled but 'online capable' CPUs
> > > config: arm-randconfig-r034-20220810 (https://download.01.org/0day-ci/archive/20240702/202407021807.cBuWVBVa-lkp@intel.com/config)
> > > compiler: arm-linux-gnueabi-gcc (GCC) 13.2.0
> > > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240702/202407021807.cBuWVBVa-lkp@intel.com/reproduce)
> > >
> > > If you fix the issue in a separate patch/commit (i.e. not just a new version of
> > > the same patch/commit), kindly add following tags
> > > | Reported-by: kernel test robot <lkp@intel.com>
> > > | Closes: https://lore.kernel.org/oe-kbuild-all/202407021807.cBuWVBVa-lkp@intel.com/
> > >
> > > All warnings (new ones prefixed by >>):
> > >
> > > >> drivers/irqchip/irq-gic-v3.c:47:23: warning: 'broken_rdists' defined but not used [-Wunused-variable]
> > > 47 | static struct cpumask broken_rdists __read_mostly;
> > > | ^~~~~~~~~~~~~
> > >
> > >
> > > vim +/broken_rdists +47 drivers/irqchip/irq-gic-v3.c
> >
> > This can happen when building on arm32 with SMP disabled. So we either
> > add a __maybe_unused annotation or we move the variable further down in
> > the CONFIG_SMP block. Marc, what's your preference?
> >
> > -----------8<----------------------
> > diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
> > index c29b424d1d0c..6393f3d780e9 100644
> > --- a/drivers/irqchip/irq-gic-v3.c
> > +++ b/drivers/irqchip/irq-gic-v3.c
> > @@ -47,7 +47,7 @@ static u8 dist_prio_nmi __ro_after_init = GICV3_PRIO_NMI;
> >
> > #define GIC_IRQ_TYPE_PARTITION (GIC_IRQ_TYPE_LPI + 1)
> >
> > -static struct cpumask broken_rdists __read_mostly;
> > +static struct cpumask broken_rdists __read_mostly __maybe_unused;
> >
> > struct redist_region {
> > void __iomem *redist_base;
> > -----------8<----------------------
> >
> > or,
> >
> > -----------8<----------------------
> > diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
> > index c29b424d1d0c..187948f41bb3 100644
> > --- a/drivers/irqchip/irq-gic-v3.c
> > +++ b/drivers/irqchip/irq-gic-v3.c
> > @@ -47,8 +47,6 @@ static u8 dist_prio_nmi __ro_after_init = GICV3_PRIO_NMI;
> >
> > #define GIC_IRQ_TYPE_PARTITION (GIC_IRQ_TYPE_LPI + 1)
> >
> > -static struct cpumask broken_rdists __read_mostly;
> > -
> > struct redist_region {
> > void __iomem *redist_base;
> > phys_addr_t phys_base;
> > @@ -1316,6 +1314,8 @@ static void gic_cpu_init(void)
> >
> > #ifdef CONFIG_SMP
> >
> > +static struct cpumask broken_rdists __read_mostly;
> > +
> > #define MPIDR_TO_SGI_RS(mpidr) (MPIDR_RS(mpidr) << ICC_SGI1R_RS_SHIFT)
> > #define MPIDR_TO_SGI_CLUSTER_ID(mpidr) ((mpidr) & ~0xFUL)
>
> The second version seems to be the most logical one, since we already
> have this SMP-only block (note to self: constraint GICv3 support to
> SMP only at the earliest opportunity).
>
> Feel free to add my
>
> Acked-by: Marc Zyngier <maz@kernel.org>
>
> if you decide to push a fix on top of this branch.
Ah, it's also used in the CONFIG_ACPI block further down. So
__maybe_unused may be easier. Or add some #if defined(CONFIG_SMP) ||
defined(CONFIG_ACPI) but it seems too verbose.
--
Catalin
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [linux-next:master 9019/10049] drivers/irqchip/irq-gic-v3.c:47:23: warning: 'broken_rdists' defined but not used
2024-07-04 10:27 ` Catalin Marinas
@ 2024-07-04 16:27 ` Marc Zyngier
2024-07-05 9:03 ` Catalin Marinas
0 siblings, 1 reply; 7+ messages in thread
From: Marc Zyngier @ 2024-07-04 16:27 UTC (permalink / raw)
To: Catalin Marinas
Cc: kernel test robot, James Morse, oe-kbuild-all,
Linux Memory Management List, Russell King (Oracle),
Jonathan Cameron
On Thu, 04 Jul 2024 11:27:28 +0100,
Catalin Marinas <catalin.marinas@arm.com> wrote:
>
> On Thu, Jul 04, 2024 at 10:05:05AM +0100, Marc Zyngier wrote:
> > On Thu, 04 Jul 2024 09:52:16 +0100,
> > Catalin Marinas <catalin.marinas@arm.com> wrote:
> > >
> > > On Tue, Jul 02, 2024 at 06:40:12PM +0800, kernel test robot wrote:
> > > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> > > > head: 82e4255305c554b0bb18b7ccf2db86041b4c8b6e
> > > > commit: d633da5d3ab1a0eb26a2213d65da1e189e82f8ab [9019/10049] irqchip/gic-v3: Add support for ACPI's disabled but 'online capable' CPUs
> > > > config: arm-randconfig-r034-20220810 (https://download.01.org/0day-ci/archive/20240702/202407021807.cBuWVBVa-lkp@intel.com/config)
> > > > compiler: arm-linux-gnueabi-gcc (GCC) 13.2.0
> > > > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240702/202407021807.cBuWVBVa-lkp@intel.com/reproduce)
> > > >
> > > > If you fix the issue in a separate patch/commit (i.e. not just a new version of
> > > > the same patch/commit), kindly add following tags
> > > > | Reported-by: kernel test robot <lkp@intel.com>
> > > > | Closes: https://lore.kernel.org/oe-kbuild-all/202407021807.cBuWVBVa-lkp@intel.com/
> > > >
> > > > All warnings (new ones prefixed by >>):
> > > >
> > > > >> drivers/irqchip/irq-gic-v3.c:47:23: warning: 'broken_rdists' defined but not used [-Wunused-variable]
> > > > 47 | static struct cpumask broken_rdists __read_mostly;
> > > > | ^~~~~~~~~~~~~
> > > >
> > > >
> > > > vim +/broken_rdists +47 drivers/irqchip/irq-gic-v3.c
> > >
> > > This can happen when building on arm32 with SMP disabled. So we either
> > > add a __maybe_unused annotation or we move the variable further down in
> > > the CONFIG_SMP block. Marc, what's your preference?
> > >
> > > -----------8<----------------------
> > > diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
> > > index c29b424d1d0c..6393f3d780e9 100644
> > > --- a/drivers/irqchip/irq-gic-v3.c
> > > +++ b/drivers/irqchip/irq-gic-v3.c
> > > @@ -47,7 +47,7 @@ static u8 dist_prio_nmi __ro_after_init = GICV3_PRIO_NMI;
> > >
> > > #define GIC_IRQ_TYPE_PARTITION (GIC_IRQ_TYPE_LPI + 1)
> > >
> > > -static struct cpumask broken_rdists __read_mostly;
> > > +static struct cpumask broken_rdists __read_mostly __maybe_unused;
> > >
> > > struct redist_region {
> > > void __iomem *redist_base;
> > > -----------8<----------------------
> > >
> > > or,
> > >
> > > -----------8<----------------------
> > > diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
> > > index c29b424d1d0c..187948f41bb3 100644
> > > --- a/drivers/irqchip/irq-gic-v3.c
> > > +++ b/drivers/irqchip/irq-gic-v3.c
> > > @@ -47,8 +47,6 @@ static u8 dist_prio_nmi __ro_after_init = GICV3_PRIO_NMI;
> > >
> > > #define GIC_IRQ_TYPE_PARTITION (GIC_IRQ_TYPE_LPI + 1)
> > >
> > > -static struct cpumask broken_rdists __read_mostly;
> > > -
> > > struct redist_region {
> > > void __iomem *redist_base;
> > > phys_addr_t phys_base;
> > > @@ -1316,6 +1314,8 @@ static void gic_cpu_init(void)
> > >
> > > #ifdef CONFIG_SMP
> > >
> > > +static struct cpumask broken_rdists __read_mostly;
> > > +
> > > #define MPIDR_TO_SGI_RS(mpidr) (MPIDR_RS(mpidr) << ICC_SGI1R_RS_SHIFT)
> > > #define MPIDR_TO_SGI_CLUSTER_ID(mpidr) ((mpidr) & ~0xFUL)
> >
> > The second version seems to be the most logical one, since we already
> > have this SMP-only block (note to self: constraint GICv3 support to
> > SMP only at the earliest opportunity).
> >
> > Feel free to add my
> >
> > Acked-by: Marc Zyngier <maz@kernel.org>
> >
> > if you decide to push a fix on top of this branch.
>
> Ah, it's also used in the CONFIG_ACPI block further down. So
> __maybe_unused may be easier. Or add some #if defined(CONFIG_SMP) ||
> defined(CONFIG_ACPI) but it seems too verbose.
Ah, of course. Go for the __maybe_unused then, it's not a big deal.
My Ack still stands.
Thanks,
M.
--
Without deviation from the norm, progress is not possible.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [linux-next:master 9019/10049] drivers/irqchip/irq-gic-v3.c:47:23: warning: 'broken_rdists' defined but not used
2024-07-04 16:27 ` Marc Zyngier
@ 2024-07-05 9:03 ` Catalin Marinas
0 siblings, 0 replies; 7+ messages in thread
From: Catalin Marinas @ 2024-07-05 9:03 UTC (permalink / raw)
To: Marc Zyngier
Cc: kernel test robot, James Morse, oe-kbuild-all,
Linux Memory Management List, Russell King (Oracle),
Jonathan Cameron
On Thu, Jul 04, 2024 at 05:27:33PM +0100, Marc Zyngier wrote:
> On Thu, 04 Jul 2024 11:27:28 +0100,
> Catalin Marinas <catalin.marinas@arm.com> wrote:
> >
> > On Thu, Jul 04, 2024 at 10:05:05AM +0100, Marc Zyngier wrote:
> > > On Thu, 04 Jul 2024 09:52:16 +0100,
> > > Catalin Marinas <catalin.marinas@arm.com> wrote:
> > > >
> > > > On Tue, Jul 02, 2024 at 06:40:12PM +0800, kernel test robot wrote:
> > > > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> > > > > head: 82e4255305c554b0bb18b7ccf2db86041b4c8b6e
> > > > > commit: d633da5d3ab1a0eb26a2213d65da1e189e82f8ab [9019/10049] irqchip/gic-v3: Add support for ACPI's disabled but 'online capable' CPUs
> > > > > config: arm-randconfig-r034-20220810 (https://download.01.org/0day-ci/archive/20240702/202407021807.cBuWVBVa-lkp@intel.com/config)
> > > > > compiler: arm-linux-gnueabi-gcc (GCC) 13.2.0
> > > > > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240702/202407021807.cBuWVBVa-lkp@intel.com/reproduce)
> > > > >
> > > > > If you fix the issue in a separate patch/commit (i.e. not just a new version of
> > > > > the same patch/commit), kindly add following tags
> > > > > | Reported-by: kernel test robot <lkp@intel.com>
> > > > > | Closes: https://lore.kernel.org/oe-kbuild-all/202407021807.cBuWVBVa-lkp@intel.com/
> > > > >
> > > > > All warnings (new ones prefixed by >>):
> > > > >
> > > > > >> drivers/irqchip/irq-gic-v3.c:47:23: warning: 'broken_rdists' defined but not used [-Wunused-variable]
> > > > > 47 | static struct cpumask broken_rdists __read_mostly;
> > > > > | ^~~~~~~~~~~~~
> > > > >
> > > > >
> > > > > vim +/broken_rdists +47 drivers/irqchip/irq-gic-v3.c
> > > >
> > > > This can happen when building on arm32 with SMP disabled. So we either
> > > > add a __maybe_unused annotation or we move the variable further down in
> > > > the CONFIG_SMP block. Marc, what's your preference?
> > > >
> > > > -----------8<----------------------
> > > > diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
> > > > index c29b424d1d0c..6393f3d780e9 100644
> > > > --- a/drivers/irqchip/irq-gic-v3.c
> > > > +++ b/drivers/irqchip/irq-gic-v3.c
> > > > @@ -47,7 +47,7 @@ static u8 dist_prio_nmi __ro_after_init = GICV3_PRIO_NMI;
> > > >
> > > > #define GIC_IRQ_TYPE_PARTITION (GIC_IRQ_TYPE_LPI + 1)
> > > >
> > > > -static struct cpumask broken_rdists __read_mostly;
> > > > +static struct cpumask broken_rdists __read_mostly __maybe_unused;
> > > >
> > > > struct redist_region {
> > > > void __iomem *redist_base;
> > > > -----------8<----------------------
> > > >
> > > > or,
> > > >
> > > > -----------8<----------------------
> > > > diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
> > > > index c29b424d1d0c..187948f41bb3 100644
> > > > --- a/drivers/irqchip/irq-gic-v3.c
> > > > +++ b/drivers/irqchip/irq-gic-v3.c
> > > > @@ -47,8 +47,6 @@ static u8 dist_prio_nmi __ro_after_init = GICV3_PRIO_NMI;
> > > >
> > > > #define GIC_IRQ_TYPE_PARTITION (GIC_IRQ_TYPE_LPI + 1)
> > > >
> > > > -static struct cpumask broken_rdists __read_mostly;
> > > > -
> > > > struct redist_region {
> > > > void __iomem *redist_base;
> > > > phys_addr_t phys_base;
> > > > @@ -1316,6 +1314,8 @@ static void gic_cpu_init(void)
> > > >
> > > > #ifdef CONFIG_SMP
> > > >
> > > > +static struct cpumask broken_rdists __read_mostly;
> > > > +
> > > > #define MPIDR_TO_SGI_RS(mpidr) (MPIDR_RS(mpidr) << ICC_SGI1R_RS_SHIFT)
> > > > #define MPIDR_TO_SGI_CLUSTER_ID(mpidr) ((mpidr) & ~0xFUL)
> > >
> > > The second version seems to be the most logical one, since we already
> > > have this SMP-only block (note to self: constraint GICv3 support to
> > > SMP only at the earliest opportunity).
> > >
> > > Feel free to add my
> > >
> > > Acked-by: Marc Zyngier <maz@kernel.org>
> > >
> > > if you decide to push a fix on top of this branch.
> >
> > Ah, it's also used in the CONFIG_ACPI block further down. So
> > __maybe_unused may be easier. Or add some #if defined(CONFIG_SMP) ||
> > defined(CONFIG_ACPI) but it seems too verbose.
>
> Ah, of course. Go for the __maybe_unused then, it's not a big deal.
>
> My Ack still stands.
Thanks.
--
Catalin
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-07-05 9:03 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-02 10:40 [linux-next:master 9019/10049] drivers/irqchip/irq-gic-v3.c:47:23: warning: 'broken_rdists' defined but not used kernel test robot
2024-07-04 8:52 ` Catalin Marinas
2024-07-04 9:05 ` Marc Zyngier
2024-07-04 10:15 ` Catalin Marinas
2024-07-04 10:27 ` Catalin Marinas
2024-07-04 16:27 ` Marc Zyngier
2024-07-05 9:03 ` Catalin Marinas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox