Skip to contentSkip to conversation

inet: Eliminate dead store in 'iproute_default_modify'.

PATCH In review Grant Erickson 2 participants 2 messages Dec 15, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 inet: Eliminate dead store in 'iproute_default_modify'.

In 'iproute_default_modify' there is a dead store to 'rth.req.u.r.rt.rtm_scope' with 'RT_SCOPE_NOWHERE' only to be overwritten two lines later with 'RT_SCOPE_UNIVERSE' without an intervening read.

This eliminates the dead store of 'RT_SCOPE_NOWHERE'.

---
 src/inet.c | 1 -
 1 file changed, 1 deletion(-)
src/inet.c +0 -1
index 2abd55ef75e9..371b3328175f 100644
@@ -4547,7 +4547,6 @@ static int iproute_default_modify(int cmd, uint32_t table_id, uint32_t metric,
 	rth.req.n.nlmsg_type = cmd;
 	rth.req.u.r.rt.rtm_family = family;
 	rth.req.u.r.rt.rtm_table = RT_TABLE_MAIN;
-	rth.req.u.r.rt.rtm_scope = RT_SCOPE_NOWHERE;
 	rth.req.u.r.rt.rtm_protocol = RTPROT_BOOT;
 	rth.req.u.r.rt.rtm_scope = RT_SCOPE_UNIVERSE;
 	rth.req.u.r.rt.rtm_type = RTN_UNICAST;
Signature · 1 line
2.42.0
#1 lore raw

Hi Grant,

Quoted 9 lines

In 'iproute_default_modify' there is a dead store to 'rth.req.u.r.rt.rtm_scope' with 'RT_SCOPE_NOWHERE' only to be overwritten two lines later with 'RT_SCOPE_UNIVERSE' without an intervening read.

This eliminates the dead store of 'RT_SCOPE_NOWHERE'.
---
src/inet.c | 1 -

1 file changed, 1 deletion(-)

patch has been applied.

Regards

Marcel