From patchwork Wed Oct 11 10:07:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 151254 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp429804vqb; Wed, 11 Oct 2023 03:18:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGktkkaOE9DIwOt7z4HPHKlCJIHrwSEkGCbUSdRc6GkHuA0e52x7AH4GbIxZjp1qL+faSds X-Received: by 2002:a05:6a20:8f01:b0:163:d382:ba99 with SMTP id b1-20020a056a208f0100b00163d382ba99mr25159492pzk.5.1697019524203; Wed, 11 Oct 2023 03:18:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697019524; cv=none; d=google.com; s=arc-20160816; b=O+YmQvSSOZa/SoPGcDxzRGSRRNi2F/BvSR4MiO7IEAjbDhkKjvbWpc6lRxOtfubqe7 +CPATG/lIuZxob/JcQR0q1IWmSinyA0OYgUzD7E7Wq8GN/YWRw+UoU+5niMLQcQf8gSY aCvjC1oyKaK6WTN/OxkOwUz9vpkju1qm7vsJv7gdtQluuiTedqEg6GhgO898+JqF3Q89 SbUjDEdltVdxyoJ56Q4oTIjrbJx42Iu3bLnt3S9nfHkBW58hooW2FidCPs47ushMVLiU 3E313dFisKhJBGZ7X9EX5jJZCLdu8yGvQf/h3akbMH/VaH1tn+pmPLEPvmEnIyr3N2vh Q+fw== 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=qDf9YsrXhzjAk8gK2retiifEQCIe3Z22ksHTbZJQE79N5lMZLCytI4VNZ5EqLsyven hiyLdMW0evM8j4swFRBTXLUh+rVC8A171od9jxlNq5tlvPuyyDOZtDkBlNrfCs1haQ3K Ggz9kLqk79Bcx5vU8I/hurEVF/hmkK7QX/JDvH7aeUMnTaYyi96c0/8FcLYQhvkrPTwr UNKUQJZ6bJ+34PrZFTZRR3fhg1kjFsSl6YzgTOLPhYUygzVXj6Ipmr14523gUqWlbipS 6oq65P5FiS4W4VuRyyNEah7cSJtw104M6WN5qRqLmo7hhr4MTmovUhU8DmUOTTciZa0I rsBw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id f18-20020a17090ace1200b00278ea235413si16188446pju.31.2023.10.11.03.18.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 03:18:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 64A9281B8015; Wed, 11 Oct 2023 03:18:43 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346289AbjJKKSh (ORCPT + 18 others); Wed, 11 Oct 2023 06:18:37 -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 X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE, SPF_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 11 Oct 2023 03:18:43 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779453944714501655 X-GMAIL-MSGID: 1779453944714501655 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