Messages in this thread | | | Date | Thu, 10 Feb 2022 11:17:00 +0000 | From | Mark Brown <> | 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. [unhandled content-type:application/pgp-signature] | |