lkml.org 
[lkml]   [2022]   [Feb]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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]
\
 
 \ /
  Last update: 2022-02-10 12:18    [W:0.066 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site