lkml.org 
[lkml]   [2021]   [Jan]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    SubjectRe: [PATCH] liquidio: style: Identical condition and return expression 'retval', return value is always 0.
    From
    From: YANG LI <abaci-bugfix@linux.alibaba.com>
    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 <abaci-bugfix@linux.alibaba.com>
    > Reported-by: Abaci <abaci@linux.alibaba.com>

    Maybe you can remove the rest of the 'retval' usage in this function
    and even the variable itself?

    Thanks.

    \
     
     \ /
      Last update: 2021-01-06 01:01    [W:2.216 / U:0.840 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site