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>
This commit is contained in:
Michal Simek 2020-11-06 13:53:01 +01:00
parent 072dbc7ac5
commit 5fb093f471
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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;