Commit c0898fca authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Maxime Ripard

drm/selftests: reduce stack usage

Putting a large drm_connector object on the stack can lead to warnings
in some configuration, such as:

drivers/gpu/drm/selftests/test-drm_cmdline_parser.c:18:12: error: stack frame size of 1040 bytes in function 'drm_cmdline_test_res' [-Werror,-Wframe-larger-than=]
static int drm_cmdline_test_res(void *ignored)

Since the object is never modified, just declare it as 'static const'
and allow this to be passed down.

Fixes: b7ced389 ("drm/selftests: Add command line parser selftests")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarMaxime Ripard <maxime.ripard@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190628121712.1928142-1-arnd@arndb.de
parent dd2b5959
...@@ -1448,7 +1448,7 @@ static int drm_mode_parse_cmdline_refresh(const char *str, char **end_ptr, ...@@ -1448,7 +1448,7 @@ static int drm_mode_parse_cmdline_refresh(const char *str, char **end_ptr,
} }
static int drm_mode_parse_cmdline_extra(const char *str, int length, static int drm_mode_parse_cmdline_extra(const char *str, int length,
struct drm_connector *connector, const struct drm_connector *connector,
struct drm_cmdline_mode *mode) struct drm_cmdline_mode *mode)
{ {
int i; int i;
...@@ -1493,7 +1493,7 @@ static int drm_mode_parse_cmdline_extra(const char *str, int length, ...@@ -1493,7 +1493,7 @@ static int drm_mode_parse_cmdline_extra(const char *str, int length,
static int drm_mode_parse_cmdline_res_mode(const char *str, unsigned int length, static int drm_mode_parse_cmdline_res_mode(const char *str, unsigned int length,
bool extras, bool extras,
struct drm_connector *connector, const struct drm_connector *connector,
struct drm_cmdline_mode *mode) struct drm_cmdline_mode *mode)
{ {
const char *str_start = str; const char *str_start = str;
...@@ -1555,7 +1555,7 @@ static int drm_mode_parse_cmdline_res_mode(const char *str, unsigned int length, ...@@ -1555,7 +1555,7 @@ static int drm_mode_parse_cmdline_res_mode(const char *str, unsigned int length,
} }
static int drm_mode_parse_cmdline_options(char *str, size_t len, static int drm_mode_parse_cmdline_options(char *str, size_t len,
struct drm_connector *connector, const struct drm_connector *connector,
struct drm_cmdline_mode *mode) struct drm_cmdline_mode *mode)
{ {
unsigned int rotation = 0; unsigned int rotation = 0;
...@@ -1689,7 +1689,7 @@ static int drm_mode_parse_cmdline_options(char *str, size_t len, ...@@ -1689,7 +1689,7 @@ static int drm_mode_parse_cmdline_options(char *str, size_t len,
* True if a valid modeline has been parsed, false otherwise. * True if a valid modeline has been parsed, false otherwise.
*/ */
bool drm_mode_parse_command_line_for_connector(const char *mode_option, bool drm_mode_parse_command_line_for_connector(const char *mode_option,
struct drm_connector *connector, const struct drm_connector *connector,
struct drm_cmdline_mode *mode) struct drm_cmdline_mode *mode)
{ {
const char *name; const char *name;
......
...@@ -537,7 +537,7 @@ void drm_connector_list_update(struct drm_connector *connector); ...@@ -537,7 +537,7 @@ void drm_connector_list_update(struct drm_connector *connector);
/* parsing cmdline modes */ /* parsing cmdline modes */
bool bool
drm_mode_parse_command_line_for_connector(const char *mode_option, drm_mode_parse_command_line_for_connector(const char *mode_option,
struct drm_connector *connector, const struct drm_connector *connector,
struct drm_cmdline_mode *mode); struct drm_cmdline_mode *mode);
struct drm_display_mode * struct drm_display_mode *
drm_mode_create_from_cmdline_mode(struct drm_device *dev, drm_mode_create_from_cmdline_mode(struct drm_device *dev,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment