From: Michal Kubecek <mkubecek@suse.cz>
To: netdev@vger.kernel.org
Subject: [PATCH ethtool 2/7] cable_test: clean up unused parameters
Date: Mon, 3 Aug 2020 13:57:09 +0200 (CEST) [thread overview]
Message-ID: <4e6a60bf95b819912eb08cb13276791d8ec9feac.1596451857.git.mkubecek@suse.cz> (raw)
In-Reply-To: <cover.1596451857.git.mkubecek@suse.cz>
Functions nl_cable_test_ntf_attr() and nl_cable_test_tdr_ntf_attr() do not
use nlctx parameter and as they are not callbacks with fixed signature, we
can simply drop it. Once we do, the same is true for cable_test_ntf_nest()
and cable_test_tdr_ntf_nest().
Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
---
netlink/cable_test.c | 21 ++++++++-------------
1 file changed, 8 insertions(+), 13 deletions(-)
diff --git a/netlink/cable_test.c b/netlink/cable_test.c
index c2b9c97d1239..d39b7d82efb0 100644
--- a/netlink/cable_test.c
+++ b/netlink/cable_test.c
@@ -88,8 +88,7 @@ static char *nl_pair2txt(uint8_t pair)
}
}
-static int nl_cable_test_ntf_attr(struct nlattr *evattr,
- struct nl_context *nlctx)
+static int nl_cable_test_ntf_attr(struct nlattr *evattr)
{
unsigned int cm;
uint16_t code;
@@ -122,14 +121,13 @@ static int nl_cable_test_ntf_attr(struct nlattr *evattr,
return 0;
}
-static void cable_test_ntf_nest(const struct nlattr *nest,
- struct nl_context *nlctx)
+static void cable_test_ntf_nest(const struct nlattr *nest)
{
struct nlattr *pos;
int ret;
mnl_attr_for_each_nested(pos, nest) {
- ret = nl_cable_test_ntf_attr(pos, nlctx);
+ ret = nl_cable_test_ntf_attr(pos);
if (ret < 0)
return;
}
@@ -180,7 +178,7 @@ static int cable_test_ntf_stop_cb(const struct nlmsghdr *nlhdr, void *data)
}
if (tb[ETHTOOL_A_CABLE_TEST_NTF_NEST])
- cable_test_ntf_nest(tb[ETHTOOL_A_CABLE_TEST_NTF_NEST], nlctx);
+ cable_test_ntf_nest(tb[ETHTOOL_A_CABLE_TEST_NTF_NEST]);
if (status == ETHTOOL_A_CABLE_TEST_NTF_STATUS_COMPLETED) {
if (ctctx)
@@ -339,8 +337,7 @@ static int nl_get_cable_test_tdr_step(const struct nlattr *nest,
return 0;
}
-static int nl_cable_test_tdr_ntf_attr(struct nlattr *evattr,
- struct nl_context *nlctx)
+static int nl_cable_test_tdr_ntf_attr(struct nlattr *evattr)
{
uint32_t first, last, step;
uint8_t pair;
@@ -391,14 +388,13 @@ static int nl_cable_test_tdr_ntf_attr(struct nlattr *evattr,
return 0;
}
-static void cable_test_tdr_ntf_nest(const struct nlattr *nest,
- struct nl_context *nlctx)
+static void cable_test_tdr_ntf_nest(const struct nlattr *nest)
{
struct nlattr *pos;
int ret;
mnl_attr_for_each_nested(pos, nest) {
- ret = nl_cable_test_tdr_ntf_attr(pos, nlctx);
+ ret = nl_cable_test_tdr_ntf_attr(pos);
if (ret < 0)
return;
}
@@ -450,8 +446,7 @@ int cable_test_tdr_ntf_stop_cb(const struct nlmsghdr *nlhdr, void *data)
}
if (tb[ETHTOOL_A_CABLE_TEST_TDR_NTF_NEST])
- cable_test_tdr_ntf_nest(tb[ETHTOOL_A_CABLE_TEST_TDR_NTF_NEST],
- nlctx);
+ cable_test_tdr_ntf_nest(tb[ETHTOOL_A_CABLE_TEST_TDR_NTF_NEST]);
if (status == ETHTOOL_A_CABLE_TEST_NTF_STATUS_COMPLETED) {
if (ctctx)
--
2.28.0
next prev parent reply other threads:[~2020-08-03 11:57 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-03 11:57 [PATCH ethtool 0/7] compiler warnings cleanup, part 1 Michal Kubecek
2020-08-03 11:57 ` [PATCH ethtool 1/7] rename maybe_unused macro to __maybe_unused Michal Kubecek
2020-08-03 11:57 ` Michal Kubecek [this message]
2020-08-03 23:59 ` [PATCH ethtool 2/7] cable_test: clean up unused parameters Andrew Lunn
2020-08-03 11:57 ` [PATCH ethtool 3/7] igc: mark unused callback parameter Michal Kubecek
2020-08-03 11:57 ` [PATCH ethtool 4/7] netlink: " Michal Kubecek
2020-08-03 11:57 ` [PATCH ethtool 5/7] netlink: mark unused parameters of bitset walker callbacks Michal Kubecek
2020-08-03 11:57 ` [PATCH ethtool 6/7] netlink: mark unused parameters of parser callbacks Michal Kubecek
2020-08-03 11:57 ` [PATCH ethtool 7/7] ioctl: avoid zero length array warning in get_stringset() Michal Kubecek
2020-08-03 13:31 ` [PATCH ethtool 0/7] compiler warnings cleanup, part 1 Andrew Lunn
2020-08-03 13:53 ` Michal Kubecek
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=4e6a60bf95b819912eb08cb13276791d8ec9feac.1596451857.git.mkubecek@suse.cz \
--to=mkubecek@suse.cz \
--cc=netdev@vger.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;
as well as URLs for NNTP newsgroup(s).