lkml.org 
[lkml]   [2010]   [Feb]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [patch v2 2/4] x86, ptrace: regset extensions to support xstate
    static inline int user_regset_copyout(unsigned int *pos, unsigned int *count,
    void **kbuf,
    void __user **ubuf, const void *data,
    const int start_pos, const int end_pos)
    {
    if (*count == 0)
    return 0;
    BUG_ON(*pos < start_pos);
    if (end_pos < 0 || *pos < end_pos) {
    unsigned int copy = (end_pos < 0 ? *count
    : min(*count, end_pos - *pos));
    data += *pos - start_pos;
    ^^^
    Is it correct? Shouldn't it be

    data += *pos + start_pos;

    ?

    Currently this doesn't matter, start_pos == 0 always. In fact I don't
    understand why do we need this arg. In unlikely case the caller wants
    to copy the part of *data, it can adjust data/end_pos itself.

    Oleg.



    \
     
     \ /
      Last update: 2010-02-10 15:23    [W:0.019 / U:93.340 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site