All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
	linux-iio@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] iio: ssp_sensors: fix error code in ssp_print_mcu_debug()
Date: Sat, 18 Sep 2021 19:13:06 +0100	[thread overview]
Message-ID: <20210918191306.5999b1cc@jic23-huawei> (raw)
In-Reply-To: <20210914105333.GA11657@kili>

On Tue, 14 Sep 2021 13:53:33 +0300
Dan Carpenter <dan.carpenter@oracle.com> wrote:

> The ssp_print_mcu_debug() function should return negative error codes on
> error.  Returning "length" is meaningless.  This change does not affect
> runtime because the callers only care about zero/non-zero.
> 
> Reported-by: Jonathan Cameron <jic23@kernel.org>
> Fixes: 50dd64d57eee ("iio: common: ssp_sensors: Add sensorhub driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Applied to the fixes-togreg branch of iio.git and marked for stable.

Thanks,

Jonathan

> ---
>  drivers/iio/common/ssp_sensors/ssp_spi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/common/ssp_sensors/ssp_spi.c b/drivers/iio/common/ssp_sensors/ssp_spi.c
> index 4864c38b8d1c..77449b4f3df5 100644
> --- a/drivers/iio/common/ssp_sensors/ssp_spi.c
> +++ b/drivers/iio/common/ssp_sensors/ssp_spi.c
> @@ -137,7 +137,7 @@ static int ssp_print_mcu_debug(char *data_frame, int *data_index,
>  	if (length > received_len - *data_index || length <= 0) {
>  		ssp_dbg("[SSP]: MSG From MCU-invalid debug length(%d/%d)\n",
>  			length, received_len);
> -		return length ? length : -EPROTO;
> +		return -EPROTO;
>  	}
>  
>  	ssp_dbg("[SSP]: MSG From MCU - %s\n", &data_frame[*data_index]);


      reply	other threads:[~2021-09-18 18:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-14 10:53 [PATCH] iio: ssp_sensors: fix error code in ssp_print_mcu_debug() Dan Carpenter
2021-09-18 18:13 ` Jonathan Cameron [this message]

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=20210918191306.5999b1cc@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.