From: Hongbo Li Date: Wed, 28 Aug 2024 12:23:36 +0000 (+0800) Subject: net: hns: Use IS_ERR_OR_NULL() helper function X-Git-Tag: v6.12-rc1~232^2~147 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4266563afbb1eb1735aa7063fe8ff6377991ae42;p=thirdparty%2Fkernel%2Fstable.git net: hns: Use IS_ERR_OR_NULL() helper function Use the IS_ERR_OR_NULL() helper instead of open-coding a NULL and an error pointer checks to simplify the code and improve readability. Signed-off-by: Hongbo Li Reviewed-by: Jacob Keller Link: https://patch.msgid.link/20240828122336.3697176-1-lihongbo22@huawei.com Signed-off-by: Jakub Kicinski --- diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c index 616a2768e5048..58baac7103b38 100644 --- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c +++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c @@ -734,7 +734,7 @@ hns_mac_register_phydev(struct mii_bus *mdio, struct hns_mac_cb *mac_cb, return -ENODATA; phy = get_phy_device(mdio, addr, is_c45); - if (!phy || IS_ERR(phy)) + if (IS_ERR_OR_NULL(phy)) return -EIO; phy->irq = mdio->irq[addr];