]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
earlycon: simplify earlycon-table implementation
authorJohan Hovold <johan@kernel.org>
Mon, 23 Nov 2020 10:23:13 +0000 (11:23 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 Dec 2020 14:49:48 +0000 (15:49 +0100)
commit62dcd9c59f324e484c1d655884e0101a988f6671
treeec29b5f49759dbb05a35982c1de49d3fe037f405
parentf35a07f92616700733636c06dd6e5b6cdc807fe4
earlycon: simplify earlycon-table implementation

Instead of using the array-of-pointers trick to avoid having gcc mess up
the earlycon array stride, specify type alignment when declaring entries
to prevent gcc from increasing alignment.

This is essentially an alternative (one-line) fix to the problem
addressed by commit dd709e72cb93 ("earlycon: Use a pointer table to fix
__earlycon_table stride").

gcc can increase the alignment of larger objects with static extent as
an optimisation, but this can be suppressed by using the aligned
attribute when declaring variables.

Note that we have been relying on this behaviour for kernel parameters
for 16 years and it indeed hasn't changed since the introduction of the
aligned attribute in gcc-3.1.

Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20201123102319.8090-3-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/of/fdt.c
drivers/tty/serial/earlycon.c
include/linux/serial_core.h