Skip to content

Commit fc25f9f

Browse files
groeckdavem330
authored andcommitted
net: thunderx: Drop unnecessary NULL check after container_of
The result of container_of() operations is never NULL unless the embedded element is the first element of the structure. This is not the case here. The NULL check is therefore unnecessary and misleading. Remove it. This change was made automatically with the following Coccinelle script. @@ type t; identifier v; statement s; @@ <+... ( t v = container_of(...); | v = container_of(...); ) ... when != v - if (\( !v \| v == NULL \) ) s ...+> Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent fa44821 commit fc25f9f

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

drivers/net/ethernet/cavium/thunder/thunder_bgx.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -594,9 +594,6 @@ static void bgx_lmac_handler(struct net_device *netdev)
594594
struct phy_device *phydev;
595595
int link_changed = 0;
596596

597-
if (!lmac)
598-
return;
599-
600597
phydev = lmac->phydev;
601598

602599
if (!phydev->link && lmac->last_link)

0 commit comments

Comments
 (0)