]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
common: shuffle use of __attribute__((packed))
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 14 Mar 2014 08:43:37 +0000 (09:43 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 14 Mar 2014 08:43:37 +0000 (09:43 +0100)
This introduced a formal define in compiler.h, and is otherwise manual
shuffling of __attribute__((packed)) statements to __packed at the head of the
structure.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/common/trace.c
xen/common/unlzma.c
xen/drivers/char/ehci-dbgp.c
xen/include/xen/compat.h
xen/include/xen/compiler.h

index 73ba57c91505da617fc1cdc57bafe86c927bebec..1814165f9b82061cd9d8d3e2ff136fb53ee21a8f 100644 (file)
@@ -641,11 +641,11 @@ static inline void insert_wrap_record(struct t_buf *buf,
 
 static inline void insert_lost_records(struct t_buf *buf)
 {
-    struct {
+    struct __packed {
         u32 lost_records;
         u16 did, vid;
         u64 first_tsc;
-    } __attribute__((packed)) ed;
+    } ed;
 
     ed.vid = current->vcpu_id;
     ed.did = current->domain->domain_id;
@@ -819,10 +819,10 @@ unlock:
 void __trace_hypercall(uint32_t event, unsigned long op,
                        const unsigned long *args)
 {
-    struct {
+    struct __packed {
         uint32_t op;
         uint32_t args[6];
-    } __attribute__((packed)) d;
+    } d;
     uint32_t *a = d.args;
 
 #define APPEND_ARG32(i)                         \
index 4d043308f97e0f301f5d0fd2ed78bbf01a1dc713..103d2df596aeb9178131f0f2a8a09bed2ad744a7 100644 (file)
@@ -214,11 +214,11 @@ rc_bit_tree_decode(struct rc *rc, uint16_t *p, int num_levels, int *symbol)
  */
 
 
-struct lzma_header {
+struct __packed lzma_header {
        uint8_t pos;
        uint32_t dict_size;
        uint64_t dst_size;
-} __attribute__ ((packed)) ;
+};
 
 
 #define LZMA_BASE_SIZE 1846
index b900d6092edbed39ca11a212601e2a9f9bb11488..3feeafea5be99143b2829a6240ee65e2bdc3ea96 100644 (file)
@@ -251,25 +251,25 @@ struct ehci_dbg_port {
  * For most devices, interfaces don't coordinate with each other, so
  * such requests may be made at any time.
  */
-struct usb_ctrlrequest {
+struct __packed usb_ctrlrequest {
     u8 bRequestType;
     u8 bRequest;
     __le16 wValue;
     __le16 wIndex;
     __le16 wLength;
-} __attribute__ ((packed));
+};
 
 /* USB_DT_DEBUG: for special highspeed devices, replacing serial console */
 
 #define USB_DT_DEBUG    0x0a
 
-struct usb_debug_descriptor {
+struct __packed usb_debug_descriptor {
     u8 bLength;
     u8 bDescriptorType;
     /* bulk endpoints with 8 byte maxpacket */
     u8 bDebugInEndpoint;
     u8 bDebugOutEndpoint;
-} __attribute__((packed));
+};
 
 #define USB_DEBUG_DEVNUM 127
 
index ca606999ab3d5ef392492b47d9c36f50be6f915c..d58aede8a97c6d7ecfcead80bf208212f40a103f 100644 (file)
@@ -14,7 +14,7 @@
 #define __DEFINE_COMPAT_HANDLE(name, type) \
     typedef struct { \
         compat_ptr_t c; \
-        type *_[0] __attribute__((__packed__)); \
+        type *_[0] __packed; \
     } __compat_handle_ ## name
 
 #define DEFINE_COMPAT_HANDLE(name) \
index c80398d9c70d4de4164c5415a2048ed3ae9a618a..6e07990f23cd776853ee68487ddf855a84347dd2 100644 (file)
@@ -16,6 +16,8 @@
 
 #define noreturn      __attribute__((noreturn))
 
+#define __packed      __attribute__((packed))
+
 #if (!defined(__clang__) && (__GNUC__ == 4) && (__GNUC_MINOR__ < 5))
 #define unreachable() do {} while (1)
 #else