Skip to content

Commit 7be6adf

Browse files
andy-shevhdeller
authored andcommitted
fbdev: omapfb: Replace custom memparse() implementation
Our library has memparse() for parsing numbers with respective suffixes suitable for memory sizes. Use it instead of custom implementation. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Helge Deller <deller@gmx.de>
1 parent e89a60b commit 7be6adf

1 file changed

Lines changed: 3 additions & 10 deletions

File tree

drivers/video/fbdev/omap/omapfb_main.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1856,20 +1856,13 @@ static int __init omapfb_setup(char *options)
18561856
if (!strncmp(this_opt, "accel", 5))
18571857
def_accel = 1;
18581858
else if (!strncmp(this_opt, "vram:", 5)) {
1859+
unsigned long long vram;
18591860
char *suffix;
1860-
unsigned long vram;
1861-
vram = (simple_strtoul(this_opt + 5, &suffix, 0));
1861+
1862+
vram = memparse(this_opt + 5, &suffix);
18621863
switch (suffix[0]) {
18631864
case '\0':
18641865
break;
1865-
case 'm':
1866-
case 'M':
1867-
vram *= 1024;
1868-
fallthrough;
1869-
case 'k':
1870-
case 'K':
1871-
vram *= 1024;
1872-
break;
18731866
default:
18741867
pr_debug("omapfb: invalid vram suffix %c\n",
18751868
suffix[0]);

0 commit comments

Comments
 (0)