greybus: Explicitly mark structures as packed
These structures are already marked as __packed, as these are enclosed within: #pragma pack(push, 1) #pragma pack(pop) Lets mark them __packed explicitly. Reviewed-by: Alex Elder <elder@linaro.org> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
parent
8f8b2297c0
commit
af6e8b4233
@ -13,8 +13,6 @@
|
|||||||
#ifndef __GREYBUS_MANIFEST_H
|
#ifndef __GREYBUS_MANIFEST_H
|
||||||
#define __GREYBUS_MANIFEST_H
|
#define __GREYBUS_MANIFEST_H
|
||||||
|
|
||||||
#pragma pack(push, 1)
|
|
||||||
|
|
||||||
enum greybus_descriptor_type {
|
enum greybus_descriptor_type {
|
||||||
GREYBUS_TYPE_INVALID = 0x00,
|
GREYBUS_TYPE_INVALID = 0x00,
|
||||||
GREYBUS_TYPE_INTERFACE = 0x01,
|
GREYBUS_TYPE_INTERFACE = 0x01,
|
||||||
@ -77,7 +75,7 @@ struct greybus_descriptor_string {
|
|||||||
__u8 length;
|
__u8 length;
|
||||||
__u8 id;
|
__u8 id;
|
||||||
__u8 string[0];
|
__u8 string[0];
|
||||||
};
|
} __packed;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* An interface descriptor describes information about an interface as a whole,
|
* An interface descriptor describes information about an interface as a whole,
|
||||||
@ -90,7 +88,7 @@ struct greybus_descriptor_interface {
|
|||||||
__u8 vendor_stringid;
|
__u8 vendor_stringid;
|
||||||
__u8 product_stringid;
|
__u8 product_stringid;
|
||||||
__le64 unique_id;
|
__le64 unique_id;
|
||||||
};
|
} __packed;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* An bundle descriptor defines an identification number and a class for
|
* An bundle descriptor defines an identification number and a class for
|
||||||
@ -114,7 +112,7 @@ struct greybus_descriptor_interface {
|
|||||||
struct greybus_descriptor_bundle {
|
struct greybus_descriptor_bundle {
|
||||||
__u8 id; /* interface-relative id (0..) */
|
__u8 id; /* interface-relative id (0..) */
|
||||||
__u8 class;
|
__u8 class;
|
||||||
};
|
} __packed;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A CPort descriptor indicates the id of the bundle within the
|
* A CPort descriptor indicates the id of the bundle within the
|
||||||
@ -126,7 +124,7 @@ struct greybus_descriptor_cport {
|
|||||||
__u8 bundle;
|
__u8 bundle;
|
||||||
__le16 id;
|
__le16 id;
|
||||||
__u8 protocol_id; /* enum greybus_protocol */
|
__u8 protocol_id; /* enum greybus_protocol */
|
||||||
};
|
} __packed;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A class descriptor defines functionality supplied by a module.
|
* A class descriptor defines functionality supplied by a module.
|
||||||
@ -134,12 +132,12 @@ struct greybus_descriptor_cport {
|
|||||||
*/
|
*/
|
||||||
struct greybus_descriptor_class {
|
struct greybus_descriptor_class {
|
||||||
__u8 class; /* enum greybus_class_type */
|
__u8 class; /* enum greybus_class_type */
|
||||||
};
|
} __packed;
|
||||||
|
|
||||||
struct greybus_descriptor_header {
|
struct greybus_descriptor_header {
|
||||||
__le16 size;
|
__le16 size;
|
||||||
__u8 type; /* enum greybus_descriptor_type */
|
__u8 type; /* enum greybus_descriptor_type */
|
||||||
};
|
} __packed;
|
||||||
|
|
||||||
struct greybus_descriptor {
|
struct greybus_descriptor {
|
||||||
struct greybus_descriptor_header header;
|
struct greybus_descriptor_header header;
|
||||||
@ -150,19 +148,17 @@ struct greybus_descriptor {
|
|||||||
struct greybus_descriptor_cport cport;
|
struct greybus_descriptor_cport cport;
|
||||||
struct greybus_descriptor_class class;
|
struct greybus_descriptor_class class;
|
||||||
};
|
};
|
||||||
};
|
} __packed;
|
||||||
|
|
||||||
struct greybus_manifest_header {
|
struct greybus_manifest_header {
|
||||||
__le16 size;
|
__le16 size;
|
||||||
__u8 version_major;
|
__u8 version_major;
|
||||||
__u8 version_minor;
|
__u8 version_minor;
|
||||||
};
|
} __packed;
|
||||||
|
|
||||||
struct greybus_manifest {
|
struct greybus_manifest {
|
||||||
struct greybus_manifest_header header;
|
struct greybus_manifest_header header;
|
||||||
struct greybus_descriptor descriptors[0];
|
struct greybus_descriptor descriptors[0];
|
||||||
};
|
} __packed;
|
||||||
|
|
||||||
#pragma pack(pop)
|
|
||||||
|
|
||||||
#endif /* __GREYBUS_MANIFEST_H */
|
#endif /* __GREYBUS_MANIFEST_H */
|
||||||
|
@ -13,8 +13,6 @@
|
|||||||
#ifndef __SVC_MSG_H
|
#ifndef __SVC_MSG_H
|
||||||
#define __SVC_MSG_H
|
#define __SVC_MSG_H
|
||||||
|
|
||||||
#pragma pack(push, 1)
|
|
||||||
|
|
||||||
enum svc_function_id {
|
enum svc_function_id {
|
||||||
SVC_FUNCTION_HANDSHAKE = 0x00,
|
SVC_FUNCTION_HANDSHAKE = 0x00,
|
||||||
SVC_FUNCTION_UNIPRO_NETWORK_MANAGEMENT = 0x01,
|
SVC_FUNCTION_UNIPRO_NETWORK_MANAGEMENT = 0x01,
|
||||||
@ -33,7 +31,7 @@ struct svc_msg_header {
|
|||||||
__u8 function_id; /* enum svc_function_id */
|
__u8 function_id; /* enum svc_function_id */
|
||||||
__u8 message_type;
|
__u8 message_type;
|
||||||
__le16 payload_length;
|
__le16 payload_length;
|
||||||
};
|
} __packed;
|
||||||
|
|
||||||
enum svc_function_handshake_type {
|
enum svc_function_handshake_type {
|
||||||
SVC_HANDSHAKE_SVC_HELLO = 0x00,
|
SVC_HANDSHAKE_SVC_HELLO = 0x00,
|
||||||
@ -45,21 +43,21 @@ struct svc_function_handshake {
|
|||||||
__u8 version_major;
|
__u8 version_major;
|
||||||
__u8 version_minor;
|
__u8 version_minor;
|
||||||
__u8 handshake_type; /* enum svc_function_handshake_type */
|
__u8 handshake_type; /* enum svc_function_handshake_type */
|
||||||
};
|
} __packed;
|
||||||
|
|
||||||
struct svc_function_unipro_set_route {
|
struct svc_function_unipro_set_route {
|
||||||
__u8 device_id;
|
__u8 device_id;
|
||||||
};
|
} __packed;
|
||||||
|
|
||||||
struct svc_function_unipro_link_up {
|
struct svc_function_unipro_link_up {
|
||||||
__u8 interface_id; /* Interface id within the Endo */
|
__u8 interface_id; /* Interface id within the Endo */
|
||||||
__u8 device_id;
|
__u8 device_id;
|
||||||
};
|
} __packed;
|
||||||
|
|
||||||
struct svc_function_ap_id {
|
struct svc_function_ap_id {
|
||||||
__u8 interface_id;
|
__u8 interface_id;
|
||||||
__u8 device_id;
|
__u8 device_id;
|
||||||
};
|
} __packed;
|
||||||
|
|
||||||
enum svc_function_management_event {
|
enum svc_function_management_event {
|
||||||
SVC_MANAGEMENT_AP_ID = 0x00,
|
SVC_MANAGEMENT_AP_ID = 0x00,
|
||||||
@ -74,7 +72,7 @@ struct svc_function_unipro_management {
|
|||||||
struct svc_function_unipro_link_up link_up;
|
struct svc_function_unipro_link_up link_up;
|
||||||
struct svc_function_unipro_set_route set_route;
|
struct svc_function_unipro_set_route set_route;
|
||||||
};
|
};
|
||||||
};
|
} __packed;
|
||||||
|
|
||||||
enum svc_function_hotplug_event {
|
enum svc_function_hotplug_event {
|
||||||
SVC_HOTPLUG_EVENT = 0x00,
|
SVC_HOTPLUG_EVENT = 0x00,
|
||||||
@ -85,7 +83,7 @@ struct svc_function_hotplug {
|
|||||||
__u8 hotplug_event; /* enum svc_function_hotplug_event */
|
__u8 hotplug_event; /* enum svc_function_hotplug_event */
|
||||||
__u8 interface_id; /* Interface id within the Endo */
|
__u8 interface_id; /* Interface id within the Endo */
|
||||||
__u8 data[0];
|
__u8 data[0];
|
||||||
};
|
} __packed;
|
||||||
|
|
||||||
enum svc_function_power_type {
|
enum svc_function_power_type {
|
||||||
SVC_POWER_BATTERY_STATUS = 0x00,
|
SVC_POWER_BATTERY_STATUS = 0x00,
|
||||||
@ -104,10 +102,10 @@ struct svc_function_power_battery_status {
|
|||||||
__le16 charge_full;
|
__le16 charge_full;
|
||||||
__le16 charge_now;
|
__le16 charge_now;
|
||||||
__u8 status; /* enum svc_function_battery_status */
|
__u8 status; /* enum svc_function_battery_status */
|
||||||
};
|
} __packed;
|
||||||
|
|
||||||
struct svc_function_power_battery_status_request {
|
struct svc_function_power_battery_status_request {
|
||||||
};
|
} __packed;
|
||||||
|
|
||||||
/* XXX
|
/* XXX
|
||||||
* Each interface carries power, so it's possible these things
|
* Each interface carries power, so it's possible these things
|
||||||
@ -121,7 +119,7 @@ struct svc_function_power {
|
|||||||
struct svc_function_power_battery_status status;
|
struct svc_function_power_battery_status status;
|
||||||
struct svc_function_power_battery_status_request request;
|
struct svc_function_power_battery_status_request request;
|
||||||
};
|
};
|
||||||
};
|
} __packed;
|
||||||
|
|
||||||
enum svc_function_epm_command_type {
|
enum svc_function_epm_command_type {
|
||||||
SVC_EPM_ENABLE = 0x00,
|
SVC_EPM_ENABLE = 0x00,
|
||||||
@ -132,7 +130,7 @@ enum svc_function_epm_command_type {
|
|||||||
struct svc_function_epm {
|
struct svc_function_epm {
|
||||||
__u8 epm_command_type; /* enum svc_function_epm_command_type */
|
__u8 epm_command_type; /* enum svc_function_epm_command_type */
|
||||||
__u8 module_id;
|
__u8 module_id;
|
||||||
};
|
} __packed;
|
||||||
|
|
||||||
enum svc_function_suspend_command_type {
|
enum svc_function_suspend_command_type {
|
||||||
SVC_SUSPEND_FIXME_1 = 0x00, // FIXME
|
SVC_SUSPEND_FIXME_1 = 0x00, // FIXME
|
||||||
@ -143,7 +141,7 @@ enum svc_function_suspend_command_type {
|
|||||||
struct svc_function_suspend {
|
struct svc_function_suspend {
|
||||||
__u8 suspend_command_type; /* enum function_suspend_command_type */
|
__u8 suspend_command_type; /* enum function_suspend_command_type */
|
||||||
__u8 device_id;
|
__u8 device_id;
|
||||||
};
|
} __packed;
|
||||||
|
|
||||||
struct svc_msg {
|
struct svc_msg {
|
||||||
struct svc_msg_header header;
|
struct svc_msg_header header;
|
||||||
@ -155,8 +153,6 @@ struct svc_msg {
|
|||||||
struct svc_function_epm epm;
|
struct svc_function_epm epm;
|
||||||
struct svc_function_suspend suspend;
|
struct svc_function_suspend suspend;
|
||||||
};
|
};
|
||||||
};
|
} __packed;
|
||||||
|
|
||||||
#pragma pack(pop)
|
|
||||||
|
|
||||||
#endif /* __SVC_MSG_H */
|
#endif /* __SVC_MSG_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user