LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Sven Van Asbroeck <thesven73@gmail.com>
To: Mao Wenan <maowenan@huawei.com>
Cc: Greg KH <gregkh@linuxfoundation.org>,
	Jeremy Sowden <jeremy@azazel.net>,
	devel@driverdev.osuosl.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org,
	Matt Sickler <matt.sickler@daktronics.com>
Subject: Re: [PATCH net] staging: Remove set but not used variable ‘status’
Date: Sat, 25 May 2019 08:59:08 -0400	[thread overview]
Message-ID: <CAGngYiX04W+-jxqnWUD6CLh8LAr61FhtADGM0zbGcdeArqzC-Q@mail.gmail.com> (raw)
In-Reply-To: <20190525042642.78482-1-maowenan@huawei.com>

On Sat, May 25, 2019 at 12:20 AM Mao Wenan <maowenan@huawei.com> 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.

  parent reply	other threads:[~2019-05-25 12:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-25  4:26 Mao Wenan
2019-05-25  5:01 ` Greg KH
2019-05-25  6:39   ` maowenan
2019-05-25  8:13 ` [PATCH -next v2] staging: kpc2000: " Mao Wenan
2019-05-28  2:09   ` maowenan
2019-05-28  8:02   ` [PATCH -next v3 0/2] cleanup for kpc2000_spi.c Mao Wenan
2019-05-28  8:02     ` [PATCH -next v3 1/2] staging: kpc2000: report error status to spi core Mao Wenan
2019-05-28  8:02     ` [PATCH -next v3 2/2] staging: kpc2000: replace white spaces with tabs for kpc2000_spi.c Mao Wenan
2019-05-25 12:59 ` Sven Van Asbroeck [this message]
2019-05-27  2:33   ` [PATCH net] staging: Remove set but not used variable ‘status’ maowenan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAGngYiX04W+-jxqnWUD6CLh8LAr61FhtADGM0zbGcdeArqzC-Q@mail.gmail.com \
    --to=thesven73@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jeremy@azazel.net \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maowenan@huawei.com \
    --cc=matt.sickler@daktronics.com \
    --subject='Re: [PATCH net] staging: Remove set but not used variable ‘status’' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).