Skip to content

Commit

Permalink
net/core: Remove unused assignment operations and variable
Browse files Browse the repository at this point in the history
Although if_info_size is assigned, it has not been used. And the variable
should also be deleted.

The clang_analyzer complains as follows:

net/core/rtnetlink.c:3806: warning:

Although the value stored to 'if_info_size' is used in the enclosing
expression, the value is never actually read from 'if_info_size'.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: luo penghao <luo.penghao@zte.com.cn>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
luo penghao authored and David S. Miller committed Oct 21, 2021
1 parent c5c6e58 commit 50af596
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions net/core/rtnetlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -3804,9 +3804,8 @@ struct sk_buff *rtmsg_ifinfo_build_skb(int type, struct net_device *dev,
struct net *net = dev_net(dev);
struct sk_buff *skb;
int err = -ENOBUFS;
size_t if_info_size;

skb = nlmsg_new((if_info_size = if_nlmsg_size(dev, 0)), flags);
skb = nlmsg_new(if_nlmsg_size(dev, 0), flags);
if (skb == NULL)
goto errout;

Expand Down

0 comments on commit 50af596

Please sign in to comment.