Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <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>

authored by

Hongbo Li and committed by
Jakub Kicinski
4266563a 9023fda2

+1 -1
+1 -1
drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
··· 734 734 return -ENODATA; 735 735 736 736 phy = get_phy_device(mdio, addr, is_c45); 737 - if (!phy || IS_ERR(phy)) 737 + if (IS_ERR_OR_NULL(phy)) 738 738 return -EIO; 739 739 740 740 phy->irq = mdio->irq[addr];