lkml.org 
[lkml]   [2020]   [May]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] tty: Replace zero-length array with flexible-array
From
Date
On 07. 05. 20, 21:25, Gustavo A. R. Silva wrote:
> The current codebase makes use of the zero-length array language
> extension to the C90 standard, but the preferred mechanism to declare
> variable-length types such as these ones is a flexible array member[1][2],
> introduced in C99:
>
> struct foo {
> int stuff;
> struct boo array[];
> };
...

Acked-by: Jiri Slaby <jslaby@suse.cz>

> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
> ---
> include/linux/tty.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/tty.h b/include/linux/tty.h
> index bd5fe0e907e8..a99e9b8e4e31 100644
> --- a/include/linux/tty.h
> +++ b/include/linux/tty.h
> @@ -66,7 +66,7 @@ struct tty_buffer {
> int read;
> int flags;
> /* Data points here */
> - unsigned long data[0];
> + unsigned long data[];
> };
>
> /* Values for .flags field of tty_buffer */
>

thanks,
--
js
suse labs

\
 
 \ /
  Last update: 2020-05-11 08:08    [W:0.032 / U:2.296 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site