From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 893FEC433E1 for ; Thu, 20 Aug 2020 11:32:55 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DAE80204EA for ; Thu, 20 Aug 2020 11:32:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DAE80204EA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4BXMvm05XyzDr2g for ; Thu, 20 Aug 2020 21:32:52 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=suse.com (client-ip=195.135.220.15; helo=mx2.suse.de; envelope-from=pmladek@suse.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.com Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4BXMsm5HyLzDr2K for ; Thu, 20 Aug 2020 21:31:00 +1000 (AEST) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id BA164AC98; Thu, 20 Aug 2020 11:31:24 +0000 (UTC) Date: Thu, 20 Aug 2020 13:30:56 +0200 From: Petr Mladek To: Balamuruhan S Subject: Re: [PATCH] kernel/watchdog: fix warning -Wunused-variable for watchdog_allowed_mask in ppc64 Message-ID: <20200820113056.GG4353@alley> References: <20200814133330.210093-1-bala24@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200814133330.210093-1-bala24@linux.ibm.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ravi.bangoria@linux.ibm.com, peterz@infradead.org, gpiccoli@canonical.com, linux-kernel@vger.kernel.org, rdna@fb.com, Jisheng.Zhang@synaptics.com, viro@zeniv.linux.org.uk, tglx@linutronix.de, linuxppc-dev@lists.ozlabs.org, naveen.n.rao@linux.vnet.ibm.com, sandipan@linux.ibm.com Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Fri 2020-08-14 19:03:30, Balamuruhan S wrote: > In ppc64 config if `CONFIG_SOFTLOCKUP_DETECTOR` is not set then it > warns for unused declaration of `watchdog_allowed_mask` while building, > move the declaration inside ifdef later in the code. > > ``` > kernel/watchdog.c:47:23: warning: ‘watchdog_allowed_mask’ defined but not used [-Wunused-variable] > static struct cpumask watchdog_allowed_mask __read_mostly; > ``` > > Signed-off-by: Balamuruhan S > --- > kernel/watchdog.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/watchdog.c b/kernel/watchdog.c > index 5abb5b22ad13..33c9b8a3d51b 100644 > --- a/kernel/watchdog.c > +++ b/kernel/watchdog.c > @@ -44,7 +44,6 @@ int __read_mostly soft_watchdog_user_enabled = 1; > int __read_mostly watchdog_thresh = 10; > static int __read_mostly nmi_watchdog_available; > > -static struct cpumask watchdog_allowed_mask __read_mostly; > > struct cpumask watchdog_cpumask __read_mostly; > unsigned long *watchdog_cpumask_bits = cpumask_bits(&watchdog_cpumask); > @@ -166,6 +165,7 @@ int __read_mostly sysctl_softlockup_all_cpu_backtrace; > unsigned int __read_mostly softlockup_panic = > CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE; > > +static struct cpumask watchdog_allowed_mask __read_mostly; I could confirm that the variable is used only in code that is built when CONFIG_SOFTLOCKUP_DETECTOR is enabled. Note that the problem can't be seen on x86. There the softlockup detector is enforced together with hardloclup detector via via HARDLOCKUP_DETECTOR_PERF. Reviewed-by: Petr Mladek Best Regards, Petr