mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: 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 10:20:38 +0300	[thread overview]
Message-ID: <7466fead-1b99-4a78-86cb-5dd8a9baec19@kili.mountain> (raw)
In-Reply-To: <aab14cc4-0400-c114-f180-6db943fd7e32@nfschina.com>

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.

regards,
dan carpenter


  reply	other threads:[~2023-05-24  7:20 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 [this message]
2023-05-24  8:23         ` Longsuhui
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=7466fead-1b99-4a78-86cb-5dd8a9baec19@kili.mountain \
    --to=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®