Skip to content

Commit e5b9f4b

Browse files
GustavoARSilvagregkh
authored andcommitted
tty: Avoid the use of one-element arrays
One-element arrays are being deprecated[1]. Replace the one-element arrays with simple value types 'char reserved_char' and 'compat_int_t reserved'[2], once it seems these are just placeholders for alignment. [1] KSPP#79 [2] KSPP#86 Tested-by: kernel test robot <[email protected]> Link: https://github.com/GustavoARSilva/linux-hardening/blob/master/cii/0-day/tty-20200716.md Acked-by: Jiri Slaby <[email protected]> Signed-off-by: Gustavo A. R. Silva <[email protected]> Link: https://lore.kernel.org/r/f49bf0e27eaac396c96d21392c8c284f9f5ef52a.1595543280.git.gustavoars@kernel.org Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent dbaab94 commit e5b9f4b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/tty/tty_io.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2683,15 +2683,15 @@ struct serial_struct32 {
26832683
compat_int_t baud_base;
26842684
unsigned short close_delay;
26852685
char io_type;
2686-
char reserved_char[1];
2686+
char reserved_char;
26872687
compat_int_t hub6;
26882688
unsigned short closing_wait; /* time to wait before closing */
26892689
unsigned short closing_wait2; /* no longer used... */
26902690
compat_uint_t iomem_base;
26912691
unsigned short iomem_reg_shift;
26922692
unsigned int port_high;
26932693
/* compat_ulong_t iomap_base FIXME */
2694-
compat_int_t reserved[1];
2694+
compat_int_t reserved;
26952695
};
26962696

26972697
static int compat_tty_tiocsserial(struct tty_struct *tty,

0 commit comments

Comments
 (0)