mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Li-hao Kuo <lhjeff911@gmail.com>
Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
	wells.lu@sunplus.com, lh.kuo@sunplus.com, trix@redhat.com
Subject: Re: [PATCH] spi: Fix warning for Clang build
Date: Thu, 10 Feb 2022 11:17:00 +0000	[thread overview]
Message-ID: <YgT0LMcDpCEYHFYg@sirena.org.uk> (raw)
In-Reply-To: <691d52b72f978f562136c587319852f5c65f08fe.1644460444.git.lhjeff911@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 540 bytes --]

On Thu, Feb 10, 2022 at 10:36:56AM +0800, Li-hao Kuo wrote:

> -	int mode, ret;
> +	int mode, ret = 0;
>  
>  	mode = SP7021_SPI_IDLE;
>  	if (xfer->tx_buf && xfer->rx_buf) {
> @@ -403,7 +403,7 @@ static int sp7021_spi_slave_transfer_one(struct spi_controller *ctlr, struct spi
>  		ret = sp7021_spi_slave_rx(spi, xfer);
>  		break;
>  	default:
> -		break;
> +		return -EINVAL;

The return here means that the initialization is now redundant and will
stop the compiler spotting any future similar issues which isn't ideal.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2022-02-10 11:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-10  2:36 Li-hao Kuo
2022-02-10 11:17 ` Mark Brown [this message]
2022-02-11  3:32   ` Lh Kuo 郭力豪
2022-02-11  4:49     ` Tom Rix
2022-02-11  4:59       ` Lh Kuo 郭力豪
2022-02-11 11:57         ` Mark Brown
2022-02-13 18:11         ` Nathan Chancellor
2022-02-14  2:23           ` Lh Kuo 郭力豪

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=YgT0LMcDpCEYHFYg@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=lh.kuo@sunplus.com \
    --cc=lhjeff911@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=trix@redhat.com \
    --cc=wells.lu@sunplus.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

all inboxes | Powered by JetHome®