]> git.baikalelectronics.ru Git - kernel.git/commit
tty/vt: consolemap: use ARRAY_SIZE(), part II.
authorJiri Slaby <jslaby@suse.cz>
Tue, 14 Jun 2022 09:05:30 +0000 (11:05 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jun 2022 12:17:11 +0000 (14:17 +0200)
commit8fe2052d43e3c12a56e6bba4bdb2e5ee45f1a86f
treedf1eb4c947f90850fba049a739924ade7ff02a62
parentac489990ab1f94307888fc4419befe18e9f5a76d
tty/vt: consolemap: use ARRAY_SIZE(), part II.

The code still uses constants (macros) as bounds in loops after commit
11693f7641be (tty/vt: consolemap: use ARRAY_SIZE()). The contants are at
least macros used also in the definition of the arrays. But use
ARRAY_SIZE() on two more places to ensure the loops never run out of
bounds even if the array definition change.

Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20220614090537.15557-1-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/vt/consolemap.c