Skip to content

Commit

Permalink
net: hns: Use IS_ERR_OR_NULL() helper function
Browse files Browse the repository at this point in the history
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 <lihongbo22@huawei.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://patch.msgid.link/20240828122336.3697176-1-lihongbo22@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Hongbo Li authored and Jakub Kicinski committed Aug 29, 2024
1 parent 9023fda commit 4266563
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 4266563

Please sign in to comment.