[PATCH v2 16/33] drm/modes: Bail out of named mode parsing early if it's a number

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]<

 



If the name we want to parse starts with a digit, it's not a named mode.
Thus, there's no need to compare it to the list of all the named modes
we support, we can return straight away.

Signed-off-by: Maxime Ripard <maxime@xxxxxxxxxx>

diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index 8d629fbb1047..ede5b094da4c 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -2238,6 +2238,10 @@ static int drm_mode_parse_cmdline_named_mode(const char *name,
 	if (!name_end)
 		return 0;
 
+	/* If the name starts with a digit, it's not a named mode */
+	if (isdigit(name[0]))
+		return 0;
+
 	/*
 	 * We're sure we're a named mode at that point, iterate over the
 	 * list of modes we're aware of.

-- 
b4 0.10.0



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux