netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: YANG LI <abaci-bugfix@linux.alibaba.com>
To: davem@davemloft.net
Cc: kuba@kernel.org, dchickles@marvell.com, sburla@marvell.com,
	fmanlunas@marvell.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	YANG LI <abaci-bugfix@linux.alibaba.com>
Subject: [PATCH] liquidio: style:  Identical condition and return expression  'retval', return value is always 0.
Date: Wed, 30 Dec 2020 14:07:30 +0800	[thread overview]
Message-ID: <1609308450-50695-1-git-send-email-abaci-bugfix@linux.alibaba.com> (raw)

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>
---
 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


             reply	other threads:[~2020-12-30  6:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-30  6:07 YANG LI [this message]
2020-12-30  6:28 ` [PATCH] liquidio: style: Identical condition and return expression 'retval', return value is always 0 Joe Perches
2021-01-05 23:58 ` David Miller
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=1609308450-50695-1-git-send-email-abaci-bugfix@linux.alibaba.com \
    --to=abaci-bugfix@linux.alibaba.com \
    --cc=davem@davemloft.net \
    --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).