[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YgT0LMcDpCEYHFYg@sirena.org.uk>
Date:   Thu, 10 Feb 2022 11:17:00 +0000
From:   Mark Brown <broonie@...nel.org>
To:     Li-hao Kuo <lhjeff911@...il.com>
Cc:     linux-spi@...r.kernel.org, linux-kernel@...r.kernel.org,
        wells.lu@...plus.com, lh.kuo@...plus.com, trix@...hat.com
Subject: Re: [PATCH] spi: Fix warning for Clang build
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.
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists