[U-Boot] [PATCH] ARM: cfi_flash: Fix unaligned accesses to cfi_qry structure

Marek Vasut marex at denx.de
Wed May 8 19:26:01 CEST 2013


Dear Andrew Gabbasov,

> Packed structure cfi_qry contains unaligned 16- and 32-bits members,
> accessing which causes problems when cfi_flash driver is compiled with
> -munaligned-access option: flash initialization hangs, probably
> due to data error.
> 
> This fix converts 16- and 32-bit members to byte arrays and uses special
> macros to access such fields. It removes possible unaligned accesses
> in cfi_flash driver.
> 
> Signed-off-by: Andrew Gabbasov <andrew_gabbasov at mentor.com>

It seems OK. I just wonder if the le16_to_cpu you removed can have no impact now 
on obscure-endian architectures, that's my only concern.

Best regards,
Marek Vasut


More information about the U-Boot mailing list