aboutsummaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorMichal Simek <michal.simek@xilinx.com>2020-11-06 13:53:01 +0100
committerMichal Simek <michal.simek@xilinx.com>2020-11-20 10:42:54 +0100
commit5fb093f471d2ded8f8ad58a85f247b84631ca8dc (patch)
treef3cfe7f8b9a264a30350b4c5496a25765f44e434 /board
parent072dbc7ac551ff4e316ac66988a8b915f48cc06f (diff)
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 <michal.simek@xilinx.com>
Diffstat (limited to 'board')
-rw-r--r--board/xilinx/common/fru.h2
-rw-r--r--board/xilinx/common/fru_ops.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/board/xilinx/common/fru.h b/board/xilinx/common/fru.h
index a3e65202571..e85dde45314 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 fc3add7d93d..affcb121aa9 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;