lkml.org 
[lkml]   [2011]   [Feb]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 01/52] kstrtox: converting strings to integers done (hopefully) right
    On Sat, Feb 05, 2011 at 03:33:41PM +0100, Geert Uytterhoeven wrote:
    > On Sat, Feb 5, 2011 at 15:20, Alexey Dobriyan <adobriyan@gmail.com> wrote:

    > > + * Convert integer string representation to an integer.
    > > + * If an integer doesn't fit into specified type, -E is returned.
    >
    > Which -E? Currently it returns -EINVAL everywhere.

    Comment meant function follows 0/-E idiom for return value.

    > > +       if (tmp != (unsigned long long)(unsigned long)tmp)
    > > +               return -EINVAL;
    >
    > -ERANGE for out-of-range?

    Hmm, interesting.
    It should prevent -EINVAL hardcoding.
    --
    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: 2011-02-05 15:43    [W:4.082 / U:1.056 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site