summaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
authorTom Hughes <tomhughes@chromium.org>2022-10-24 15:20:29 -0700
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-10-27 01:01:53 +0000
commitf59d3ca822ceb5f56788821129088acd787ae626 (patch)
tree9bd4218721ca4d5e82f4278054a5ab0af129208e /driver
parent546a7c56364c9934b780be2e6bab98b77eec0b0b (diff)
downloadchrome-ec-f59d3ca822ceb5f56788821129088acd787ae626.tar.gz
driver/touchpad_st: Fix unaligned access warnings
When building with clang, it now warns if there is an unpacked struct nested in a packed struct: driver/touchpad_st.c:109:2: error: field within 'struct (unnamed at driver/touchpad_st.c:105:8)' is less aligned than 'union (anonymous at driver/touchpad_st.c:109:2)' and is usually due to 'struct (unnamed at driver/touchpad_st.c:105:8)' being packed, which can lead to unaligned accesses [-Werror,-Wunaligned-access] union { ^ See https://github.com/llvm/llvm-project/issues/55520. BRANCH=none BUG=b:172020503 TEST=CC=clang make BOARD=whiskers TEST=./util/compare_build.sh -b all -j 120 => MATCH Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Id870922e05ecb89037e323a6d38083d07f205ee3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3975947 Reviewed-by: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'driver')
-rw-r--r--driver/touchpad_st.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/driver/touchpad_st.c b/driver/touchpad_st.c
index ad10470ed9..f66df6ab2a 100644
--- a/driver/touchpad_st.c
+++ b/driver/touchpad_st.c
@@ -113,7 +113,7 @@ static struct {
struct st_tp_host_data_header_t data_header;
struct st_tp_event_t events[32];
uint32_t dump_info[32];
- } /* anonymous */;
+ } __packed /* anonymous */;
} __packed rx_buf;
#ifdef CONFIG_USB_ISOCHRONOUS