Skip to contentSkip to conversation

liquidio: style: Identical condition and return expression 'retval', return value is always 0.

PATCH New YANG LI 1 participant 1 message Dec 30, 2020

Subsystems (3)
lore
Share & tools
lore

YANG LI

author
#0 lore raw

PATCH 1/1 liquidio: style: Identical condition and return expression 'retval', return value is always 0.

The warning was because of the following line in function liquidio_get_fec():

retval = wait_for_sc_completion_timeout(oct, sc, 0);
    if (retval)
	return retval;

If this statement is not true, retval must be 0 and not updated later. So, It is better to return 0 directly.

---
 drivers/net/ethernet/cavium/liquidio/lio_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/cavium/liquidio/lio_core.c +1 -1
index 37d0641..cff18a0 100644
@@ -1811,5 +1811,5 @@ int liquidio_get_fec(struct lio *lio)
 			oct->props[lio->ifidx].fec ? "on" : "off");
 	}
 
-	return retval;
+	return 0;
 }
Signature · 1 line
1.8.3.1