Commit 3c4a9413 authored by Timo von Holtz's avatar Timo von Holtz Committed by Greg Kroah-Hartman

Staging: hv: replaced __attribute((packed)) with __packed

Replaced __attribute((packed)) with __packed as it's preferred
Signed-off-by: default avatarTimo von Holtz <tvh@informatik.uni-kiel.de>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 56463de0
...@@ -37,7 +37,7 @@ struct vmbus_channel_packet_page_buffer { ...@@ -37,7 +37,7 @@ struct vmbus_channel_packet_page_buffer {
u32 reserved; u32 reserved;
u32 rangecount; u32 rangecount;
struct hv_page_buffer range[MAX_PAGE_BUFFER_COUNT]; struct hv_page_buffer range[MAX_PAGE_BUFFER_COUNT];
} __attribute__((packed)); } __packed;
/* The format must be the same as struct vmdata_gpa_direct */ /* The format must be the same as struct vmdata_gpa_direct */
struct vmbus_channel_packet_multipage_buffer { struct vmbus_channel_packet_multipage_buffer {
...@@ -49,7 +49,7 @@ struct vmbus_channel_packet_multipage_buffer { ...@@ -49,7 +49,7 @@ struct vmbus_channel_packet_multipage_buffer {
u32 reserved; u32 reserved;
u32 rangecount; /* Always 1 in this case */ u32 rangecount; /* Always 1 in this case */
struct hv_multipage_buffer range; struct hv_multipage_buffer range;
} __attribute__((packed)); } __packed;
extern int vmbus_open(struct vmbus_channel *channel, extern int vmbus_open(struct vmbus_channel *channel,
......
...@@ -60,19 +60,19 @@ enum vmbus_channel_message_type { ...@@ -60,19 +60,19 @@ enum vmbus_channel_message_type {
struct vmbus_channel_message_header { struct vmbus_channel_message_header {
enum vmbus_channel_message_type msgtype; enum vmbus_channel_message_type msgtype;
u32 padding; u32 padding;
} __attribute__((packed)); } __packed;
/* Query VMBus Version parameters */ /* Query VMBus Version parameters */
struct vmbus_channel_query_vmbus_version { struct vmbus_channel_query_vmbus_version {
struct vmbus_channel_message_header header; struct vmbus_channel_message_header header;
u32 version; u32 version;
} __attribute__((packed)); } __packed;
/* VMBus Version Supported parameters */ /* VMBus Version Supported parameters */
struct vmbus_channel_version_supported { struct vmbus_channel_version_supported {
struct vmbus_channel_message_header header; struct vmbus_channel_message_header header;
bool version_supported; bool version_supported;
} __attribute__((packed)); } __packed;
/* Offer Channel parameters */ /* Offer Channel parameters */
struct vmbus_channel_offer_channel { struct vmbus_channel_offer_channel {
...@@ -81,13 +81,13 @@ struct vmbus_channel_offer_channel { ...@@ -81,13 +81,13 @@ struct vmbus_channel_offer_channel {
u32 child_relid; u32 child_relid;
u8 monitorid; u8 monitorid;
bool monitor_allocated; bool monitor_allocated;
} __attribute__((packed)); } __packed;
/* Rescind Offer parameters */ /* Rescind Offer parameters */
struct vmbus_channel_rescind_offer { struct vmbus_channel_rescind_offer {
struct vmbus_channel_message_header header; struct vmbus_channel_message_header header;
u32 child_relid; u32 child_relid;
} __attribute__((packed)); } __packed;
/* /*
* Request Offer -- no parameters, SynIC message contains the partition ID * Request Offer -- no parameters, SynIC message contains the partition ID
...@@ -123,7 +123,7 @@ struct vmbus_channel_open_channel { ...@@ -123,7 +123,7 @@ struct vmbus_channel_open_channel {
/* User-specific data to be passed along to the server endpoint. */ /* User-specific data to be passed along to the server endpoint. */
unsigned char userdata[MAX_USER_DEFINED_BYTES]; unsigned char userdata[MAX_USER_DEFINED_BYTES];
} __attribute__((packed)); } __packed;
/* Open Channel Result parameters */ /* Open Channel Result parameters */
struct vmbus_channel_open_result { struct vmbus_channel_open_result {
...@@ -131,13 +131,13 @@ struct vmbus_channel_open_result { ...@@ -131,13 +131,13 @@ struct vmbus_channel_open_result {
u32 child_relid; u32 child_relid;
u32 openid; u32 openid;
u32 status; u32 status;
} __attribute__((packed)); } __packed;
/* Close channel parameters; */ /* Close channel parameters; */
struct vmbus_channel_close_channel { struct vmbus_channel_close_channel {
struct vmbus_channel_message_header header; struct vmbus_channel_message_header header;
u32 child_relid; u32 child_relid;
} __attribute__((packed)); } __packed;
/* Channel Message GPADL */ /* Channel Message GPADL */
#define GPADL_TYPE_RING_BUFFER 1 #define GPADL_TYPE_RING_BUFFER 1
...@@ -157,7 +157,7 @@ struct vmbus_channel_gpadl_header { ...@@ -157,7 +157,7 @@ struct vmbus_channel_gpadl_header {
u16 range_buflen; u16 range_buflen;
u16 rangecount; u16 rangecount;
struct gpa_range range[0]; struct gpa_range range[0];
} __attribute__((packed)); } __packed;
/* This is the followup packet that contains more PFNs. */ /* This is the followup packet that contains more PFNs. */
struct vmbus_channel_gpadl_body { struct vmbus_channel_gpadl_body {
...@@ -165,25 +165,25 @@ struct vmbus_channel_gpadl_body { ...@@ -165,25 +165,25 @@ struct vmbus_channel_gpadl_body {
u32 msgnumber; u32 msgnumber;
u32 gpadl; u32 gpadl;
u64 pfn[0]; u64 pfn[0];
} __attribute__((packed)); } __packed;
struct vmbus_channel_gpadl_created { struct vmbus_channel_gpadl_created {
struct vmbus_channel_message_header header; struct vmbus_channel_message_header header;
u32 child_relid; u32 child_relid;
u32 gpadl; u32 gpadl;
u32 creation_status; u32 creation_status;
} __attribute__((packed)); } __packed;
struct vmbus_channel_gpadl_teardown { struct vmbus_channel_gpadl_teardown {
struct vmbus_channel_message_header header; struct vmbus_channel_message_header header;
u32 child_relid; u32 child_relid;
u32 gpadl; u32 gpadl;
} __attribute__((packed)); } __packed;
struct vmbus_channel_gpadl_torndown { struct vmbus_channel_gpadl_torndown {
struct vmbus_channel_message_header header; struct vmbus_channel_message_header header;
u32 gpadl; u32 gpadl;
} __attribute__((packed)); } __packed;
#ifdef VMBUS_FEATURE_PARENT_OR_PEER_MEMORY_MAPPED_INTO_A_CHILD #ifdef VMBUS_FEATURE_PARENT_OR_PEER_MEMORY_MAPPED_INTO_A_CHILD
struct vmbus_channel_view_range_add { struct vmbus_channel_view_range_add {
...@@ -191,19 +191,19 @@ struct vmbus_channel_view_range_add { ...@@ -191,19 +191,19 @@ struct vmbus_channel_view_range_add {
PHYSICAL_ADDRESS viewrange_base; PHYSICAL_ADDRESS viewrange_base;
u64 viewrange_length; u64 viewrange_length;
u32 child_relid; u32 child_relid;
} __attribute__((packed)); } __packed;
struct vmbus_channel_view_range_remove { struct vmbus_channel_view_range_remove {
struct vmbus_channel_message_header header; struct vmbus_channel_message_header header;
PHYSICAL_ADDRESS viewrange_base; PHYSICAL_ADDRESS viewrange_base;
u32 child_relid; u32 child_relid;
} __attribute__((packed)); } __packed;
#endif #endif
struct vmbus_channel_relid_released { struct vmbus_channel_relid_released {
struct vmbus_channel_message_header header; struct vmbus_channel_message_header header;
u32 child_relid; u32 child_relid;
} __attribute__((packed)); } __packed;
struct vmbus_channel_initiate_contact { struct vmbus_channel_initiate_contact {
struct vmbus_channel_message_header header; struct vmbus_channel_message_header header;
...@@ -212,12 +212,12 @@ struct vmbus_channel_initiate_contact { ...@@ -212,12 +212,12 @@ struct vmbus_channel_initiate_contact {
u64 interrupt_page; u64 interrupt_page;
u64 monitor_page1; u64 monitor_page1;
u64 monitor_page2; u64 monitor_page2;
} __attribute__((packed)); } __packed;
struct vmbus_channel_version_response { struct vmbus_channel_version_response {
struct vmbus_channel_message_header header; struct vmbus_channel_message_header header;
bool version_supported; bool version_supported;
} __attribute__((packed)); } __packed;
enum vmbus_channel_state { enum vmbus_channel_state {
CHANNEL_OFFER_STATE, CHANNEL_OFFER_STATE,
......
...@@ -92,7 +92,7 @@ struct nvsp_message_header { ...@@ -92,7 +92,7 @@ struct nvsp_message_header {
struct nvsp_message_init { struct nvsp_message_init {
u32 min_protocol_ver; u32 min_protocol_ver;
u32 max_protocol_ver; u32 max_protocol_ver;
} __attribute__((packed)); } __packed;
/* /*
* This message is used by the VSP to complete the initialization of the * This message is used by the VSP to complete the initialization of the
...@@ -103,12 +103,12 @@ struct nvsp_message_init_complete { ...@@ -103,12 +103,12 @@ struct nvsp_message_init_complete {
u32 negotiated_protocol_ver; u32 negotiated_protocol_ver;
u32 max_mdl_chain_len; u32 max_mdl_chain_len;
u32 status; u32 status;
} __attribute__((packed)); } __packed;
union nvsp_message_init_uber { union nvsp_message_init_uber {
struct nvsp_message_init init; struct nvsp_message_init init;
struct nvsp_message_init_complete init_complete; struct nvsp_message_init_complete init_complete;
} __attribute__((packed)); } __packed;
/* Version 1 Messages */ /* Version 1 Messages */
...@@ -119,7 +119,7 @@ union nvsp_message_init_uber { ...@@ -119,7 +119,7 @@ union nvsp_message_init_uber {
struct nvsp_1_message_send_ndis_version { struct nvsp_1_message_send_ndis_version {
u32 ndis_major_ver; u32 ndis_major_ver;
u32 ndis_minor_ver; u32 ndis_minor_ver;
} __attribute__((packed)); } __packed;
/* /*
* This message is used by the VSC to send a receive buffer to the VSP. The VSP * This message is used by the VSC to send a receive buffer to the VSP. The VSP
...@@ -128,14 +128,14 @@ struct nvsp_1_message_send_ndis_version { ...@@ -128,14 +128,14 @@ struct nvsp_1_message_send_ndis_version {
struct nvsp_1_message_send_receive_buffer { struct nvsp_1_message_send_receive_buffer {
u32 gpadl_handle; u32 gpadl_handle;
u16 id; u16 id;
} __attribute__((packed)); } __packed;
struct nvsp_1_receive_buffer_section { struct nvsp_1_receive_buffer_section {
u32 offset; u32 offset;
u32 sub_alloc_size; u32 sub_alloc_size;
u32 num_sub_allocs; u32 num_sub_allocs;
u32 end_offset; u32 end_offset;
} __attribute__((packed)); } __packed;
/* /*
* This message is used by the VSP to acknowledge a receive buffer send by the * This message is used by the VSP to acknowledge a receive buffer send by the
...@@ -166,7 +166,7 @@ struct nvsp_1_message_send_receive_buffer_complete { ...@@ -166,7 +166,7 @@ struct nvsp_1_message_send_receive_buffer_complete {
*/ */
struct nvsp_1_receive_buffer_section sections[1]; struct nvsp_1_receive_buffer_section sections[1];
} __attribute__((packed)); } __packed;
/* /*
* This message is sent by the VSC to revoke the receive buffer. After the VSP * This message is sent by the VSC to revoke the receive buffer. After the VSP
...@@ -184,7 +184,7 @@ struct nvsp_1_message_revoke_receive_buffer { ...@@ -184,7 +184,7 @@ struct nvsp_1_message_revoke_receive_buffer {
struct nvsp_1_message_send_send_buffer { struct nvsp_1_message_send_send_buffer {
u32 gpadl_handle; u32 gpadl_handle;
u16 id; u16 id;
} __attribute__((packed)); } __packed;
/* /*
* This message is used by the VSP to acknowledge a send buffer sent by the * This message is used by the VSP to acknowledge a send buffer sent by the
...@@ -201,7 +201,7 @@ struct nvsp_1_message_send_send_buffer_complete { ...@@ -201,7 +201,7 @@ struct nvsp_1_message_send_send_buffer_complete {
* decreases. * decreases.
*/ */
u32 section_size; u32 section_size;
} __attribute__((packed)); } __packed;
/* /*
* This message is sent by the VSC to revoke the send buffer. After the VSP * This message is sent by the VSC to revoke the send buffer. After the VSP
...@@ -231,7 +231,7 @@ struct nvsp_1_message_send_rndis_packet { ...@@ -231,7 +231,7 @@ struct nvsp_1_message_send_rndis_packet {
*/ */
u32 send_buf_section_index; u32 send_buf_section_index;
u32 send_buf_section_size; u32 send_buf_section_size;
} __attribute__((packed)); } __packed;
/* /*
* This message is used by both the VSP and the VSC to complete a RNDIS message * This message is used by both the VSP and the VSC to complete a RNDIS message
...@@ -257,18 +257,18 @@ union nvsp_1_message_uber { ...@@ -257,18 +257,18 @@ union nvsp_1_message_uber {
struct nvsp_1_message_send_rndis_packet send_rndis_pkt; struct nvsp_1_message_send_rndis_packet send_rndis_pkt;
struct nvsp_1_message_send_rndis_packet_complete struct nvsp_1_message_send_rndis_packet_complete
send_rndis_pkt_complete; send_rndis_pkt_complete;
} __attribute__((packed)); } __packed;
union nvsp_all_messages { union nvsp_all_messages {
union nvsp_message_init_uber init_msg; union nvsp_message_init_uber init_msg;
union nvsp_1_message_uber v1_msg; union nvsp_1_message_uber v1_msg;
} __attribute__((packed)); } __packed;
/* ALL Messages */ /* ALL Messages */
struct nvsp_message { struct nvsp_message {
struct nvsp_message_header hdr; struct nvsp_message_header hdr;
union nvsp_all_messages msg; union nvsp_all_messages msg;
} __attribute__((packed)); } __packed;
......
...@@ -51,7 +51,7 @@ struct hv_ring_buffer { ...@@ -51,7 +51,7 @@ struct hv_ring_buffer {
* !!! DO NOT place any fields below this !!! * !!! DO NOT place any fields below this !!!
*/ */
u8 buffer[0]; u8 buffer[0];
} __attribute__((packed)); } __packed;
struct hv_ring_buffer_info { struct hv_ring_buffer_info {
struct hv_ring_buffer *ring_buffer; struct hv_ring_buffer *ring_buffer;
......
...@@ -43,12 +43,12 @@ ...@@ -43,12 +43,12 @@
struct vmbuspipe_hdr { struct vmbuspipe_hdr {
u32 flags; u32 flags;
u32 msgsize; u32 msgsize;
} __attribute__((packed)); } __packed;
struct ic_version { struct ic_version {
u16 major; u16 major;
u16 minor; u16 minor;
} __attribute__((packed)); } __packed;
struct icmsg_hdr { struct icmsg_hdr {
struct ic_version icverframe; struct ic_version icverframe;
...@@ -59,26 +59,26 @@ struct icmsg_hdr { ...@@ -59,26 +59,26 @@ struct icmsg_hdr {
u8 ictransaction_id; u8 ictransaction_id;
u8 icflags; u8 icflags;
u8 reserved[2]; u8 reserved[2];
} __attribute__((packed)); } __packed;
struct icmsg_negotiate { struct icmsg_negotiate {
u16 icframe_vercnt; u16 icframe_vercnt;
u16 icmsg_vercnt; u16 icmsg_vercnt;
u32 reserved; u32 reserved;
struct ic_version icversion_data[1]; /* any size array */ struct ic_version icversion_data[1]; /* any size array */
} __attribute__((packed)); } __packed;
struct shutdown_msg_data { struct shutdown_msg_data {
u32 reason_code; u32 reason_code;
u32 timeout_seconds; u32 timeout_seconds;
u32 flags; u32 flags;
u8 display_message[2048]; u8 display_message[2048];
} __attribute__((packed)); } __packed;
struct heartbeat_msg_data { struct heartbeat_msg_data {
u64 seq_num; u64 seq_num;
u32 reserved[8]; u32 reserved[8];
} __attribute__((packed)); } __packed;
/* Time Sync IC defs */ /* Time Sync IC defs */
#define ICTIMESYNCFLAG_PROBE 0 #define ICTIMESYNCFLAG_PROBE 0
...@@ -96,7 +96,7 @@ struct ictimesync_data{ ...@@ -96,7 +96,7 @@ struct ictimesync_data{
u64 childtime; u64 childtime;
u64 roundtriptime; u64 roundtriptime;
u8 flags; u8 flags;
} __attribute__((packed)); } __packed;
/* Index for each IC struct in array hv_cb_utils[] */ /* Index for each IC struct in array hv_cb_utils[] */
#define HV_SHUTDOWN_MSG 0 #define HV_SHUTDOWN_MSG 0
......
...@@ -75,7 +75,7 @@ struct vmbus_channel_offer { ...@@ -75,7 +75,7 @@ struct vmbus_channel_offer {
} pipe; } pipe;
} u; } u;
u32 padding; u32 padding;
} __attribute__((packed)); } __packed;
/* Server Flags */ /* Server Flags */
#define VMBUS_CHANNEL_ENUMERATE_DEVICE_INTERFACE 1 #define VMBUS_CHANNEL_ENUMERATE_DEVICE_INTERFACE 1
......
...@@ -30,17 +30,17 @@ struct vmpacket_descriptor { ...@@ -30,17 +30,17 @@ struct vmpacket_descriptor {
u16 len8; u16 len8;
u16 flags; u16 flags;
u64 trans_id; u64 trans_id;
} __attribute__((packed)); } __packed;
struct vmpacket_header { struct vmpacket_header {
u32 prev_pkt_start_offset; u32 prev_pkt_start_offset;
struct vmpacket_descriptor descriptor; struct vmpacket_descriptor descriptor;
} __attribute__((packed)); } __packed;
struct vmtransfer_page_range { struct vmtransfer_page_range {
u32 byte_count; u32 byte_count;
u32 byte_offset; u32 byte_offset;
} __attribute__((packed)); } __packed;
struct vmtransfer_page_packet_header { struct vmtransfer_page_packet_header {
struct vmpacket_descriptor d; struct vmpacket_descriptor d;
...@@ -49,20 +49,20 @@ struct vmtransfer_page_packet_header { ...@@ -49,20 +49,20 @@ struct vmtransfer_page_packet_header {
u8 reserved; u8 reserved;
u32 range_cnt; u32 range_cnt;
struct vmtransfer_page_range ranges[1]; struct vmtransfer_page_range ranges[1];
} __attribute__((packed)); } __packed;
struct vmgpadl_packet_header { struct vmgpadl_packet_header {
struct vmpacket_descriptor d; struct vmpacket_descriptor d;
u32 gpadl; u32 gpadl;
u32 reserved; u32 reserved;
} __attribute__((packed)); } __packed;
struct vmadd_remove_transfer_page_set { struct vmadd_remove_transfer_page_set {
struct vmpacket_descriptor d; struct vmpacket_descriptor d;
u32 gpadl; u32 gpadl;
u16 xfer_pageset_id; u16 xfer_pageset_id;
u16 reserved; u16 reserved;
} __attribute__((packed)); } __packed;
/* /*
* This structure defines a range in guest physical space that can be made to * This structure defines a range in guest physical space that can be made to
...@@ -86,7 +86,7 @@ struct vmestablish_gpadl { ...@@ -86,7 +86,7 @@ struct vmestablish_gpadl {
u32 gpadl; u32 gpadl;
u32 range_cnt; u32 range_cnt;
struct gpa_range range[1]; struct gpa_range range[1];
} __attribute__((packed)); } __packed;
/* /*
* This is the format for a Teardown Gpadl packet, which indicates that the * This is the format for a Teardown Gpadl packet, which indicates that the
...@@ -96,7 +96,7 @@ struct vmteardown_gpadl { ...@@ -96,7 +96,7 @@ struct vmteardown_gpadl {
struct vmpacket_descriptor d; struct vmpacket_descriptor d;
u32 gpadl; u32 gpadl;
u32 reserved; /* for alignment to a 8-byte boundary */ u32 reserved; /* for alignment to a 8-byte boundary */
} __attribute__((packed)); } __packed;
/* /*
* This is the format for a GPA-Direct packet, which contains a set of GPA * This is the format for a GPA-Direct packet, which contains a set of GPA
...@@ -107,7 +107,7 @@ struct vmdata_gpa_direct { ...@@ -107,7 +107,7 @@ struct vmdata_gpa_direct {
u32 reserved; u32 reserved;
u32 range_cnt; u32 range_cnt;
struct gpa_range range[1]; struct gpa_range range[1];
} __attribute__((packed)); } __packed;
/* This is the format for a Additional Data Packet. */ /* This is the format for a Additional Data Packet. */
struct vmadditional_data { struct vmadditional_data {
...@@ -116,7 +116,7 @@ struct vmadditional_data { ...@@ -116,7 +116,7 @@ struct vmadditional_data {
u32 offset; u32 offset;
u32 byte_cnt; u32 byte_cnt;
unsigned char data[1]; unsigned char data[1];
} __attribute__((packed)); } __packed;
union vmpacket_largest_possible_header { union vmpacket_largest_possible_header {
struct vmpacket_descriptor simple_hdr; struct vmpacket_descriptor simple_hdr;
......
...@@ -135,7 +135,7 @@ struct vmstorage_channel_properties { ...@@ -135,7 +135,7 @@ struct vmstorage_channel_properties {
/* This id is unique for each channel and will correspond with */ /* This id is unique for each channel and will correspond with */
/* vendor specific data in the inquirydata */ /* vendor specific data in the inquirydata */
unsigned long long unique_id; unsigned long long unique_id;
} __attribute__((packed)); } __packed;
/* This structure is sent during the storage protocol negotiations. */ /* This structure is sent during the storage protocol negotiations. */
struct vmstorage_protocol_version { struct vmstorage_protocol_version {
...@@ -149,7 +149,7 @@ struct vmstorage_protocol_version { ...@@ -149,7 +149,7 @@ struct vmstorage_protocol_version {
* builds. * builds.
*/ */
unsigned short revision; unsigned short revision;
} __attribute__((packed)); } __packed;
/* Channel Property Flags */ /* Channel Property Flags */
#define STORAGE_CHANNEL_REMOVABLE_FLAG 0x1 #define STORAGE_CHANNEL_REMOVABLE_FLAG 0x1
...@@ -179,7 +179,7 @@ struct vstor_packet { ...@@ -179,7 +179,7 @@ struct vstor_packet {
/* Used during version negotiations. */ /* Used during version negotiations. */
struct vmstorage_protocol_version version; struct vmstorage_protocol_version version;
}; };
} __attribute__((packed)); } __packed;
/* Packet flags */ /* Packet flags */
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment