linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] video: fbdev: via: remove VLA usage
@ 2018-03-08 17:39 Gustavo A. R. Silva
  2018-03-09 10:59 ` Eric Engestrom
  0 siblings, 1 reply; 5+ messages in thread
From: Gustavo A. R. Silva @ 2018-03-08 17:39 UTC (permalink / raw)
  To: Emil Velikov, Florian Tobias Schandinat, Bartlomiej Zolnierkiewicz
  Cc: linux-fbdev, dri-devel, linux-kernel, kernel-hardening,
	Kees Cook, Gustavo A. R. Silva

In preparation to enabling -Wvla, remove VLA usage.

Also, fixed as part of the directive to remove all VLAs from
the kernel: https://lkml.org/lkml/2018/3/7/621

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/video/fbdev/via/via_aux_sii164.c | 2 +-
 drivers/video/fbdev/via/via_aux_vt1631.c | 2 +-
 drivers/video/fbdev/via/via_aux_vt1632.c | 2 +-
 drivers/video/fbdev/via/via_aux_vt1636.c | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/video/fbdev/via/via_aux_sii164.c b/drivers/video/fbdev/via/via_aux_sii164.c
index ca1b35f..c27f62c 100644
--- a/drivers/video/fbdev/via/via_aux_sii164.c
+++ b/drivers/video/fbdev/via/via_aux_sii164.c
@@ -36,7 +36,7 @@ static void probe(struct via_aux_bus *bus, u8 addr)
 		.name	=	name};
 	/* check vendor id and device id */
 	const u8 id[] = {0x01, 0x00, 0x06, 0x00}, len = ARRAY_SIZE(id);
-	u8 tmp[len];
+	u8 tmp[ARRAY_SIZE(id)];
 
 	if (!via_aux_read(&drv, 0x00, tmp, len) || memcmp(id, tmp, len))
 		return;
diff --git a/drivers/video/fbdev/via/via_aux_vt1631.c b/drivers/video/fbdev/via/via_aux_vt1631.c
index 06e742f..32978a0 100644
--- a/drivers/video/fbdev/via/via_aux_vt1631.c
+++ b/drivers/video/fbdev/via/via_aux_vt1631.c
@@ -36,7 +36,7 @@ void via_aux_vt1631_probe(struct via_aux_bus *bus)
 		.name	=	name};
 	/* check vendor id and device id */
 	const u8 id[] = {0x06, 0x11, 0x91, 0x31}, len = ARRAY_SIZE(id);
-	u8 tmp[len];
+	u8 tmp[ARRAY_SIZE(id)];
 
 	if (!via_aux_read(&drv, 0x00, tmp, len) || memcmp(id, tmp, len))
 		return;
diff --git a/drivers/video/fbdev/via/via_aux_vt1632.c b/drivers/video/fbdev/via/via_aux_vt1632.c
index d24f4cd..cec8cc4 100644
--- a/drivers/video/fbdev/via/via_aux_vt1632.c
+++ b/drivers/video/fbdev/via/via_aux_vt1632.c
@@ -36,7 +36,7 @@ static void probe(struct via_aux_bus *bus, u8 addr)
 		.name	=	name};
 	/* check vendor id and device id */
 	const u8 id[] = {0x06, 0x11, 0x92, 0x31}, len = ARRAY_SIZE(id);
-	u8 tmp[len];
+	u8 tmp[ARRAY_SIZE(id)];
 
 	if (!via_aux_read(&drv, 0x00, tmp, len) || memcmp(id, tmp, len))
 		return;
diff --git a/drivers/video/fbdev/via/via_aux_vt1636.c b/drivers/video/fbdev/via/via_aux_vt1636.c
index 9e015c1..2b10bc2 100644
--- a/drivers/video/fbdev/via/via_aux_vt1636.c
+++ b/drivers/video/fbdev/via/via_aux_vt1636.c
@@ -36,7 +36,7 @@ void via_aux_vt1636_probe(struct via_aux_bus *bus)
 		.name	=	name};
 	/* check vendor id and device id */
 	const u8 id[] = {0x06, 0x11, 0x45, 0x33}, len = ARRAY_SIZE(id);
-	u8 tmp[len];
+	u8 tmp[ARRAY_SIZE(id)];
 
 	if (!via_aux_read(&drv, 0x00, tmp, len) || memcmp(id, tmp, len))
 		return;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] video: fbdev: via: remove VLA usage
  2018-03-08 17:39 [PATCH] video: fbdev: via: remove VLA usage Gustavo A. R. Silva
@ 2018-03-09 10:59 ` Eric Engestrom
  2018-03-09 11:02   ` Emil Velikov
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Engestrom @ 2018-03-09 10:59 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Emil Velikov, Florian Tobias Schandinat,
	Bartlomiej Zolnierkiewicz, linux-fbdev, Kees Cook,
	kernel-hardening, linux-kernel, dri-devel, Gustavo A. R. Silva

On Thursday, 2018-03-08 11:39:49 -0600, Gustavo A. R. Silva wrote:
> In preparation to enabling -Wvla, remove VLA usage.
> 
> Also, fixed as part of the directive to remove all VLAs from
> the kernel: https://lkml.org/lkml/2018/3/7/621
> 
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>

Sorry for my reply on v1, I missed that Emil already replied to another
post of the same patch (side note on that, making use of `-vX` and
`--in-reply-to` helps track the evolution of patches)

This looks good to me:
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>

> ---
>  drivers/video/fbdev/via/via_aux_sii164.c | 2 +-
>  drivers/video/fbdev/via/via_aux_vt1631.c | 2 +-
>  drivers/video/fbdev/via/via_aux_vt1632.c | 2 +-
>  drivers/video/fbdev/via/via_aux_vt1636.c | 2 +-
>  4 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/video/fbdev/via/via_aux_sii164.c b/drivers/video/fbdev/via/via_aux_sii164.c
> index ca1b35f..c27f62c 100644
> --- a/drivers/video/fbdev/via/via_aux_sii164.c
> +++ b/drivers/video/fbdev/via/via_aux_sii164.c
> @@ -36,7 +36,7 @@ static void probe(struct via_aux_bus *bus, u8 addr)
>  		.name	=	name};
>  	/* check vendor id and device id */
>  	const u8 id[] = {0x01, 0x00, 0x06, 0x00}, len = ARRAY_SIZE(id);
> -	u8 tmp[len];
> +	u8 tmp[ARRAY_SIZE(id)];
>  
>  	if (!via_aux_read(&drv, 0x00, tmp, len) || memcmp(id, tmp, len))
>  		return;
> diff --git a/drivers/video/fbdev/via/via_aux_vt1631.c b/drivers/video/fbdev/via/via_aux_vt1631.c
> index 06e742f..32978a0 100644
> --- a/drivers/video/fbdev/via/via_aux_vt1631.c
> +++ b/drivers/video/fbdev/via/via_aux_vt1631.c
> @@ -36,7 +36,7 @@ void via_aux_vt1631_probe(struct via_aux_bus *bus)
>  		.name	=	name};
>  	/* check vendor id and device id */
>  	const u8 id[] = {0x06, 0x11, 0x91, 0x31}, len = ARRAY_SIZE(id);
> -	u8 tmp[len];
> +	u8 tmp[ARRAY_SIZE(id)];
>  
>  	if (!via_aux_read(&drv, 0x00, tmp, len) || memcmp(id, tmp, len))
>  		return;
> diff --git a/drivers/video/fbdev/via/via_aux_vt1632.c b/drivers/video/fbdev/via/via_aux_vt1632.c
> index d24f4cd..cec8cc4 100644
> --- a/drivers/video/fbdev/via/via_aux_vt1632.c
> +++ b/drivers/video/fbdev/via/via_aux_vt1632.c
> @@ -36,7 +36,7 @@ static void probe(struct via_aux_bus *bus, u8 addr)
>  		.name	=	name};
>  	/* check vendor id and device id */
>  	const u8 id[] = {0x06, 0x11, 0x92, 0x31}, len = ARRAY_SIZE(id);
> -	u8 tmp[len];
> +	u8 tmp[ARRAY_SIZE(id)];
>  
>  	if (!via_aux_read(&drv, 0x00, tmp, len) || memcmp(id, tmp, len))
>  		return;
> diff --git a/drivers/video/fbdev/via/via_aux_vt1636.c b/drivers/video/fbdev/via/via_aux_vt1636.c
> index 9e015c1..2b10bc2 100644
> --- a/drivers/video/fbdev/via/via_aux_vt1636.c
> +++ b/drivers/video/fbdev/via/via_aux_vt1636.c
> @@ -36,7 +36,7 @@ void via_aux_vt1636_probe(struct via_aux_bus *bus)
>  		.name	=	name};
>  	/* check vendor id and device id */
>  	const u8 id[] = {0x06, 0x11, 0x45, 0x33}, len = ARRAY_SIZE(id);
> -	u8 tmp[len];
> +	u8 tmp[ARRAY_SIZE(id)];
>  
>  	if (!via_aux_read(&drv, 0x00, tmp, len) || memcmp(id, tmp, len))
>  		return;
> -- 
> 2.7.4
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] video: fbdev: via: remove VLA usage
  2018-03-09 10:59 ` Eric Engestrom
@ 2018-03-09 11:02   ` Emil Velikov
  2018-03-12 16:04     ` Bartlomiej Zolnierkiewicz
  2018-03-13  3:29     ` Gustavo A. R. Silva
  0 siblings, 2 replies; 5+ messages in thread
From: Emil Velikov @ 2018-03-09 11:02 UTC (permalink / raw)
  To: Eric Engestrom
  Cc: Gustavo A. R. Silva, Florian Tobias Schandinat,
	Bartlomiej Zolnierkiewicz, linux-fbdev, Kees Cook,
	kernel-hardening, Linux-Kernel@Vger. Kernel. Org, ML dri-devel,
	Gustavo A. R. Silva

On 9 March 2018 at 10:59, Eric Engestrom <eric.engestrom@imgtec.com> wrote:
> On Thursday, 2018-03-08 11:39:49 -0600, Gustavo A. R. Silva wrote:
>> In preparation to enabling -Wvla, remove VLA usage.
>>
>> Also, fixed as part of the directive to remove all VLAs from
>> the kernel: https://lkml.org/lkml/2018/3/7/621
>>
>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
>
> Sorry for my reply on v1, I missed that Emil already replied to another
> post of the same patch (side note on that, making use of `-vX` and
> `--in-reply-to` helps track the evolution of patches)
>
> This looks good to me:
> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
>
Same here
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>

-Emil

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] video: fbdev: via: remove VLA usage
  2018-03-09 11:02   ` Emil Velikov
@ 2018-03-12 16:04     ` Bartlomiej Zolnierkiewicz
  2018-03-13  3:29     ` Gustavo A. R. Silva
  1 sibling, 0 replies; 5+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2018-03-12 16:04 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Emil Velikov, Eric Engestrom, Florian Tobias Schandinat,
	linux-fbdev, Kees Cook, kernel-hardening,
	Linux-Kernel@Vger. Kernel. Org, ML dri-devel,
	Gustavo A. R. Silva

On Friday, March 09, 2018 11:02:24 AM Emil Velikov wrote:
> On 9 March 2018 at 10:59, Eric Engestrom <eric.engestrom@imgtec.com> wrote:
> > On Thursday, 2018-03-08 11:39:49 -0600, Gustavo A. R. Silva wrote:
> >> In preparation to enabling -Wvla, remove VLA usage.
> >>
> >> Also, fixed as part of the directive to remove all VLAs from
> >> the kernel: https://lkml.org/lkml/2018/3/7/621
> >>
> >> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> >
> > Sorry for my reply on v1, I missed that Emil already replied to another
> > post of the same patch (side note on that, making use of `-vX` and
> > `--in-reply-to` helps track the evolution of patches)
> >
> > This looks good to me:
> > Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
> >
> Same here
> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>

Patch queued for 4.17, thanks.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] video: fbdev: via: remove VLA usage
  2018-03-09 11:02   ` Emil Velikov
  2018-03-12 16:04     ` Bartlomiej Zolnierkiewicz
@ 2018-03-13  3:29     ` Gustavo A. R. Silva
  1 sibling, 0 replies; 5+ messages in thread
From: Gustavo A. R. Silva @ 2018-03-13  3:29 UTC (permalink / raw)
  To: Emil Velikov, Eric Engestrom
  Cc: Florian Tobias Schandinat, Bartlomiej Zolnierkiewicz,
	linux-fbdev, Kees Cook, kernel-hardening,
	Linux-Kernel@Vger. Kernel. Org, ML dri-devel,
	Gustavo A. R. Silva



On 03/09/2018 05:02 AM, Emil Velikov wrote:
> On 9 March 2018 at 10:59, Eric Engestrom <eric.engestrom@imgtec.com> wrote:
>> On Thursday, 2018-03-08 11:39:49 -0600, Gustavo A. R. Silva wrote:
>>> In preparation to enabling -Wvla, remove VLA usage.
>>>
>>> Also, fixed as part of the directive to remove all VLAs from
>>> the kernel: https://lkml.org/lkml/2018/3/7/621
>>>
>>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
>>
>> Sorry for my reply on v1, I missed that Emil already replied to another
>> post of the same patch (side note on that, making use of `-vX` and
>> `--in-reply-to` helps track the evolution of patches)
>>

Yep. I know. It is just that some people prefer vX in a new thread. 
Anyway, I will take this into account for the next time.

>> This looks good to me:
>> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
>>
> Same here
> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
> 
> -Emil
> 

Thanks for reviewing it, guys.
-- 
Gustavo A. R. Silva

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-03-13  3:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-08 17:39 [PATCH] video: fbdev: via: remove VLA usage Gustavo A. R. Silva
2018-03-09 10:59 ` Eric Engestrom
2018-03-09 11:02   ` Emil Velikov
2018-03-12 16:04     ` Bartlomiej Zolnierkiewicz
2018-03-13  3:29     ` Gustavo A. R. Silva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).