drivers/gpu/drm/drm_fb_helper.c: don't use private implementation of atoi()
Kernel has simple_strtol() which would be used as atoi().
This is quite the same fix as in 2cb96f8662
("fbdev: drop custom atoi from drivers/video/modedb.c") because code in
drivers/gpu/drm/drm_fb_helper.c is based on drivers/video/modedb.c.
Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
committed by
Dave Airlie
parent
9a1420d118
commit
3b40a4434f
@@ -27,6 +27,7 @@
|
|||||||
* Dave Airlie <airlied@linux.ie>
|
* Dave Airlie <airlied@linux.ie>
|
||||||
* Jesse Barnes <jesse.barnes@intel.com>
|
* Jesse Barnes <jesse.barnes@intel.com>
|
||||||
*/
|
*/
|
||||||
|
#include <linux/kernel.h>
|
||||||
#include <linux/sysrq.h>
|
#include <linux/sysrq.h>
|
||||||
#include <linux/fb.h>
|
#include <linux/fb.h>
|
||||||
#include "drmP.h"
|
#include "drmP.h"
|
||||||
@@ -50,21 +51,6 @@ int drm_fb_helper_add_connector(struct drm_connector *connector)
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL(drm_fb_helper_add_connector);
|
EXPORT_SYMBOL(drm_fb_helper_add_connector);
|
||||||
|
|
||||||
static int my_atoi(const char *name)
|
|
||||||
{
|
|
||||||
int val = 0;
|
|
||||||
|
|
||||||
for (;; name++) {
|
|
||||||
switch (*name) {
|
|
||||||
case '0' ... '9':
|
|
||||||
val = 10*val+(*name-'0');
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* drm_fb_helper_connector_parse_command_line - parse command line for connector
|
* drm_fb_helper_connector_parse_command_line - parse command line for connector
|
||||||
* @connector - connector to parse line for
|
* @connector - connector to parse line for
|
||||||
@@ -111,7 +97,7 @@ static bool drm_fb_helper_connector_parse_command_line(struct drm_connector *con
|
|||||||
namelen = i;
|
namelen = i;
|
||||||
if (!refresh_specified && !bpp_specified &&
|
if (!refresh_specified && !bpp_specified &&
|
||||||
!yres_specified) {
|
!yres_specified) {
|
||||||
refresh = my_atoi(&name[i+1]);
|
refresh = simple_strtol(&name[i+1], NULL, 10);
|
||||||
refresh_specified = 1;
|
refresh_specified = 1;
|
||||||
if (cvt || rb)
|
if (cvt || rb)
|
||||||
cvt = 0;
|
cvt = 0;
|
||||||
@@ -121,7 +107,7 @@ static bool drm_fb_helper_connector_parse_command_line(struct drm_connector *con
|
|||||||
case '-':
|
case '-':
|
||||||
namelen = i;
|
namelen = i;
|
||||||
if (!bpp_specified && !yres_specified) {
|
if (!bpp_specified && !yres_specified) {
|
||||||
bpp = my_atoi(&name[i+1]);
|
bpp = simple_strtol(&name[i+1], NULL, 10);
|
||||||
bpp_specified = 1;
|
bpp_specified = 1;
|
||||||
if (cvt || rb)
|
if (cvt || rb)
|
||||||
cvt = 0;
|
cvt = 0;
|
||||||
@@ -130,7 +116,7 @@ static bool drm_fb_helper_connector_parse_command_line(struct drm_connector *con
|
|||||||
break;
|
break;
|
||||||
case 'x':
|
case 'x':
|
||||||
if (!yres_specified) {
|
if (!yres_specified) {
|
||||||
yres = my_atoi(&name[i+1]);
|
yres = simple_strtol(&name[i+1], NULL, 10);
|
||||||
yres_specified = 1;
|
yres_specified = 1;
|
||||||
} else
|
} else
|
||||||
goto done;
|
goto done;
|
||||||
@@ -170,7 +156,7 @@ static bool drm_fb_helper_connector_parse_command_line(struct drm_connector *con
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (i < 0 && yres_specified) {
|
if (i < 0 && yres_specified) {
|
||||||
xres = my_atoi(name);
|
xres = simple_strtol(name, NULL, 10);
|
||||||
res_specified = 1;
|
res_specified = 1;
|
||||||
}
|
}
|
||||||
done:
|
done:
|
||||||
|
Reference in New Issue
Block a user