All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nigel Christian <nigel.l.christian@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] NFC: microread: Pass err variable to async_cb()
Date: Tue, 1 Jun 2021 09:41:40 -0400	[thread overview]
Message-ID: <YLY5FK07BDcl8SFH@fedora> (raw)
In-Reply-To: <20210601133757.GA1955@kadam>

On Tue, Jun 01, 2021 at 04:37:57PM +0300, Dan Carpenter wrote:
> On Tue, Jun 01, 2021 at 09:00:33AM -0400, Nigel Christian wrote:
> > In the case MICROREAD_CB_TYPE_READER_ALL clang reports a dead
> > code warning. The error code is being directly passed to 
> > async_cb(). Fix this by passing the err variable, which is also
> > done in another path.
> > 
> > Addresses-Coverity: ("Unused value") 
> > Signed-off-by: Nigel Christian <nigel.l.christian@gmail.com>
> > ---
> >  drivers/nfc/microread/microread.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/nfc/microread/microread.c b/drivers/nfc/microread/microread.c
> > index 8d3988457c58..130b0f554016 100644
> > --- a/drivers/nfc/microread/microread.c
> > +++ b/drivers/nfc/microread/microread.c
> > @@ -367,7 +367,7 @@ static void microread_im_transceive_cb(void *context, struct sk_buff *skb,
> >  				err = -EPROTO;
> >  				kfree_skb(skb);
> >  				info->async_cb(info->async_cb_context, NULL,
> > -					       -EPROTO);
> > +					       err);
> 
> It would be better to just delete the "err = -EPROTO;" assignment.
> 
> Literals are more readable.  Avoid pointless indirection.

Yeah, my bad. v2 sent! Thanks Dan!

> 
> regards,
> dan carpenter
> 
> 

      reply	other threads:[~2021-06-01 13:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-01 13:00 [PATCH] NFC: microread: Pass err variable to async_cb() Nigel Christian
2021-06-01 13:07 ` Krzysztof Kozlowski
2021-06-01 13:07   ` Krzysztof Kozlowski
2021-06-01 13:07   ` [linux-nfc] " Krzysztof Kozlowski
2021-06-01 13:37 ` Dan Carpenter
2021-06-01 13:41   ` Nigel Christian [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=YLY5FK07BDcl8SFH@fedora \
    --to=nigel.l.christian@gmail.com \
    --cc=dan.carpenter@oracle.com \
    --cc=kernel-janitors@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 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.