lkml.org 
[lkml]   [2023]   [May]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] media: dvb_ringbuffer: Return -EFAULT if copy fails
    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

    \
     
     \ /
      Last update: 2023-05-24 09:21    [W:4.194 / U:0.132 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site