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 3/3] NFS: nfs4proc: Mark ptr as __maybe_unused in nfs4_proc_create_session
Date: Fri, 27 Feb 2026 16:18:22 +0800 [thread overview]
Message-ID: <20260227-nfs-v1-3-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:
nfs4proc.c: In function 'nfs4_proc_create_session':
nfs4proc.c:9244:16: error: variable 'ptr' set but
not used [-Werror=unused-but-set-variable]
9244 | unsigned *ptr;
| ^~~
The variable 'ptr' is assigned but only used in dprintk() debug statements.
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/nfs4proc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 91bcf67bd743f72a008a9dcde29207bf7a36c407..64e0221c39423dae58a30018a28d874198de57aa 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -9241,7 +9241,7 @@ static int _nfs4_proc_create_session(struct nfs_client *clp,
int nfs4_proc_create_session(struct nfs_client *clp, const struct cred *cred)
{
int status;
- unsigned *ptr;
+ unsigned *ptr __maybe_unused;
struct nfs4_session *session = clp->cl_session;
struct nfs4_add_xprt_data xprtdata = {
.clp = clp,
--
2.37.1
prev 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 ` [PATCH 2/3] NFS: flexfilelayout: Mark err as __maybe_unused in ff_layout_io_track_ds_error Peng Fan (OSS)
2026-02-27 8:18 ` Peng Fan (OSS) [this message]
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-3-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