lkml.org 
[lkml]   [2008]   [Jan]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 2.6.24] Add new string functions real_strtoul and change kernel params to use them
From
Date
On Thu, 2008-01-31 at 09:03 -0800, Randy Dunlap wrote:
> On Thu, 31 Jan 2008 09:18:22 +0800 Yi Yang wrote:
>
> > Currently, for every sysfs node, the callers will be responsible for
> > implementing store operation, so many many callers are doing duplicate
> > things to validate input, they have the same mistakes because they are
> > calling simple_strtol/ul/ll/ull, especially for module params, they are
> > just numeric, but you can echo such values as 0x1234xxx, 07777888 and
> > 1234aaa, for these cases, module params store operation just ignores
> > successive invalid char and converts prefix part to a numeric although
> > input is actually invalid.
> >
> > This patch tries to fix the aforementioned issues and implements real_strtox
> > serial functions, kernel/params.c uses them to strictly validate input,
> > so module params will reject such values as 0x1234xxxx and returns an error:
>
> How about a prefix of safe_ or strict_ or something other than real_?
> real_ sounds too much like a real number function string parser.
>
I named it as strict_ at the beginning, but it results in some alignment
issues checkpatch.pl will always warn, i don't know if warnings will
make the patch out of the door.

In kernel/params.c, STANDARD_PARAM_DEF(a function definition macro) will
be over 80 chars, is it correct coding style to split it to two lines?



\
 
 \ /
  Last update: 2008-02-01 02:45    [W:0.109 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site