netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Colin King <colin.king@canonical.com>
Cc: "David S . Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org, kernel-janitors@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] cnic: remove redundant assignment to variable ret
Date: Sat, 9 May 2020 13:51:20 +0300	[thread overview]
Message-ID: <20200509105120.GH9365@kadam> (raw)
In-Reply-To: <20200508224026.483746-1-colin.king@canonical.com>

On Fri, May 08, 2020 at 11:40:26PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The variable ret is being assigned with a value that is never read,
> the assignment is redundant and can be removed.
> 
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

We used to return negative error codes until commit 23021c21055f ("cnic:
Improve error recovery on bnx2x devices").

To be honest, I like the deliberate "ret = 0;" because this code will
trigger a static checker warning about wrong error codes.  Also it looks
wrong to human reviewers.  We should probably add a comment:

	/* Deliberately returning success */
	return 0;

regards,
dan carpenter


      parent reply	other threads:[~2020-05-09 10:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-08 22:40 [PATCH] cnic: remove redundant assignment to variable ret Colin King
2020-05-09  4:50 ` Michael Chan
2020-05-09  5:48 ` Jakub Kicinski
2020-05-09 10:51 ` Dan Carpenter [this message]

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=20200509105120.GH9365@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=colin.king@canonical.com \
    --cc=davem@davemloft.net \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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).