Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <152103045697.8738.16803220270496592360@jlahtine-desk.ger.corp.intel.com>
Date: Wed, 14 Mar 2018 14:27:37 +0200
From: Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>
To: Salvatore Mesoraca <s.mesoraca16@...il.com>, linux-kernel@...r.kernel.org
Cc: dri-devel@...ts.freedesktop.org, intel-gfx@...ts.freedesktop.org,
 kernel-hardening@...ts.openwall.com, David Airlie <airlied@...ux.ie>,
 Jani Nikula <jani.nikula@...ux.intel.com>, Kees Cook <keescook@...omium.org>,
 Rodrigo Vivi <rodrigo.vivi@...el.com>,
 Salvatore Mesoraca <s.mesoraca16@...il.com>
Subject: Re: [PATCH] drm/i915: drop various VLAs in i915_debugfs.c

Quoting Salvatore Mesoraca (2018-03-13 21:51:28)
> Avoid 3 VLAs[1] by using real constant expressions instead of variables.
> The compiler should be able to optimize the original code and avoid using
> any actual VLAs. Anyway this change is useful because it will avoid a false
> positives with -Wvla, it might also help the compiler generating better
> code.
> 
> [1] https://lkml.org/lkml/2018/3/7/621
> 
> Signed-off-by: Salvatore Mesoraca <s.mesoraca16@...il.com>
> ---
>  drivers/gpu/drm/i915/i915_debugfs.c | 26 ++++++++++++++++----------
>  1 file changed, 16 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index e968aea..bf0a8e3 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -4259,19 +4259,20 @@ static ssize_t cur_wm_latency_write(struct file *file, const char __user *ubuf,
>                         i915_cache_sharing_get, i915_cache_sharing_set,
>                         "%llu\n");
>  
> +#define CHERRYVIEW_SS_MAX 2

CHV_SS_MAX should be good enough. Make these function scoped (so #define
at the beginning and #undef at the end of function).

Do use ARRAY_SIZE() instead of repeating.

Regards, Joonas

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.