All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Laurentiu-Cristian Duca <laurentiu.duca@gmail.com>,
	xenomai <xenomai@xenomai.org>
Subject: Re: [patch 1/5] spi-master.c: spi_master_read_rt()
Date: Mon, 13 Jan 2020 18:02:09 +0100	[thread overview]
Message-ID: <3d7b646b-2a1d-ac39-f16c-f88623fb90bd@siemens.com> (raw)
In-Reply-To: <CAPm8-H5XxArzdkjuy8dS-Hkud4aaNE11DrOQEmc+-a2MgxndbQ@mail.gmail.com>

Sorry for the late feedback - my backlog grew too large.

On 30.12.19 16:06, Laurentiu-Cristian Duca via Xenomai wrote:
>  From 15c59317fe1a9d60e20d470de3aca09bca5b99d0 Mon Sep 17 00:00:00 2001
> From: Laurentiu-Cristian Duca <laurentiu.duca@gmail.com>
> Date: Fri, 20 Dec 2019 17:35:50 +0200
> Subject: [PATCH] spi-master.c: spi_master_read_rt(): when master->ops->read()
>   completes successfully it returns > 0, so, in this case, copy data to
>   userspace.

Unfortunately, this is not a consumable format for me. I just need

From: Laurentiu-Cristian Duca <laurentiu.duca@gmail.com>

at the top of the commit message body. Look at [1] e.g. for the 
resulting format.

When you use git format-patch, set --from to some dummy address. That 
will make it generate patches with the correct additional "From:" line 
included. For the actual sending, you can use the normal address again.

Moreover, I need a shorter subject line, something like

     spi: Fix return code handling in spi_master_read_rt

And then write about why this change is correct (basically your current 
subject line).

> 
> Signed-off-by: Laurentiu-Cristian Duca <laurentiu.duca@gmail.com>
> ---
>   kernel/drivers/spi/spi-master.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/drivers/spi/spi-master.c b/kernel/drivers/spi/spi-master.c
> index 12a1ad1f1..e04f7ca10 100644
> --- a/kernel/drivers/spi/spi-master.c
> +++ b/kernel/drivers/spi/spi-master.c
> @@ -240,8 +240,8 @@ static ssize_t spi_master_read_rt(struct rtdm_fd *fd,
>   		do_chip_deselect(slave);
>   	}
>   	rtdm_mutex_unlock(&master->bus_lock);
> -	if (ret == 0)
> -		ret = rtdm_safe_copy_to_user(fd, u_buf, rx, len);
> +	if (ret > 0)
> +		ret = rtdm_safe_copy_to_user(fd, u_buf, rx, ret);
>   	
>   	xnfree(rx);
>   	
> 

Jan

[1] https://xenomai.org/pipermail/xenomai/2019-December/042210.html

-- 
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux


      reply	other threads:[~2020-01-13 17:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-30 15:06 [patch 1/5] spi-master.c: spi_master_read_rt() Laurentiu-Cristian Duca
2020-01-13 17:02 ` Jan Kiszka [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=3d7b646b-2a1d-ac39-f16c-f88623fb90bd@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=laurentiu.duca@gmail.com \
    --cc=xenomai@xenomai.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.