Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1243982pxf; Fri, 26 Mar 2021 04:17:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz32QB4DdYRWXdirf0gQer2L6Ghxda9WHXkJorcLPgyg1NyjQpV8mEPU3Ir7xel6+OBlDr/ X-Received: by 2002:a05:6402:51d0:: with SMTP id r16mr14257590edd.48.1616757439389; Fri, 26 Mar 2021 04:17:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616757439; cv=none; d=google.com; s=arc-20160816; b=At8xKuwflT+Cc6oSO2T+ThdUnKAi6jv7GGLCjfpK/tysFNt5SUMX9HQF9+0NaszhoE JIEj7Nyb8TDuYYDqKne7mSUEsabq4DkFQ0E/dDDpjoWRnlEJHQuzPixreR/AUGdy5ieG J9oeJ/TMKsbXA8OKM+SAGjbcAbcbEw8zL2JiGdGc06K7tXkplT7MNrFIc6ibkCx2Dl6P 9IASMA0Wc7KLLwhTIKsr/kVBsX4k+N/p+uFVbp0FI9ZMP8YeWV8655vMUSnOZ4LMGKLn MxPA+s9QrKBTDpDMdM0/bjAdRA82zv8Cd/NDOhYJQrW7Vighj3CEFr0aQsyq58xL4dyA uIhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=NPZOeK7lpdUkuK8Gb8OEEbUBOL4qNIww27yfcO5L4Q4=; b=kpKBGZUlT7BN4lRtnjs3rcc5mrM5d3pXmZViHwKEOdG3rpliSY1RRGxSVHTSWhFwJe D7gZbvY3gjDCXoWpUIc/2FlU4epGsRbl3SAFW36WNtGQYMH45FuYjG95jnqSyXDsG7im mG2m78plhboT04jMKFI0WKGCWgxtWmNxglebNvNea+13Pq4ux+I+IQnBOFcZAK4cI8lF dBe7t64mAJEiHUK10dH/y3nDh6oeElPFXHdXrJ0sAUIfLdh7i182X21828ozPyjyJJ11 es347JhzgLn8IdFBCtDxEtWtrWq0MKZ5lOPJR/CQh1btZPaDt5ISXfFATW4jYu8vjs2Q bo+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=VcAFM3K9; 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 bz20si6811170ejc.368.2021.03.26.04.16.56; Fri, 26 Mar 2021 04:17:19 -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; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=VcAFM3K9; 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 S230056AbhCZLNO (ORCPT + 99 others); Fri, 26 Mar 2021 07:13:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230027AbhCZLMr (ORCPT ); Fri, 26 Mar 2021 07:12:47 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1877C0613AA for ; Fri, 26 Mar 2021 04:12:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=NPZOeK7lpdUkuK8Gb8OEEbUBOL4qNIww27yfcO5L4Q4=; b=VcAFM3K9NdlK4Rwrep45+G2eKr tkhCoM/E+GxXP/LvWreTu8+Z2udy6pHGgy6XMucTRllLDufGXaV1XkhQuPBR5ox8r4SsoXJyFLQGw 6HYWkom5MVkqBMIq/J+66MoDFDGbxWU6IbBgcFxILFsIzNEccDBaFan2tubxavfZ8e2Irj5kWLZ52 LolIAJn71pCUsmctihkkTAXnNXx5yBW/9WtP7GGr2mai+tInhM3NRt+C/dUq252Lx99bfpZYTCUbP 5c6atIeRF3Yhdnr9EOlB+X5h846FkY/jqXyuFeMzUiGkWDK2hceL4OkZXTEc2Ixlr7wuzZRxzVYTH pUo5Txbg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lPkOK-003PEj-Dc; Fri, 26 Mar 2021 11:12:36 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id AE422304D58; Fri, 26 Mar 2021 12:12:35 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 89FF220424904; Fri, 26 Mar 2021 12:12:35 +0100 (CET) Date: Fri, 26 Mar 2021 12:12:35 +0100 From: Peter Zijlstra To: Matthieu Baerts Cc: Josh Poimboeuf , Jason Baron , Steven Rostedt , Ard Biesheuvel , Jarkko Sakkinen , linux-kernel@vger.kernel.org Subject: Re: [PATCH mptcp-next] static_call: fix unused variable warn w/o MODULE Message-ID: References: <20210326105023.2058860-1-matthieu.baerts@tessares.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210326105023.2058860-1-matthieu.baerts@tessares.net> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 26, 2021 at 11:50:23AM +0100, Matthieu Baerts wrote: > Here is the warning converted as error and reported by GCC: > > kernel/static_call.c: In function ‘__static_call_update’: > kernel/static_call.c:153:18: error: unused variable ‘mod’ [-Werror=unused-variable] > 153 | struct module *mod = site_mod->mod; > | ^~~ > cc1: all warnings being treated as errors > make[1]: *** [scripts/Makefile.build:271: kernel/static_call.o] Error 1 > > This is simply because since recently, we no longer use 'mod' variable > elsewhere if MODULE is unset. > > When using 'make tinyconfig' to generate the default kconfig, MODULE is > unset. > > There are different ways to fix this warning. Here I tried to minimised > the number of modified lines and not add more #ifdef. We could also move > the declaration of the 'mod' variable inside the if-statement or > directly use site_mod->mod. > > Fixes: 698bacefe993 ("static_call: Align static_call_is_init() patching condition") > Signed-off-by: Matthieu Baerts > --- > > Notes: > Feel free to modify this patch directly if you prefer. I can of course > send a new version if needed. Ah, I had indeed meant to take a look at this, but hadn't come around to it. I think this is as nice a solution as there is, so let me go apply this. > kernel/static_call.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/kernel/static_call.c b/kernel/static_call.c > index 2c5950b0b90e..723fcc9d20db 100644 > --- a/kernel/static_call.c > +++ b/kernel/static_call.c > @@ -165,13 +165,13 @@ void __static_call_update(struct static_call_key *key, void *tramp, void *func) > > stop = __stop_static_call_sites; > > -#ifdef CONFIG_MODULES > if (mod) { > +#ifdef CONFIG_MODULES > stop = mod->static_call_sites + > mod->num_static_call_sites; > init = mod->state == MODULE_STATE_COMING; > - } > #endif > + } >