Re: [PATCH net] staging: Remove set but not used variable ‘status’

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

 



On Sat, May 25, 2019 at 12:20 AM Mao Wenan <maowenan@xxxxxxxxxx> wrote:
>
> The variable 'status' is not used any more, remve it.

>      /* do the transfers for this message */
>      list_for_each_entry(transfer, &m->transfers, transfer_list) {
>          if (transfer->tx_buf == NULL && transfer->rx_buf == NULL && transfer->len) {
> -            status = -EINVAL;
>              break;
>          }

This looks like an error condition that's not reported to the spi core.

Instead of removing the status variable (which also removes the error value!),
maybe this should be reported to the spi core instead ?

Other spi drivers appear to do the following on the error path:
m->status = status;
return status;

>
> @@ -370,7 +368,6 @@ kp_spi_transfer_one_message(struct spi_master *master, struct spi_message *m)
>
>              if (count != transfer->len) {
> -                status = -EIO;
>                  break;

Same issue here.
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux