All of lore.kernel.org
 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:10:51 +0800	[thread overview]
Message-ID: <1609308651-53731-1-git-send-email-abaci-bugfix@linux.alibaba.com> (raw)

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

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

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..cff18a0 100644
--- a/drivers/net/ethernet/cavium/liquidio/lio_core.c
+++ b/drivers/net/ethernet/cavium/liquidio/lio_core.c
@@ -1811,5 +1811,5 @@ int liquidio_get_fec(struct lio *lio)
 			oct->props[lio->ifidx].fec ? "on" : "off");
 	}
 
-	return retval;
+	return 0;
 }
-- 
1.8.3.1


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

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-30  6:10 YANG LI [this message]
  -- strict thread matches above, loose matches on Subject: below --
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

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=1609308651-53731-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.