HID: uhid: use __packed__ for uhid_feature_answer_req

Started by David Herrmann on Dec 17, 2012 · 2 messages from 2 authors · Last reply Jan 3, 2013

Subsystems (2)

Maintainers (2)

STALE5082d

open the first message on its own page

Message details and related content
We use __packed__ for all API structures so we can extend them without
breaking alignment rules. We do try to explicitly align the structures,
but to be safe we also use __packed__.
uhid_feature_answer_req is already 64bit aligned so we can add __packed__
without breaking ABI.

Signed-off-by: David Herrmann <redacted>
---
 include/uapi/linux/uhid.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/uapi/linux/uhid.h b/include/uapi/linux/uhid.h
index 9c6974f..e9ed951 100644
--- a/include/uapi/linux/uhid.h
+++ b/include/uapi/linux/uhid.h
@@ -86,7 +86,7 @@ struct uhid_feature_answer_req {
 	__u16 err;
 	__u16 size;
 	__u8 data[UHID_DATA_MAX];
-};
+} __attribute__((__packed__));
 
 struct uhid_event {
 	__u32 type;
-- 
1.8.0.2
Message details and related content
On Mon, 17 Dec 2012, David Herrmann wrote:
We use __packed__ for all API structures so we can extend them without
breaking alignment rules. We do try to explicitly align the structures,
but to be safe we also use __packed__.
uhid_feature_answer_req is already 64bit aligned so we can add __packed__
without breaking ABI.

Signed-off-by: David Herrmann <redacted>
Applied, thanks David.

-- 
Jiri Kosina
SUSE Labs
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help