* [PATCH] support: mark unused arguments in netlink handlers with UNUSED()
@ 2026-05-25 12:34 Jeff Layton
2026-05-30 21:06 ` Steve Dickson
0 siblings, 1 reply; 2+ messages in thread
From: Jeff Layton @ 2026-05-25 12:34 UTC (permalink / raw)
To: Steve Dickson; +Cc: Chuck Lever, linux-nfs, Jeff Layton
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>
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] support: mark unused arguments in netlink handlers with UNUSED()
2026-05-25 12:34 [PATCH] support: mark unused arguments in netlink handlers with UNUSED() Jeff Layton
@ 2026-05-30 21:06 ` Steve Dickson
0 siblings, 0 replies; 2+ messages in thread
From: Steve Dickson @ 2026-05-30 21:06 UTC (permalink / raw)
To: Jeff Layton; +Cc: Chuck Lever, linux-nfs
On 5/25/26 8:34 AM, Jeff Layton wrote:
> 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>
Committed... (tag: nfs-utils-2-9-2-rc4)
steved
> ---
> 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,
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-05-30 21:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-25 12:34 [PATCH] support: mark unused arguments in netlink handlers with UNUSED() Jeff Layton
2026-05-30 21:06 ` Steve Dickson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.