Thread (3 messages) 3 messages, 3 authors, 2021-01-05

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

From: David Miller <davem@davemloft.net>
Date: 2021-01-05 23:58:49
Also in: lkml

From: YANG LI <redacted>
Date: Wed, 30 Dec 2020 14:07:30 +0800
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 <redacted>
Reported-by: Abaci <redacted>
Maybe you can remove the rest of the 'retval' usage in this function
and even the variable itself?

Thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help