fbdev: omapfb: Replace custom memparse() implementation
Subsystems (2)
PATCH 1/1 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 <[email protected]>
--- drivers/video/fbdev/omap/omapfb_main.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-)
drivers/video/fbdev/omap/omapfb_main.c +3 -10
@@ -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 ]);
Signature · 1 line
2.40.0.1.gaa8946217a0b
Helge Deller
maintainerQuoted 7 lines · Andy Shevchenko
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 <[email protected]>--- drivers/video/fbdev/omap/omapfb_main.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-)
both patches applied.
Thanks!
Helge