From nobody Fri Jan 2 13:47:16 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6A796CD6E54 for ; Wed, 11 Oct 2023 10:18:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234681AbjJKKSi (ORCPT ); Wed, 11 Oct 2023 06:18:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345939AbjJKKSK (ORCPT ); Wed, 11 Oct 2023 06:18:10 -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 C2834129 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: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When building NFS with W=3D1 and CONFIG_WERROR=3Dy, but CONFIG_SUNRPC_DEBUG=3Dn: fs/nfs/nfs4proc.c: In function =E2=80=98nfs4_proc_create_session=E2=80= =99: fs/nfs/nfs4proc.c:9276:19: error: variable =E2=80=98ptr=E2=80=99 set bu= t not used [-Werror=3Dunused-but-set-variable] 9276 | unsigned *ptr; | ^~~ CC fs/nfs/callback.o fs/nfs/callback.c: In function =E2=80=98nfs41_callback_svc=E2=80=99: fs/nfs/callback.c:98:13: error: variable =E2=80=98error=E2=80=99 set bu= t not used [-Werror=3Dunused-but-set-variable] 98 | int error; | ^~~~~ CC fs/nfs/flexfilelayout/flexfilelayout.o fs/nfs/flexfilelayout/flexfilelayout.c: In function =E2=80=98ff_layout_= io_track_ds_error=E2=80=99: fs/nfs/flexfilelayout/flexfilelayout.c:1230:13: error: variable =E2=80= =98err=E2=80=99 set but not used [-Werror=3Dunused-but-set-variable] 1230 | int err; | ^~~ CC fs/nfs/flexfilelayout/flexfilelayoutdev.o fs/nfs/flexfilelayout/flexfilelayoutdev.c: In function =E2=80=98nfs4_ff= _alloc_deviceid_node=E2=80=99: fs/nfs/flexfilelayout/flexfilelayoutdev.c:55:16: error: variable =E2=80= =98ret=E2=80=99 set but not used [-Werror=3Dunused-but-set-variable] 55 | int i, ret =3D -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 =20 --=20 2.34.1