Commit 520ea934 authored by Laura Abbott's avatar Laura Abbott Committed by Daniel Vetter

drm/gma500: Remove VLA

There's an ongoing effort to remove VLAs[1] from the kernel to eventually
turn on -Wvla. Switch to a reasonable upper bound for the VLAs in
the gma500 driver.

[1] https://lkml.org/lkml/2018/3/7/621Signed-off-by: default avatarLaura Abbott <labbott@redhat.com>
Reviewed-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20180409210647.3718-1-labbott@redhat.com
parent c7cbed56
...@@ -429,13 +429,20 @@ static const char *cmd_status_names[] = { ...@@ -429,13 +429,20 @@ static const char *cmd_status_names[] = {
"Scaling not supported" "Scaling not supported"
}; };
#define MAX_ARG_LEN 32
static bool psb_intel_sdvo_write_cmd(struct psb_intel_sdvo *psb_intel_sdvo, u8 cmd, static bool psb_intel_sdvo_write_cmd(struct psb_intel_sdvo *psb_intel_sdvo, u8 cmd,
const void *args, int args_len) const void *args, int args_len)
{ {
u8 buf[args_len*2 + 2], status; u8 buf[MAX_ARG_LEN*2 + 2], status;
struct i2c_msg msgs[args_len + 3]; struct i2c_msg msgs[MAX_ARG_LEN + 3];
int i, ret; int i, ret;
if (args_len > MAX_ARG_LEN) {
DRM_ERROR("Need to increase arg length\n");
return false;
}
psb_intel_sdvo_debug_write(psb_intel_sdvo, cmd, args, args_len); psb_intel_sdvo_debug_write(psb_intel_sdvo, cmd, args, args_len);
for (i = 0; i < args_len; i++) { for (i = 0; i < args_len; i++) {
......
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