[PATCH 4/7] uas: Pack iu struct definitions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The iu struct definitions are usb packet definitions, so no alignment should
happen. Notice for most of the structs this does not make a difference
(assuming 32 bit alignment). The only case this actually makes a difference
for is the response_ui struct, which keeps all its members at the same
place, but its size is changed from 8 bytes to 7 bytes.

Signed-off-by: Hans de Goede <hdegoede@xxxxxxxxxx>
---
 include/linux/usb/uas.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/linux/usb/uas.h b/include/linux/usb/uas.h
index 5499ab5..90a0b7b 100644
--- a/include/linux/usb/uas.h
+++ b/include/linux/usb/uas.h
@@ -9,7 +9,7 @@ struct iu {
 	__u8 iu_id;
 	__u8 rsvd1;
 	__be16 tag;
-};
+} __attribute__((__packed__));
 
 enum {
 	IU_ID_COMMAND		= 0x01,
@@ -52,7 +52,7 @@ struct command_iu {
 	__u8 rsvd7;
 	struct scsi_lun lun;
 	__u8 cdb[16];	/* XXX: Overflow-checking tools may misunderstand */
-};
+} __attribute__((__packed__));
 
 struct task_mgmt_iu {
 	__u8 iu_id;
@@ -62,7 +62,7 @@ struct task_mgmt_iu {
 	__u8 rsvd2;
 	__be16 task_tag;
 	struct scsi_lun lun;
-};
+} __attribute__((__packed__));
 
 /*
  * Also used for the Read Ready and Write Ready IUs since they have the
@@ -77,7 +77,7 @@ struct sense_iu {
 	__u8 rsvd7[7];
 	__be16 len;
 	__u8 sense[SCSI_SENSE_BUFFERSIZE];
-};
+} __attribute__((__packed__));
 
 struct response_ui {
 	__u8 iu_id;
@@ -85,7 +85,7 @@ struct response_ui {
 	__be16 tag;
 	__be16 add_response_info;
 	__u8 response_code;
-};
+} __attribute__((__packed__));
 
 struct usb_pipe_usage_descriptor {
 	__u8  bLength;
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux