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

From: YANG LI
Date: Wed Dec 30 2020 - 01:11:24 EST


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

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

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

Signed-off-by: YANG LI <abaci-bugfix@xxxxxxxxxxxxxxxxx>
Reported-by: Abaci <abaci@xxxxxxxxxxxxxxxxx>
---
drivers/net/ethernet/cavium/liquidio/lio_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/cavium/liquidio/lio_core.c b/drivers/net/ethernet/cavium/liquidio/lio_core.c
index 37d0641..6e2426f 100644
--- a/drivers/net/ethernet/cavium/liquidio/lio_core.c
+++ b/drivers/net/ethernet/cavium/liquidio/lio_core.c
@@ -1747,7 +1747,7 @@ int liquidio_set_fec(struct lio *lio, int on_off)
oct->props[lio->ifidx].fec ? "on" : "off");
}

- return retval;
+ return 0;
}

int liquidio_get_fec(struct lio *lio)
--
1.8.3.1