From: Michal Simek Date: Fri, 6 Nov 2020 12:53:01 +0000 (+0100) Subject: fru: common: Switch capture variable with the rest X-Git-Tag: v2021.10~425^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5fb093f471d2ded8f8ad58a85f247b84631ca8dc;p=platform%2Fkernel%2Fu-boot.git fru: common: Switch capture variable with the rest capture variable is bool which is just one byte and it is just causing unaligned accesses. Better to have it as last entry in the structure. It also simplify offset calculation for initial header copy. Signed-off-by: Michal Simek --- diff --git a/board/xilinx/common/fru.h b/board/xilinx/common/fru.h index a3e6520..e85dde4 100644 --- a/board/xilinx/common/fru.h +++ b/board/xilinx/common/fru.h @@ -53,9 +53,9 @@ struct fru_board_data { }; struct fru_table { - bool captured; struct fru_common_hdr hdr; struct fru_board_data brd; + bool captured; }; #define FRU_TYPELEN_CODE_MASK 0xC0 diff --git a/board/xilinx/common/fru_ops.c b/board/xilinx/common/fru_ops.c index fc3add7..affcb12 100644 --- a/board/xilinx/common/fru_ops.c +++ b/board/xilinx/common/fru_ops.c @@ -217,7 +217,7 @@ int fru_capture(unsigned long addr) hdr = (struct fru_common_hdr *)addr; - memcpy((void *)&fru_data.hdr, (void *)hdr, + memcpy((void *)&fru_data, (void *)hdr, sizeof(struct fru_common_hdr)); fru_data.captured = true;