From: Stephen Hemminger <stephen@networkplumber.org>
To: netdev@vger.kernel.org
Cc: dsahern@kernel.org, Stephen Hemminger <stephen@networkplumber.org>
Subject: [PATCH iproute2] remove unnecessary cast of RTA_DATA()
Date: Sat, 28 Nov 2026 10:27:19 -0800 [thread overview]
Message-ID: <20261128182719.1476909-1-stephen@networkplumber.org> (raw)
The macro RTA_DATA results in a void * pointer so the cast
is unnecessary. No change in resulting code.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
include/libnetlink.h | 2 +-
ip/xfrm_policy.c | 2 +-
ip/xfrm_state.c | 2 +-
tc/m_ematch.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/libnetlink.h b/include/libnetlink.h
index 518b8714..e1d93119 100644
--- a/include/libnetlink.h
+++ b/include/libnetlink.h
@@ -373,7 +373,7 @@ int rtnl_from_file(FILE *, rtnl_listen_filter_t handler,
#define NLMSG_TSTAMP 15
#define rtattr_for_each_nested(attr, nest) \
- for ((attr) = (void *)RTA_DATA(nest); \
+ for ((attr) = RTA_DATA(nest); \
RTA_OK(attr, RTA_PAYLOAD(nest) - ((char *)(attr) - (char *)RTA_DATA((nest)))); \
(attr) = RTA_TAIL((attr)))
diff --git a/ip/xfrm_policy.c b/ip/xfrm_policy.c
index 5261a292..d36078b4 100644
--- a/ip/xfrm_policy.c
+++ b/ip/xfrm_policy.c
@@ -783,7 +783,7 @@ static int xfrm_policy_keep(struct nlmsghdr *n, void *arg)
if (tb[XFRMA_MARK]) {
int r = addattr_l(new_n, xb->size, XFRMA_MARK,
- (void *)RTA_DATA(tb[XFRMA_MARK]), tb[XFRMA_MARK]->rta_len);
+ RTA_DATA(tb[XFRMA_MARK]), tb[XFRMA_MARK]->rta_len);
if (r < 0) {
fprintf(stderr, "%s: XFRMA_MARK failed\n", __func__);
exit(1);
diff --git a/ip/xfrm_state.c b/ip/xfrm_state.c
index dcd08d59..242ebfec 100644
--- a/ip/xfrm_state.c
+++ b/ip/xfrm_state.c
@@ -1203,7 +1203,7 @@ static int xfrm_state_keep(struct nlmsghdr *n, void *arg)
if (tb[XFRMA_MARK]) {
int r = addattr_l(new_n, xb->size, XFRMA_MARK,
- (void *)RTA_DATA(tb[XFRMA_MARK]), tb[XFRMA_MARK]->rta_len);
+ RTA_DATA(tb[XFRMA_MARK]), tb[XFRMA_MARK]->rta_len);
if (r < 0) {
fprintf(stderr, "%s: XFRMA_MARK failed\n", __func__);
exit(1);
diff --git a/tc/m_ematch.c b/tc/m_ematch.c
index fefc7860..0e55f41a 100644
--- a/tc/m_ematch.c
+++ b/tc/m_ematch.c
@@ -403,7 +403,7 @@ static int print_ematch_seq(FILE *fd, struct rtattr **tb, int start,
return -1;
dlen = RTA_PAYLOAD(tb[i]) - sizeof(*hdr);
- data = (void *) RTA_DATA(tb[i]) + sizeof(*hdr);
+ data = RTA_DATA(tb[i]) + sizeof(*hdr);
if (dlen < 0)
return -1;
--
2.53.0
reply other threads:[~2026-11-28 18:27 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261128182719.1476909-1-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=dsahern@kernel.org \
--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