fbdev: omapfb: Replace custom memparse() implementation
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 18 Oct 2023 03:47:25 +0000 (06:47 +0300)
committerHelge Deller <deller@gmx.de>
Tue, 7 Nov 2023 13:42:34 +0000 (14:42 +0100)
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>
drivers/video/fbdev/omap/omapfb_main.c

index 631076bf71f9d89d2a7adbab6f157812000b7b6b..694cf6318782bc8e60fe6dfd4445894099ba74ff 100644 (file)
@@ -1856,20 +1856,13 @@ static int __init omapfb_setup(char *options)
                if (!strncmp(this_opt, "accel", 5))
                        def_accel = 1;
                else if (!strncmp(this_opt, "vram:", 5)) {
+                       unsigned long long vram;
                        char *suffix;
-                       unsigned long vram;
-                       vram = (simple_strtoul(this_opt + 5, &suffix, 0));
+
+                       vram = memparse(this_opt + 5, &suffix);
                        switch (suffix[0]) {
                        case '\0':
                                break;
-                       case 'm':
-                       case 'M':
-                               vram *= 1024;
-                               fallthrough;
-                       case 'k':
-                       case 'K':
-                               vram *= 1024;
-                               break;
                        default:
                                pr_debug("omapfb: invalid vram suffix %c\n",
                                         suffix[0]);