common: shuffle use of __attribute__((packed))

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>
This commit is contained in:
Andrew Cooper authored and Jan Beulich committed 2014-03-14 09:43:37 +01:00
1 parent f8be76e2fe
commit b683d68c38
5 files changed
+13 -11

No files matched your search

+4 -4
View 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) \
+2 -2
View 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
+4 -4
View 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
+1 -1
View 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) \
+2
View 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
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.