Skip to content
Commit 147ad605 authored by Johan Hovold's avatar Johan Hovold Committed by Jessica Yu
Browse files

init: use type alignment for kernel parameters

Specify type alignment for kernel parameters instead of sizeof(long).

The alignment attribute is used to prevent gcc from increasing the
alignment of objects with static extent as an optimisation, something
which would mess up the __setup array stride.

Using __alignof__(struct obs_kernel_param) rather than sizeof(long) is
preferred since it better indicates why it is there and doesn't break
should the type size or alignment change.

Note that on m68k the alignment of struct obs_kernel_param is actually
two and that adding a 1- or 2-byte field to the 12-byte struct would
cause a breakage with the current 4-byte alignment.

Link: https://lore.kernel.org/lkml/20201103175711.10731-1-johan@kernel.org


Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
Signed-off-by: default avatarJessica Yu <jeyu@kernel.org>
parent 2aec389e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment