Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp700429rdg; Wed, 11 Oct 2023 03:09:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHIGzos++xai1mqeYuqUgvgXjjSk0aZ4J1YblygT/LCBdJgP6iYTRT2IW2KCAFFQjA74LXD X-Received: by 2002:a05:6a00:1d89:b0:68f:c6f8:144a with SMTP id z9-20020a056a001d8900b0068fc6f8144amr17359618pfw.22.1697018943001; Wed, 11 Oct 2023 03:09:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697018942; cv=none; d=google.com; s=arc-20160816; b=sI7corjWoqQ7F3rAN6499WW6v+ZPxTxIUAOsiQTD0yVFf5ZBcRXl+B2ynMtxVXJ9zK Cv0FV+vvHm2VW5VrMYJoZMo7LAtJxw9cN8bM3GZJDgYJJ904Vdk6lZ4XjbMCCZGl+QH6 sULvsVioOouWl5LdwQ9RwEqxWTR0ctAk2iYoDqAC2CTEL0a4juj3dPkJzc3JXOYS4xoY 326vIkCPNKfZCATZOxrx1+TwPYcA3TSDAluQjLDIv++A9bJP6oANl34yPCULYSOi8hNf 12C+rF/IMGAVTC6w/u2ppeKvzETxAKS6TgGp2oiCiIz98l7mlMrfXe59Q8KtH3uaZfo4 OnqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=XIrdhrOkAFNQI63zVxXswH6OFQld1YgqT2TgZehecyQ=; fh=UQBNt8qzbI9LUMF9Fa69yl3jp8HHO1Oy26uQBA7jD1M=; b=rRn4XONw9SK0wB5+LGcNXGRjnAnNrLupqg0UZOES1qNzT+eCEKeJc6TQECftOdN9xF znPOaXdvFrW+9UmkgIxxlsXGHRZwpTNtK9SXcHEZOKPdAIMp7cK6yMS/uT7HmQOVOiT9 v1vPA+3djifFiOli7Yn8/gLTCYT01OFXZUMy5qY3IvXJGf97OyfMVz+GoK8jfWnt+SOn fqHmSqRuahrydqv9wtBIn2SktF5MARw1jlaujhxzlGmTdDnUMEszsLSIg2ZR7IZAHaNV VMB694i5LsenziEUWnDcIbthDdtpiXUwd1kKlTbRGCxYuZumlLQtxZPGa/bbI5Rl7abu JaCQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id k184-20020a6384c1000000b005697ebac19esi13283398pgd.776.2023.10.11.03.09.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 03:09:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id BB10480215AD; Wed, 11 Oct 2023 03:08:55 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234812AbjJKKIs (ORCPT + 99 others); Wed, 11 Oct 2023 06:08:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346078AbjJKKId (ORCPT ); Wed, 11 Oct 2023 06:08:33 -0400 Received: from xavier.telenet-ops.be (xavier.telenet-ops.be [IPv6:2a02:1800:120:4::f00:14]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5283171B for ; Wed, 11 Oct 2023 03:07:25 -0700 (PDT) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed40:b72e:818:7fe2:593d]) by xavier.telenet-ops.be with bizsmtp id wa7L2A00W56sUls01a7LSi; Wed, 11 Oct 2023 12:07:22 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1qqW7a-00648i-RP; Wed, 11 Oct 2023 12:07:20 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1qqW7c-00HQrM-DG; Wed, 11 Oct 2023 12:07:20 +0200 From: Geert Uytterhoeven To: Chuck Lever , Jeff Layton , Neil Brown , Olga Kornievskaia , Dai Ngo , Tom Talpey , Trond Myklebust , Anna Schumaker Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH] sunrpc: Use no_printk() in dfprintk*() dummies Date: Wed, 11 Oct 2023 12:07:19 +0200 Message-Id: <707e5e6dd0db9a663cf443564d1f8ee1c10a0086.1697018818.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 11 Oct 2023 03:08:56 -0700 (PDT) X-Spam-Level: ** When building NFS with W=1 and CONFIG_WERROR=y, but CONFIG_SUNRPC_DEBUG=n: fs/nfs/nfs4proc.c: In function ‘nfs4_proc_create_session’: fs/nfs/nfs4proc.c:9276:19: error: variable ‘ptr’ set but not used [-Werror=unused-but-set-variable] 9276 | unsigned *ptr; | ^~~ CC fs/nfs/callback.o fs/nfs/callback.c: In function ‘nfs41_callback_svc’: fs/nfs/callback.c:98:13: error: variable ‘error’ set but not used [-Werror=unused-but-set-variable] 98 | int error; | ^~~~~ CC fs/nfs/flexfilelayout/flexfilelayout.o fs/nfs/flexfilelayout/flexfilelayout.c: In function ‘ff_layout_io_track_ds_error’: fs/nfs/flexfilelayout/flexfilelayout.c:1230:13: error: variable ‘err’ set but not used [-Werror=unused-but-set-variable] 1230 | int err; | ^~~ CC fs/nfs/flexfilelayout/flexfilelayoutdev.o fs/nfs/flexfilelayout/flexfilelayoutdev.c: In function ‘nfs4_ff_alloc_deviceid_node’: fs/nfs/flexfilelayout/flexfilelayoutdev.c:55:16: error: variable ‘ret’ set but not used [-Werror=unused-but-set-variable] 55 | int i, ret = -ENOMEM; | ^~~ All these are due to variables that are set uncontionally, but are used only when debugging is enabled. Fix this by changing the dfprintk*() dummy macros from empty loops to calls to the no_printk() helper. This informs the compiler that the passed debug parameters are actually used, and enables format specifier checking as a bonus. Signed-off-by: Geert Uytterhoeven --- include/linux/sunrpc/debug.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/sunrpc/debug.h b/include/linux/sunrpc/debug.h index f6aeed07fe04e3d5..76539c6673f2fb15 100644 --- a/include/linux/sunrpc/debug.h +++ b/include/linux/sunrpc/debug.h @@ -67,9 +67,9 @@ do { \ # define RPC_IFDEBUG(x) x #else # define ifdebug(fac) if (0) -# define dfprintk(fac, fmt, ...) do {} while (0) -# define dfprintk_cont(fac, fmt, ...) do {} while (0) -# define dfprintk_rcu(fac, fmt, ...) do {} while (0) +# define dfprintk(fac, fmt, ...) no_printk(fmt, ##__VA_ARGS__) +# define dfprintk_cont(fac, fmt, ...) no_printk(fmt, ##__VA_ARGS__) +# define dfprintk_rcu(fac, fmt, ...) no_printk(fmt, ##__VA_ARGS__) # define RPC_IFDEBUG(x) #endif -- 2.34.1