Commit 4266563a authored by Hongbo Li's avatar Hongbo Li Committed by Jakub Kicinski

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: default avatarHongbo Li <lihongbo22@huawei.com>
Reviewed-by: default avatarJacob Keller <jacob.e.keller@intel.com>
Link: https://patch.msgid.link/20240828122336.3697176-1-lihongbo22@huawei.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 9023fda2
......@@ -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];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment