]> git.baikalelectronics.ru Git - kernel.git/commit
printk: Fix alignment of buf causing crash on ARM EABI
authorAndrew Lunn <andrew@lunn.ch>
Tue, 5 Jun 2012 06:52:34 +0000 (08:52 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Jun 2012 23:20:17 +0000 (16:20 -0700)
commit23d55cd39640cce33c706bf4174c4f0ef56c8c2c
tree771410dbbeec9cba3629b27336b2eb4af30b58b1
parentcec171ce623007b482b8bb8d3ecdcb66c7f9a76c
printk: Fix alignment of buf causing crash on ARM EABI

Commit e7d56a77e92be523b9c0b1dacf11801625a44b0f, printk: convert
byte-buffer to variable-length record buffer, causes systems using
EABI to crash very early in the boot cycle. The first entry in struct
log is a u64, which for EABI must be 8 byte aligned.

Make use of __alignof__() so the compiler to decide the alignment, but
allow it to be overridden using CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS,
for systems which can perform unaligned access and want to save
a few bytes of space.

Tested on Orion5x and Kirkwood.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Stephen Warren <swarren@wwwdotorg.org>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Acked-by: Kay Sievers <kay@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/printk.c