All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] spi: pic32: Add a comment in pic32_spi_dma_prep()
Date: Tue, 26 Nov 2019 14:02:12 +0000	[thread overview]
Message-ID: <20191126140212.GC1759@kadam> (raw)
In-Reply-To: <20191126135025.mligekonmv2u6dcl@kili.mountain>

On Tue, Nov 26, 2019 at 03:55:25PM +0200, Peter Ujfalusi wrote:
> Hi Dan,
> 
> On 26/11/2019 15.50, Dan Carpenter wrote:
> > This code triggers a static checker warning about missed error codes.
> > It's slightly tricky that we fall back to PIO so let's silence the
> > checker and add a comment for anyone who is confused.
> > 
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > ---
> > I won't feel offended at all if people don't think it's worth applying
> > this patch.
> > 
> >  drivers/spi/spi-pic32.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/spi/spi-pic32.c b/drivers/spi/spi-pic32.c
> > index 156961b4ca86..835380ab8bf2 100644
> > --- a/drivers/spi/spi-pic32.c
> > +++ b/drivers/spi/spi-pic32.c
> > @@ -633,8 +633,10 @@ static int pic32_spi_dma_prep(struct pic32_spi *pic32s, struct device *dev)
> >  		goto out_err;
> >  	}
> >  
> > -	if (pic32_spi_dma_config(pic32s, DMA_SLAVE_BUSWIDTH_1_BYTE))
> > +	if (pic32_spi_dma_config(pic32s, DMA_SLAVE_BUSWIDTH_1_BYTE)) {
> > +		ret = 0;  /* Fall back to PIO if DMA fails. */
> 
> The 'ret' is initialized to 0 in the function to handle this.
> After looking at the code again I see that pic32_spi_dma_config() does
> error prints for failures.
> 
> A comment might be enough here if it is even needed.

Yeah.  The "ret = 0;" is just to silence static checkers.  It doesn't
change the object code (except line numbers).  I'm not emotionally
invested in this patch so if it's too much then that's fine.

regards,
dan carpenter

      parent reply	other threads:[~2019-11-26 14:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-26 13:50 [PATCH] spi: pic32: Add a comment in pic32_spi_dma_prep() Dan Carpenter
2019-11-26 13:55 ` Peter Ujfalusi
2019-11-26 14:02 ` 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=20191126140212.GC1759@kadam \
    --to=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.