diff options
author | luo penghao <cgel.zte@gmail.com> | 2021-10-21 09:40:20 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-10-21 14:48:59 +0300 |
commit | 50af5969bb22bb8ea757f87934c2478715afa854 (patch) | |
tree | 761f361e0da920520a20e83a83063c9fd709bc26 /net | |
parent | c5c6e589a8c811c7f20024cc22209ae984fc2b98 (diff) | |
download | linux-50af5969bb22bb8ea757f87934c2478715afa854.tar.xz |
net/core: Remove unused assignment operations and variable
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>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/rtnetlink.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 564d24c451af..79477dcae7c2 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -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; |