summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2021-10-21 09:10:56 -0700
committerCommit Bot <commit-bot@chromium.org>2021-10-21 18:38:06 +0000
commit2b948afb28d0674eebb4dc0ece088fbf95f6a142 (patch)
treec175f9ead57f38d9fa4e2c9064e492edf4cb93e0
parent30c8e6783a40a6f0969972f5b342b9db3588c5e0 (diff)
downloadchrome-ec-2b948afb28d0674eebb4dc0ece088fbf95f6a142.tar.gz
board_id: fix an incorrect offset calculation
The INFO_BOARD_ID_OFFSET value includes the offset of the board ID field, there is no need to add the field offset again. This incorrect calculation is not a problem, because the offset of the 'bid' field is zero, but the logic is wrong. BUG=none TEST=board ID value is still reported properly. Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Change-Id: I3e7061a930d751d2cf13113b1e519e8f976195bc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3236754 Reviewed-by: Mary Ruthven <mruthven@chromium.org> Reviewed-by: Andrey Pronin <apronin@chromium.org>
-rw-r--r--chip/g/board_id.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/chip/g/board_id.c b/chip/g/board_id.c
index c7613dd3bd..cc2b7ebfaa 100644
--- a/chip/g/board_id.c
+++ b/chip/g/board_id.c
@@ -186,8 +186,7 @@ static int write_board_id(struct board_id *id)
flash_info_write_enable();
/* Write Board ID */
- rv = flash_info_physical_write(INFO_BOARD_ID_OFFSET +
- offsetof(struct info1_board_space, bid),
+ rv = flash_info_physical_write(INFO_BOARD_ID_OFFSET,
sizeof(*id), (const char *)id);
if (rv != EC_SUCCESS)
CPRINTS("%s: write failed", __func__);