From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D8FC31B29CF for ; Thu, 4 Jul 2024 16:27:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720110456; cv=none; b=HrPTrbkJH2cSKW4kf6X/cNKBcyYrZrm8xKxTMPlkwuFWZhxA6QiH20hBswF6l5ztwl/p37CxiEJa36yo8TnWFjcHrZRz2vHSOCDOqyMrl1bKIaF9fRYLXHDTfV/sEWxlBLYZDsaKI9AbhzrJ++xvE7n2xOtBXzZ4B8OTysEOByg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720110456; c=relaxed/simple; bh=cLbax7w8hCqvVgykek/avE2LE7rUynfVykQnAlriJRw=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=tjYrP3loxx+o8CBh3movI97lIajfRt56uTRz9NaFJnjISAZf2lJ2vues0QmvBRMTzUt2fLVTrJyz8z1yKpY1Go5gE2hvs2V3gLr8zi+qZgmo3SucLwZwP6tZPnINJNsCRjco438+QvkLACqWysjxxNh1XUBG3PVNmkMqZmbvxY8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FtAmTwv0; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FtAmTwv0" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5D008C3277B; Thu, 4 Jul 2024 16:27:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1720110456; bh=cLbax7w8hCqvVgykek/avE2LE7rUynfVykQnAlriJRw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=FtAmTwv0BhpOAgNuf2xM0PMOCI5jJVC3qbUtNtcqZgw0ZATa2ue7zH01yxHMpO3qs Z4ddXbwPNDuM/69bt2vAlgBCx6I/QzkOrLQuHvHtz0is7lEV6efBphdtYfl7gb9xxK aDCTY7Dpo7bYvYOP6ZZAi8KJoGudUd4VF+rCB7Vho0ekYNUntsn1lol7BuIJSS4Hc6 lN183LNldf9WlPrnr2pOM7riQnzulQGIIAWNl36GMkpIuZGi2reHRzTcZIRJE19QzN /USbN67o5BEcTVRRJAENlfMG55SWnsgL4Mhz6JYrmky7SNvR03b10TH6RlEDJfNpO/ oVgQwAWLNgwOw== Received: from sofa.misterjones.org ([185.219.108.64] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1sPPIz-009okh-Jl; Thu, 04 Jul 2024 17:27:33 +0100 Date: Thu, 04 Jul 2024 17:27:33 +0100 Message-ID: <87a5ixp1fu.wl-maz@kernel.org> From: Marc Zyngier To: Catalin Marinas Cc: kernel test robot , James Morse , oe-kbuild-all@lists.linux.dev, Linux Memory Management List , "Russell King (Oracle)" , Jonathan Cameron Subject: Re: [linux-next:master 9019/10049] drivers/irqchip/irq-gic-v3.c:47:23: warning: 'broken_rdists' defined but not used In-Reply-To: References: <202407021807.cBuWVBVa-lkp@intel.com> <86cynt4jem.wl-maz@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.2 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) Precedence: bulk X-Mailing-List: oe-kbuild-all@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: catalin.marinas@arm.com, lkp@intel.com, james.morse@arm.com, oe-kbuild-all@lists.linux.dev, linux-mm@kvack.org, rmk+kernel@armlinux.org.uk, Jonathan.Cameron@huawei.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false On Thu, 04 Jul 2024 11:27:28 +0100, Catalin Marinas 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 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 > > > > | 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 > > > > 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.