[PATCH 23/61] net/ipv6: Prefer IS_ERR_OR_NULL over manual NULL check
Philipp Hahn <[email protected]>
| Newsgroups | gmane.linux.ports.sh.devel,gmane.comp.freedesktop.amd-gfx,gmane.comp.security.apparmor,gmane.linux.kernel.bpf,gmane.comp.file-systems.ceph.devel,gmane.comp.video.dri.devel,gmane.comp.freedesktop.xorg.drivers.intel,gmane.comp.emulators.kvm.devel,gmane.linux.ports.arm.kernel,gmane.linux.block,gmane.linux.bluez.kernel,gmane.comp.file-systems.btrfs,gmane.linux.kernel.cifs,gmane.linux.kernel.clk,gmane.comp.file-systems.ext4,gmane.linux.file-systems,gmane.linux.kernel.gpio,gmane.linux.kernel.input,gmane.linux.kernel,gmane.linux.leds,gmane.linux.drivers.video-input-infrastructure,gmane.linux.ports.mips,gmane.linux.kernel.mm,gmane.linux.kernel.modules,gmane.linux.drivers.mtd,gmane.linux.nfs,gmane.linux.ports.arm.omap |
|---|---|
| Message-ID | <[email protected]> |
Prefer using IS_ERR_OR_NULL() over using IS_ERR() and a manual NULL check. Change generated with coccinelle. To: "David S. Miller" <[email protected]> To: David Ahern <[email protected]> To: Eric Dumazet <[email protected]> To: Jakub Kicinski <[email protected]> To: Paolo Abeni <[email protected]> To: Simon Horman <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Philipp Hahn <[email protected]> --- net/ipv6/ila/ila_xlat.c | 2 +- net/ipv6/ndisc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/ipv6/ila/ila_xlat.c b/net/ipv6/ila/ila_xlat.c index 8991805fc3d60cfd2499146e522da142f33ddc50..c5e3954488ab7a1b1c07aff86385f5000945f1e4 100644 --- a/net/ipv6/ila/ila_xlat.c +++ b/net/ipv6/ila/ila_xlat.c @@ -545,7 +545,7 @@ int ila_xlat_nl_dump(struct sk_buff *skb, struct netlink_callback *cb) /* Get first entry */ ila = rhashtable_walk_peek(rhiter); - if (ila && !IS_ERR(ila) && skip) { + if (!IS_ERR_OR_NULL(ila) && skip) { /* Skip over visited entries */ while (ila && skip) { diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index f6a5d8c73af9721741c11b543e5abeecdbf2079f..ab340f2489c0c7555f48c1f3f5215cb1d0b5b341 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c @@ -1083,7 +1083,7 @@ static enum skb_drop_reason ndisc_recv_na(struct sk_buff *skb) } } - if (neigh && !IS_ERR(neigh)) { + if (!IS_ERR_OR_NULL(neigh)) { u8 old_flags = neigh->flags; struct net *net = dev_net(dev); -- 2.43.0