gwdpa: gswip: fix odd_ptr_err.cocci warnings
diff mbox series

Message ID alpine.DEB.2.21.2002201541470.2210@hadrien
State Superseded
Delegated to: Jeff Kirsher
Headers show
  • gwdpa: gswip: fix odd_ptr_err.cocci warnings
Related show

Commit Message

Julia Lawall Feb. 20, 2020, 2:43 p.m. UTC
From: kbuild test robot <>

PTR_ERR should typically access the value just tested by IS_ERR

Generated by: scripts/coccinelle/tests/odd_ptr_err.cocci

Fixes: 69fab0a67a95 ("gwdpa: gswip: Introduce Gigabit Ethernet Switch (GSWIP) device driver")
CC: Jack Ping CHNG <>
Signed-off-by: kbuild test robot <>
Signed-off-by: Julia Lawall <>


Maybe the code is correct, but just unnecessarily obscure.

tree: dev-queue
head:   7a6fc7fc71cf6316739b60fcffdb86e0c43f99b5
commit: 69fab0a67a95208a25af95de20a0301298ee23f6 [43/47] gwdpa: gswip: Introduce Gigabit Ethernet Switch (GSWIP) device driver
:::::: branch date: 9 hours ago
:::::: commit date: 9 hours ago

 gswip_dev.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff mbox series

--- a/drivers/net/ethernet/intel/gwdpa/gswip/gswip_dev.c
+++ b/drivers/net/ethernet/intel/gwdpa/gswip/gswip_dev.c
@@ -96,7 +96,7 @@  static int np_gswip_parse_dt(struct plat

 	pdata->sw_clk = devm_clk_get(dev, "switch");
 	if (IS_ERR(pdata->sw_clk))
-		return PTR_ERR(priv->pdata.sw_clk);
+		return PTR_ERR(pdata->sw_clk);

 	for_each_node_by_name(node, GSWIP_MAC_DEV_NAME) {