[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: string conversion in a driver



> > 
> > strtok is defined in lib/string.c.
> > 
> > atoi is defined in arch/ia64/sn/io/sgi_if.c.
> > 
> 
> In case sscanf is available sscanf,"%d",&variable) is also an alternative
> !!

Is there any _sane_ reason for sscanf to do anything else, then to call strtol
(and the rest of strto* stuff)? AFAICS they are designed to be suitable as
sscanf helpers.

Now, I just looked at kernel vsprintf implementation.
It *DOES HAVE* these helpers. They are caled simple_strto*. They don't skip
leading white space, thus the simple_ prefix.

--------------------------------------------------------------------------------
                  				- Jan Hudec `Bulb' <bulb@ucw.cz>
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/