lkml.org 
[lkml]   [2003]   [Apr]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] reduce stack in cpqarray.c::ida_ioctl()
    On Fri, 4 April 2003 10:09:37 +0200, Jens Axboe wrote:
    > On Fri, Apr 04 2003, Jörn Engel wrote:
    > > > + error = copy_to_user(io, my_io, sizeof(*my_io)) ? -EFAULT : 0;
    > >
    > > copy_to_user returns the bytes successfully copied.
    > > error is set to -EFAULT, if there was actually data transferred?
    > >
    > > How about:
    > > + error = copy_to_user(io, my_io, sizeof(*my_io)) < sizeof(*my_io) ? -EFAULT : 0;
    >
    > Pure nonsense! Correct logic, and much nicer to read IMO is:
    >
    > if (copy_to_user(io, my_io, sizeof(*my_io))
    > error = -EFAULT;

    Yes, you are right. I just couldn't read inline assembler properly.

    Jörn

    --
    With a PC, I always felt limited by the software available. On Unix,
    I am limited only by my knowledge.
    -- Peter J. Schoenster
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 13:34    [W:0.021 / U:150.672 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site