support: mark unused arguments in netlink handlers with UNUSED()
Subsystems (2)
Jeff Layton
maintainerPATCH 1/1 support: mark unused arguments in netlink handlers with UNUSED()
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.
---
Just some fixes for some new warnings I saw crop up recently.
--- support/nfs/nfsdnl.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
support/nfs/nfsdnl.c +4 -3
@@ -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,
Signature · 1 line
Jeff Layton <[email protected]>
Quoted 7 lines · Jeff Layton
Use the project's
UNUSED()macro fromnfslib.hto suppress -Wunused-parameter warnings on theerror_handler,finish_handler, andack_handlercallback 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 <[email protected]>
Committed... (tag: nfs-utils-2-9-2-rc4)
steved
Quoted 50 lines
---
Just some fixes for some new warnings I saw crop up recently.--- support/nfs/nfsdnl.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)support/nfs/nfsdnl.c +4
-4@@ -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-2d98ed62dfaeBest regards,