* [PATCH iproute2] remove unnecessary cast of RTA_DATA()
@ 2026-11-28 18:27 Stephen Hemminger
2026-11-30 18:20 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Stephen Hemminger @ 2026-11-28 18:27 UTC (permalink / raw)
To: netdev; +Cc: dsahern, Stephen Hemminger
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH iproute2] remove unnecessary cast of RTA_DATA()
2026-11-28 18:27 [PATCH iproute2] remove unnecessary cast of RTA_DATA() Stephen Hemminger
@ 2026-11-30 18:20 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-11-30 18:20 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev, dsahern
Hello:
This patch was applied to iproute2/iproute2.git (main)
by Stephen Hemminger <stephen@networkplumber.org>:
On Sat, 28 Nov 2026 10:27:19 -0800 you wrote:
> 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(-)
Here is the summary with links:
- [iproute2] remove unnecessary cast of RTA_DATA()
https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=65af26828fc5
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-30 18:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-28 18:27 [PATCH iproute2] remove unnecessary cast of RTA_DATA() Stephen Hemminger
2026-11-30 18:20 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox