public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>
To: Trond Myklebust <trondmy@kernel.org>, Anna Schumaker <anna@kernel.org>
Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org,
	 Peng Fan <peng.fan@nxp.com>
Subject: [PATCH 2/3] NFS: flexfilelayout: Mark err as __maybe_unused in ff_layout_io_track_ds_error
Date: Fri, 27 Feb 2026 16:18:21 +0800	[thread overview]
Message-ID: <20260227-nfs-v1-2-2a6ea2ca8528@nxp.com> (raw)
In-Reply-To: <20260227-nfs-v1-0-2a6ea2ca8528@nxp.com>

From: Peng Fan <peng.fan@nxp.com>

Fix the following compiler warning when building with W=1:

  flexfilelayout.c: In function 'ff_layout_io_track_ds_error':
  flexfilelayout.c:1503:6:
  error: variable 'err' set but not used [-Werror=unused-but-set-variable]
   1503 |  int err;
        |      ^~~

Variable 'err' is assigned the return value of ff_layout_track_ds_error()
but is only used in the dprintk() debug statement at the end of the
function. When debug output is disabled, the variable appears unused to
the compiler.

Mark it as __maybe_unused to indicate this is intentional.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 fs/nfs/flexfilelayout/flexfilelayout.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c
index cd175204807600ff4e33ff769e03ef7ac700a6dc..1d8099337652a1cdbcaf58d394a6e981e8e7e413 100644
--- a/fs/nfs/flexfilelayout/flexfilelayout.c
+++ b/fs/nfs/flexfilelayout/flexfilelayout.c
@@ -1500,7 +1500,7 @@ static void ff_layout_io_track_ds_error(struct pnfs_layout_segment *lseg,
 {
 	struct nfs4_ff_layout_mirror *mirror;
 	u32 status = *op_status;
-	int err;
+	int err __maybe_unused;
 
 	if (status == 0) {
 		switch (error) {

-- 
2.37.1


  parent reply	other threads:[~2026-02-27  8:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-27  8:18 [PATCH 0/3] NFS: Address build error when built with W=1 Peng Fan (OSS)
2026-02-27  8:18 ` [PATCH 1/3] NFS: flexfilelayout: return ERR_PTR from nfs4_ff_alloc_deviceid_node() and fix caller Peng Fan (OSS)
2026-02-27  8:18 ` Peng Fan (OSS) [this message]
2026-02-27  8:18 ` [PATCH 3/3] NFS: nfs4proc: Mark ptr as __maybe_unused in nfs4_proc_create_session Peng Fan (OSS)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260227-nfs-v1-2-2a6ea2ca8528@nxp.com \
    --to=peng.fan@oss.nxp.com \
    --cc=anna@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=peng.fan@nxp.com \
    --cc=trondmy@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox