diff options
author | Reka Norman <rekanorman@chromium.org> | 2022-09-13 01:36:29 +0000 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-09-13 03:38:23 +0000 |
commit | 4453b1e2bb1eacebc51de6e6cc2d82ec915f71ab (patch) | |
tree | 05c4df8dc65d88aa286a360df672a569e68397f8 | |
parent | 8d8629986c1e92c7d91c271b7c240283f7a811db (diff) | |
download | chrome-ec-4453b1e2bb1eacebc51de6e6cc2d82ec915f71ab.tar.gz |
Revert "ec_commands: Fix C++ compilation"
This reverts commit 8c8dc6f2287711bb839c9a61e9f254c2a3302f2d.
Reason for revert:
This breaks EC sync in depthcharge (see b:246211747 and CL:3890017). I was going to just fix the depthcharge case, but there are also a lot of places in the EC which rely on `sizeof(struct ec_params_flash_write)` being equal to the header size (e.g. flash_command_write(), flash_command_get_info(), ec_flash_write()), so these all need to be changed too.
Original change's description:
> ec_commands: Fix C++ compilation
>
> This union has non-zero size in C++.
>
> BRANCH=none
> BUG=b:234181908
> TEST=make buildall
>
> Signed-off-by: Tom Hughes <tomhughes@chromium.org>
> Change-Id: Ibd1216ebdef1d94725e7b3de341f677ccd261823
> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3872550
> Reviewed-by: Yuval Peress <peress@google.com>
Bug: b:246211747
Change-Id: I52508e2ec3c5a8b6224678bb655caa575f403842
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3891559
Reviewed-by: Sam McNally <sammc@chromium.org>
Auto-Submit: Reka Norman <rekanorman@chromium.org>
Tested-by: Reka Norman <rekanorman@chromium.org>
Commit-Queue: Sam McNally <sammc@chromium.org>
-rw-r--r-- | include/ec_commands.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/include/ec_commands.h b/include/ec_commands.h index 695499910a..667212f12e 100644 --- a/include/ec_commands.h +++ b/include/ec_commands.h @@ -1745,13 +1745,12 @@ struct ec_params_flash_write { uint32_t offset; uint32_t size; /* Followed by data to write. This union allows accessing an - * underlying buffer as uint32s or uint8s for convenience. Flexible - * array members are not available in C++, so the size is 1 for C++ - * compatibility. + * underlying buffer as uint32s or uint8s for convenience. This does not + * increase the size of the struct. */ union { - uint32_t words32[1]; - uint8_t bytes[1]; + uint32_t words32[0]; + uint8_t bytes[0]; } data; } __ec_align4; |