Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1172135pxa; Thu, 20 Aug 2020 04:42:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyArCZr0J1GDvuhPdEUF6mXTWqfa/MJ9HzasREvy7uGugGcwPn1g0uiSvYTswoNXflpHH3C X-Received: by 2002:a05:6402:b45:: with SMTP id bx5mr2516483edb.214.1597923760677; Thu, 20 Aug 2020 04:42:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597923760; cv=none; d=google.com; s=arc-20160816; b=jZCq4rmOEdrxDXEM+h0LNq9Hh1wgGT16eLkGxMcwYoqEGYfW6nc6kVQfvIZGKpImMD xPfhDZr2DaRBhqKKms1ety9al+gfaXKC85+AwF10zCfcuIx2wpHHval5noqdTMVN4Omr CueFdEJoKX1X8DeYb522/6ZGxflgVNLa29ec7Xr1fXHr71Qym5VD/2Xy1KeGhQjXzr71 feMmEiacvkM/1qEkn4fythmEHAt3LQ0XBn7XF23V6A+XuEpt5caStrS7yp6w7l38CCHw fIMqqsg2tf8Qsa5joFAzvM1j/sgPo6/2BaCnfYhq5JZQOdIZZHidNfo3U6R4rB+KChDQ btwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=kspGMAhqRGxvKgUP5L51LsMXjC8BUT+LkYepGfXxRJc=; b=FbPn9pYmtFY6g2ML/d4BH+l3HyVE+gi7dBCnoh7+4ezjOoHAc435OaA0Zh7WhLTjyE VJ/oKrhBR0e0Ve/vT371vYIKFaabqz2APQjrXmG/NChQRiYOTegfXez07QUBB9C7i0io KTKLRHHyXObbHiuOvwl3hxRocsSAcEYmt8zO/V91p8oOhHLo7eUD1Dr0hMLK55rBcDdB 7EVaYLbIRaY86N50ZjVHNh6r0wHopTQpUuhx2CfCsorCKTfyl6Qfya/E69qtn/OuuunE 4Nli214vuuZuKqqqVj/2jiLMlT2SMw5Jm3RtSt9REAeC9UVSjmIFKSkUujTtjqu+dG78 WKgA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t2si1120710eji.602.2020.08.20.04.42.17; Thu, 20 Aug 2020 04:42:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728113AbgHTLit (ORCPT + 99 others); Thu, 20 Aug 2020 07:38:49 -0400 Received: from mx2.suse.de ([195.135.220.15]:52672 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730572AbgHTLa6 (ORCPT ); Thu, 20 Aug 2020 07:30:58 -0400 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 Cc: linux-kernel@vger.kernel.org, tglx@linutronix.de, peterz@infradead.org, Jisheng.Zhang@synaptics.com, rdna@fb.com, viro@zeniv.linux.org.uk, gpiccoli@canonical.com, naveen.n.rao@linux.vnet.ibm.com, ravi.bangoria@linux.ibm.com, sandipan@linux.ibm.com, mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org 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) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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