Messages in this thread |  | | | Date | Wed, 9 Sep 2009 13:39:56 -0700 | | From | Andrew Morton <> | | Subject | Re: [PATCH 3/3] viafb: use read-only mode parsing |
| |
On Mon, 7 Sep 2009 02:24:44 +0000 Florian Tobias Schandinat <FlorianSchandinat@gmx.de> wrote: > +static void parse_mode(const char *str, u32 *xres, u32 *yres) > +{ > + char *ptr; > + > + *xres = simple_strtoul(str, &ptr, 10); > + if (ptr[0] != 'x') > + goto out_default; > + > + *yres = simple_strtoul(&ptr[1], &ptr, 10); > + if (ptr[0]) > + goto out_default; > + > + return; > + > +out_default: > + printk(KERN_WARNING "viafb received invalid mode string: %s\n", str); > + *xres = 640; > + *yres = 480; > +}
One wonders if we could use sscanf here?
The second simple_strtoul() could use strict_strtoul(), but that's not obviously superior IMO.
|  |