Linux NFS development
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: Steve Dickson <steved@redhat.com>
Cc: Chuck Lever <chuck.lever@oracle.com>,
	linux-nfs@vger.kernel.org,  Jeff Layton <jlayton@kernel.org>
Subject: [PATCH] support: mark unused arguments in netlink handlers with UNUSED()
Date: Mon, 25 May 2026 08:34:29 -0400	[thread overview]
Message-ID: <20260525-fixes-v1-1-b4247bf20c91@kernel.org> (raw)

Use the project's UNUSED() macro from nfslib.h to suppress
-Wunused-parameter warnings on the error_handler, finish_handler,
and ack_handler callback parameters that are required by the
libnl callback signatures but not referenced in the function bodies.

Fixes: 3ddc8e81240f ("exportfs: release NFSv4 state when last client is unexported")
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
Just some fixes for some new warnings I saw crop up recently.
---
 support/nfs/nfsdnl.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/support/nfs/nfsdnl.c b/support/nfs/nfsdnl.c
index ece0b57afd4b..ded035b90b1f 100644
--- a/support/nfs/nfsdnl.c
+++ b/support/nfs/nfsdnl.c
@@ -16,6 +16,7 @@
 #include <netlink/msg.h>
 #include <netlink/attr.h>
 
+#include "nfslib.h"
 #include "xlog.h"
 #include "nfsdnl.h"
 
@@ -27,7 +28,7 @@
 
 #define NFSDNL_BUFSIZE	(4096)
 
-static int error_handler(struct sockaddr_nl *nla, struct nlmsgerr *err,
+static int error_handler(struct sockaddr_nl *UNUSED(nla), struct nlmsgerr *err,
 			 void *arg)
 {
 	int *ret = arg;
@@ -35,14 +36,14 @@ static int error_handler(struct sockaddr_nl *nla, struct nlmsgerr *err,
 	return NL_STOP;
 }
 
-static int finish_handler(struct nl_msg *msg, void *arg)
+static int finish_handler(struct nl_msg *UNUSED(msg), void *arg)
 {
 	int *ret = arg;
 	*ret = 0;
 	return NL_SKIP;
 }
 
-static int ack_handler(struct nl_msg *msg __attribute__((unused)),
+static int ack_handler(struct nl_msg *UNUSED(msg),
 		       void *arg)
 {
 	int *ret = arg;

---
base-commit: a806c9d65662ecf5d40c00d60a514e13ada8d76e
change-id: 20260525-fixes-2d98ed62dfae

Best regards,
-- 
Jeff Layton <jlayton@kernel.org>


             reply	other threads:[~2026-05-25 12:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-25 12:34 Jeff Layton [this message]
2026-05-30 21:06 ` [PATCH] support: mark unused arguments in netlink handlers with UNUSED() Steve Dickson

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=20260525-fixes-v1-1-b4247bf20c91@kernel.org \
    --to=jlayton@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=steved@redhat.com \
    /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