diff options
author | LABBE Corentin <clabbe.montjoie@gmail.com> | 2015-12-11 07:58:59 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-12-11 11:13:06 -0500 |
commit | d6e6e14fa61dcabbc05092ea124540280573720c (patch) | |
tree | 80143a1b0a7b37811d5072bfb5f5474661cb2616 /drivers/gpu/drm/drm_modes.c | |
parent | 5dec293b2434783a6924571df5239e10ab5e9331 (diff) |
drm: modes: Revert cc344980c767 "replace simple_strtoul by kstrtouint"
My latest commit introduce some case where a valid mode, could be
rejected.
simple_strtox functions stop at first non-digit character, but kstrtox
not.
So args like "video=HDMI-A-1:720x480-16@60" will be reject when checking
16@.
Discussions about this change comes to the conclusion that the best
solution is to revert my commit cc344980c76748e57c9c03100c2a14d36ab00334.
Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1449838739-29969-1-git-send-email-clabbe.montjoie@gmail.com
Diffstat (limited to 'drivers/gpu/drm/drm_modes.c')
-rw-r--r-- | drivers/gpu/drm/drm_modes.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c index a15e26281a41..5a8a78d5e960 100644 --- a/drivers/gpu/drm/drm_modes.c +++ b/drivers/gpu/drm/drm_modes.c | |||
@@ -1262,7 +1262,7 @@ bool drm_mode_parse_command_line_for_connector(const char *mode_option, | |||
1262 | unsigned int xres = 0, yres = 0, bpp = 32, refresh = 0; | 1262 | unsigned int xres = 0, yres = 0, bpp = 32, refresh = 0; |
1263 | bool yres_specified = false, cvt = false, rb = false; | 1263 | bool yres_specified = false, cvt = false, rb = false; |
1264 | bool interlace = false, margins = false, was_digit = false; | 1264 | bool interlace = false, margins = false, was_digit = false; |
1265 | int i, err; | 1265 | int i; |
1266 | enum drm_connector_force force = DRM_FORCE_UNSPECIFIED; | 1266 | enum drm_connector_force force = DRM_FORCE_UNSPECIFIED; |
1267 | 1267 | ||
1268 | #ifdef CONFIG_FB | 1268 | #ifdef CONFIG_FB |
@@ -1282,9 +1282,7 @@ bool drm_mode_parse_command_line_for_connector(const char *mode_option, | |||
1282 | case '@': | 1282 | case '@': |
1283 | if (!refresh_specified && !bpp_specified && | 1283 | if (!refresh_specified && !bpp_specified && |
1284 | !yres_specified && !cvt && !rb && was_digit) { | 1284 | !yres_specified && !cvt && !rb && was_digit) { |
1285 | err = kstrtouint(&name[i + 1], 10, &refresh); | 1285 | refresh = simple_strtol(&name[i+1], NULL, 10); |
1286 | if (err) | ||
1287 | return false; | ||
1288 | refresh_specified = true; | 1286 | refresh_specified = true; |
1289 | was_digit = false; | 1287 | was_digit = false; |
1290 | } else | 1288 | } else |
@@ -1293,9 +1291,7 @@ bool drm_mode_parse_command_line_for_connector(const char *mode_option, | |||
1293 | case '-': | 1291 | case '-': |
1294 | if (!bpp_specified && !yres_specified && !cvt && | 1292 | if (!bpp_specified && !yres_specified && !cvt && |
1295 | !rb && was_digit) { | 1293 | !rb && was_digit) { |
1296 | err = kstrtouint(&name[i + 1], 10, &bpp); | 1294 | bpp = simple_strtol(&name[i+1], NULL, 10); |
1297 | if (err) | ||
1298 | return false; | ||
1299 | bpp_specified = true; | 1295 | bpp_specified = true; |
1300 | was_digit = false; | 1296 | was_digit = false; |
1301 | } else | 1297 | } else |
@@ -1303,9 +1299,7 @@ bool drm_mode_parse_command_line_for_connector(const char *mode_option, | |||
1303 | break; | 1299 | break; |
1304 | case 'x': | 1300 | case 'x': |
1305 | if (!yres_specified && was_digit) { | 1301 | if (!yres_specified && was_digit) { |
1306 | err = kstrtouint(&name[i + 1], 10, &yres); | 1302 | yres = simple_strtol(&name[i+1], NULL, 10); |
1307 | if (err) | ||
1308 | return false; | ||
1309 | yres_specified = true; | 1303 | yres_specified = true; |
1310 | was_digit = false; | 1304 | was_digit = false; |
1311 | } else | 1305 | } else |
@@ -1529,4 +1523,4 @@ int drm_mode_convert_umode(struct drm_display_mode *out, | |||
1529 | 1523 | ||
1530 | out: | 1524 | out: |
1531 | return ret; | 1525 | return ret; |
1532 | } | 1526 | } \ No newline at end of file |