greybus: greybus_protocols: Pack structure as required by the module firmware
authorViresh Kumar <viresh.kumar@linaro.org>
Mon, 31 Aug 2015 11:51:03 +0000 (17:21 +0530)
committerJohan Hovold <johan@hovoldconsulting.com>
Thu, 3 Sep 2015 12:24:30 +0000 (14:24 +0200)
These structures are expected to be packed by the module firmware code,
but the kernel wasn't following it until now.

Its all working currently because compiler doesn't add any pad bytes for
these structures, as their elements are already aligned to their size.

But these structures can change in future and we better mark them
packed.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
drivers/staging/greybus/greybus_protocols.h

index 846f3e3..1984e5e 100644 (file)
@@ -172,27 +172,27 @@ struct gb_control_disconnected_request {
 /* Firmware protocol firmware size request/response */
 struct gb_firmware_size_request {
        __u8                    stage;
-};
+} __packed;
 
 struct gb_firmware_size_response {
        __le32                  size;
-};
+} __packed;
 
 /* Firmware protocol get firmware request/response */
 struct gb_firmware_get_firmware_request {
        __le32                  offset;
        __le32                  size;
-};
+} __packed;
 
 struct gb_firmware_get_firmware_response {
        __u8                    data[0];
-};
+} __packed;
 
 /* Firmware protocol Ready to boot request */
 struct gb_firmware_ready_to_boot_request {
        __u8                    stage;
        __u8                    status;
-};
+} __packed;
 /* Firmware protocol Ready to boot response has no payload */
 
 
@@ -756,7 +756,7 @@ struct gb_svc_hello_request {
 struct gb_svc_intf_device_id_request {
        __u8    intf_id;
        __u8    device_id;
-};
+} __packed;
 /* device id response has no payload */
 
 struct gb_svc_intf_hotplug_request {
@@ -772,12 +772,12 @@ struct gb_svc_intf_hotplug_request {
 
 struct gb_svc_intf_hot_unplug_request {
        __u8    intf_id;
-};
+} __packed;
 /* hot unplug response has no payload */
 
 struct gb_svc_intf_reset_request {
        __u8    intf_id;
-};
+} __packed;
 /* interface reset response has no payload */
 
 struct gb_svc_conn_create_request {
@@ -803,7 +803,7 @@ struct gb_svc_route_create_request {
        __u8    dev1_id;
        __u8    intf2_id;
        __u8    dev2_id;
-};
+} __packed;
 /* route create response has no payload */