bridge: Use PTR_ERR_OR_ZERO instead if(IS_ERR(...)) + PTR_ERR
Subsystems (2)
PATCH 1/1 bridge: Use PTR_ERR_OR_ZERO instead if(IS_ERR(...)) + PTR_ERR
coccicheck suggested using PTR_ERR_OR_ZERO() and looking at the code.
Fix the following coccicheck warnings:
./net/bridge/br_multicast.c:1295:7-13: WARNING: PTR_ERR_OR_ZERO can be used.
Reported-by Abaci <[email protected]>
Signed-off-by Jiapeng Zhong <[email protected]>
--- net/bridge/br_multicast.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/bridge/br_multicast.c +1 -1
@@ -1292,7 +1292,7 @@ static int br_multicast_add_group(struct net_bridge *br, pg =__br_multicast_add_group (br, port, group, src, filter_mode, igmpv2_mldv1, false);/* NULL is considered valid for host joined groups */ - err =IS_ERR (pg) ?PTR_ERR (pg) :0 ; + err =PTR_ERR_OR_ZERO (pg);spin_unlock (&br->multicast_lock);return err;
Signature · 1 line
1.8.3.1
Jakub Kicinski
maintainerQuoted 9 lines · On Fri, 22 Jan 2021 17:32:13 +0800 Jiapeng Zhong wrote:
coccicheck suggested using
PTR_ERR_OR_ZERO()and looking at the code.Fix the following coccicheck warnings:
./net/bridge/br_multicast.c:1295:7-13: WARNING:
PTR_ERR_OR_ZEROcan be used.Reported-by Abaci <[email protected]>Signed-off-by Jiapeng Zhong <[email protected]>
You need to CC netdev