Skip to content

Commit c0898fc

Browse files
arndbmripard
authored andcommitted
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: b7ced38 ("drm/selftests: Add command line parser selftests") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190628121712.1928142-1-arnd@arndb.de
1 parent dd2b595 commit c0898fc

3 files changed

Lines changed: 53 additions & 93 deletions

File tree

‎drivers/gpu/drm/drm_modes.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1448,7 +1448,7 @@ static int drm_mode_parse_cmdline_refresh(const char *str, char **end_ptr,
14481448
}
14491449

14501450
static int drm_mode_parse_cmdline_extra(const char *str, int length,
1451-
struct drm_connector *connector,
1451+
const struct drm_connector *connector,
14521452
struct drm_cmdline_mode *mode)
14531453
{
14541454
int i;
@@ -1493,7 +1493,7 @@ static int drm_mode_parse_cmdline_extra(const char *str, int length,
14931493

14941494
static int drm_mode_parse_cmdline_res_mode(const char *str, unsigned int length,
14951495
bool extras,
1496-
struct drm_connector *connector,
1496+
const struct drm_connector *connector,
14971497
struct drm_cmdline_mode *mode)
14981498
{
14991499
const char *str_start = str;
@@ -1555,7 +1555,7 @@ static int drm_mode_parse_cmdline_res_mode(const char *str, unsigned int length,
15551555
}
15561556

15571557
static int drm_mode_parse_cmdline_options(char *str, size_t len,
1558-
struct drm_connector *connector,
1558+
const struct drm_connector *connector,
15591559
struct drm_cmdline_mode *mode)
15601560
{
15611561
unsigned int rotation = 0;
@@ -1689,7 +1689,7 @@ static int drm_mode_parse_cmdline_options(char *str, size_t len,
16891689
* True if a valid modeline has been parsed, false otherwise.
16901690
*/
16911691
bool drm_mode_parse_command_line_for_connector(const char *mode_option,
1692-
struct drm_connector *connector,
1692+
const struct drm_connector *connector,
16931693
struct drm_cmdline_mode *mode)
16941694
{
16951695
const char *name;

0 commit comments

Comments
 (0)