Skip to content

Commit

Permalink
tty: Avoid the use of one-element arrays
Browse files Browse the repository at this point in the history
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 <lkp@intel.com>
Link: https://github.com/GustavoARSilva/linux-hardening/blob/master/cii/0-day/tty-20200716.md
Acked-by: Jiri Slaby <jirislaby@kernel.org>
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
  • Loading branch information
GustavoARSilva authored and intel-lab-lkp committed Jul 23, 2020
1 parent bd78ecd commit d19cfc9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/tty/tty_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -2683,15 +2683,15 @@ struct serial_struct32 {
compat_int_t baud_base;
unsigned short close_delay;
char io_type;
char reserved_char[1];
char reserved_char;
compat_int_t hub6;
unsigned short closing_wait; /* time to wait before closing */
unsigned short closing_wait2; /* no longer used... */
compat_uint_t iomem_base;
unsigned short iomem_reg_shift;
unsigned int port_high;
/* compat_ulong_t iomap_base FIXME */
compat_int_t reserved[1];
compat_int_t reserved;
};

static int compat_tty_tiocsserial(struct tty_struct *tty,
Expand Down

0 comments on commit d19cfc9

Please sign in to comment.