Re: [PATCH] spi: Fix warning for Clang build

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux