From: Longsuhui <Jack_sun@tom.com>
To: Dan Carpenter <dan.carpenter@linaro.org>, Su Hui <suhui@nfschina.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
YongSu Yoo <yongsuyoo0215@gmail.com>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] media: dvb_ringbuffer: Return -EFAULT if copy fails
Date: Wed, 24 May 2023 16:23:57 +0800 [thread overview]
Message-ID: <5e03a89f-726d-9351-6235-9b610e8a9389@tom.com> (raw)
In-Reply-To: <7466fead-1b99-4a78-86cb-5dd8a9baec19@kili.mountain>
On 2023/5/24 15:20, Dan Carpenter wrote:
> On Wed, May 24, 2023 at 01:20:27PM +0800, Su Hui wrote:
>> It's confusing about the comment on function declaration.
>>
>> /**
>> * dvb_ringbuffer_write_user - Writes a buffer received via a user
>> pointer
>>
>> ..........
>>
>> * Return: number of bytes transferred or -EFAULT
>>
>> But the function Only returns the number of bytes transferred.
>>
>> Maybe the comment should be modified because it never returns -EFAULT.
> To be honest, I think that -EFAULT is probably a better return. But
> there is no way we could apply the patch with that commit message. The
> commit message doesn't explain the problem for the user or why returning
> the number of bytes copied is not correct in this case.
>
> I think that maybe it's not too late to change this to return -EFAULT,
> but it would have been easier to make the change in 2014 before there
> were many users. Also it would be easier if you were testing this on
> real hardware.
>
> Possibly other people think the current behavior is correct or that it
> is too late to change it. That's also fine. I'm not a domain expert
> here.
I understand it.
Thanks a lot!
Su Hui
>
> regards,
> dan carpenter
>
next prev parent reply other threads:[~2023-05-24 8:24 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-24 1:27 Su Hui
2023-05-24 4:23 ` Dan Carpenter
2023-05-24 4:47 ` Dan Carpenter
2023-05-24 5:20 ` Su Hui
2023-05-24 7:20 ` Dan Carpenter
2023-05-24 8:23 ` Longsuhui [this message]
2023-05-26 10:45 ` Mauro Carvalho Chehab
2023-05-29 1:08 ` Longsuhui
2023-05-29 1:54 ` Su Hui
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=5e03a89f-726d-9351-6235-9b610e8a9389@tom.com \
--to=jack_sun@tom.com \
--cc=dan.carpenter@linaro.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=suhui@nfschina.com \
--cc=yongsuyoo0215@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®