From: David Miller <davem@davemloft.net>
To: abaci-bugfix@linux.alibaba.com
Cc: kuba@kernel.org, dchickles@marvell.com, sburla@marvell.com,
fmanlunas@marvell.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] liquidio: style: Identical condition and return expression 'retval', return value is always 0.
Date: Tue, 05 Jan 2021 15:58:06 -0800 (PST) [thread overview]
Message-ID: <20210105.155806.1768484944984996325.davem@davemloft.net> (raw)
In-Reply-To: <1609308450-50695-1-git-send-email-abaci-bugfix@linux.alibaba.com>
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.
next prev parent reply other threads:[~2021-01-05 23:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-30 6:07 [PATCH] liquidio: style: Identical condition and return expression 'retval', return value is always 0 YANG LI
2020-12-30 6:28 ` Joe Perches
2021-01-05 23:58 ` David Miller [this message]
2020-12-30 6:10 YANG LI
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210105.155806.1768484944984996325.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=abaci-bugfix@linux.alibaba.com \
--cc=dchickles@marvell.com \
--cc=fmanlunas@marvell.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sburla@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).