xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xen.org>
Cc: Keir Fraser <keir@xen.org>, Jan Beulich <JBeulich@suse.com>,
	George Dunlap <george.dunlap@eu.citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Eddie Dong <eddie.dong@intel.com>,
	Jun Nakajima <jun.nakajima@intel.com>
Subject: [PATCH 1/5] xen: Remove redundant __attribute__((packed)) statements
Date: Wed, 12 Mar 2014 19:08:35 +0000	[thread overview]
Message-ID: <1394651319-8893-2-git-send-email-andrew.cooper3@citrix.com> (raw)
In-Reply-To: <1394651319-8893-1-git-send-email-andrew.cooper3@citrix.com>

All of these structure packing statements are redundant, and was confirmed by
diffing xen-syms with and without the change in place.

Removing struct xgt_desc in its entirety (as it was unreferenced) results in
shuffling the symbol index, but makes no change to the code.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Keir Fraser <keir@xen.org>
CC: Jan Beulich <JBeulich@suse.com>
CC: Jun Nakajima <jun.nakajima@intel.com>
CC: Eddie Dong <eddie.dong@intel.com>
CC: George Dunlap <george.dunlap@eu.citrix.com>
---
 xen/arch/x86/hvm/vmx/vmcs.c       |    5 -----
 xen/arch/x86/oprofile/backtrace.c |    4 ++--
 xen/arch/x86/trace.c              |    6 +++---
 xen/common/trace.c                |    2 +-
 xen/drivers/char/ehci-dbgp.c      |    4 ++--
 xen/include/asm-x86/edd.h         |   30 +++++++++++++++---------------
 6 files changed, 23 insertions(+), 28 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 9ffb4af..4b886e5 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -670,11 +670,6 @@ void vmx_vmcs_exit(struct vcpu *v)
     }
 }
 
-struct xgt_desc {
-    unsigned short size;
-    unsigned long address __attribute__((packed));
-};
-
 static void vmx_set_host_env(struct vcpu *v)
 {
     unsigned int cpu = smp_processor_id();
diff --git a/xen/arch/x86/oprofile/backtrace.c b/xen/arch/x86/oprofile/backtrace.c
index b3ea7f3..354ebff 100644
--- a/xen/arch/x86/oprofile/backtrace.c
+++ b/xen/arch/x86/oprofile/backtrace.c
@@ -18,14 +18,14 @@
 struct frame_head {
     struct frame_head * ebp;
     unsigned long ret;
-} __attribute__((packed));
+};
 typedef struct frame_head frame_head_t;
 DEFINE_XEN_GUEST_HANDLE(frame_head_t);
 
 struct frame_head_32bit {
     uint32_t ebp;
     uint32_t ret;
-} __attribute__((packed));
+};
 typedef struct frame_head_32bit frame_head32_t;
 DEFINE_COMPAT_HANDLE(frame_head32_t);
 
diff --git a/xen/arch/x86/trace.c b/xen/arch/x86/trace.c
index b1804a4..652c4e3 100644
--- a/xen/arch/x86/trace.c
+++ b/xen/arch/x86/trace.c
@@ -127,7 +127,7 @@ void __trace_trap_two_addr(unsigned event, unsigned long va1,
     {
         struct {
             u32 va1, va2;
-        } __attribute__((packed)) d;
+        } d;
         d.va1=va1;
         d.va2=va2;
         __trace_var(event, 1, sizeof(d), &d);
@@ -136,7 +136,7 @@ void __trace_trap_two_addr(unsigned event, unsigned long va1,
     {
         struct {
             unsigned long va1, va2;
-        } __attribute__((packed)) d;
+        } d;
         d.va1=va1;
         d.va2=va2;
         event |= TRC_64_FLAG;
@@ -161,7 +161,7 @@ void __trace_ptwr_emulation(unsigned long addr, l1_pgentry_t npte)
         struct {
             l1_pgentry_t pte;
             u32 addr, eip;
-        } __attribute__((packed)) d;
+        } d;
         d.addr = addr;
         d.eip = eip;
         d.pte = npte;
diff --git a/xen/common/trace.c b/xen/common/trace.c
index 41ddc33..dde662f 100644
--- a/xen/common/trace.c
+++ b/xen/common/trace.c
@@ -822,7 +822,7 @@ void __trace_hypercall(uint32_t event, unsigned long op,
     struct {
         uint32_t op;
         uint32_t args[6];
-    } __attribute__((packed)) d;
+    } d;
     uint32_t *a = d.args;
 
 #define APPEND_ARG32(i)                         \
diff --git a/xen/drivers/char/ehci-dbgp.c b/xen/drivers/char/ehci-dbgp.c
index b900d60..61417bd 100644
--- a/xen/drivers/char/ehci-dbgp.c
+++ b/xen/drivers/char/ehci-dbgp.c
@@ -257,7 +257,7 @@ struct usb_ctrlrequest {
     __le16 wValue;
     __le16 wIndex;
     __le16 wLength;
-} __attribute__ ((packed));
+};
 
 /* USB_DT_DEBUG: for special highspeed devices, replacing serial console */
 
@@ -269,7 +269,7 @@ struct usb_debug_descriptor {
     /* bulk endpoints with 8 byte maxpacket */
     u8 bDebugInEndpoint;
     u8 bDebugOutEndpoint;
-} __attribute__((packed));
+};
 
 #define USB_DEBUG_DEVNUM 127
 
diff --git a/xen/include/asm-x86/edd.h b/xen/include/asm-x86/edd.h
index 5544ba5..57d4bff 100644
--- a/xen/include/asm-x86/edd.h
+++ b/xen/include/asm-x86/edd.h
@@ -55,27 +55,27 @@ struct edd_info {
                 u16 base_address;
                 u16 reserved1;
                 u32 reserved2;
-            } __attribute__ ((packed)) isa;
+            } isa;
             struct {
                 u8 bus;
                 u8 slot;
                 u8 function;
                 u8 channel;
                 u32 reserved;
-            } __attribute__ ((packed)) pci;
+            } pci;
             /* pcix is same as pci */
             struct {
                 u64 reserved;
-            } __attribute__ ((packed)) ibnd;
+            } ibnd;
             struct {
                 u64 reserved;
-            } __attribute__ ((packed)) xprs;
+            } xprs;
             struct {
                 u64 reserved;
-            } __attribute__ ((packed)) htpt;
+            } htpt;
             struct {
                 u64 reserved;
-            } __attribute__ ((packed)) unknown;
+            } unknown;
         } interface_path;
         union {
             struct {
@@ -84,7 +84,7 @@ struct edd_info {
                 u16 reserved2;
                 u32 reserved3;
                 u64 reserved4;
-            } __attribute__ ((packed)) ata;
+            } ata;
             struct {
                 u8 device;
                 u8 lun;
@@ -92,7 +92,7 @@ struct edd_info {
                 u8 reserved2;
                 u32 reserved3;
                 u64 reserved4;
-            } __attribute__ ((packed)) atapi;
+            } atapi;
             struct {
                 u16 id;
                 u64 lun;
@@ -102,35 +102,35 @@ struct edd_info {
             struct {
                 u64 serial_number;
                 u64 reserved;
-            } __attribute__ ((packed)) usb;
+            } usb;
             struct {
                 u64 eui;
                 u64 reserved;
-            } __attribute__ ((packed)) i1394;
+            } i1394;
             struct {
                 u64 wwid;
                 u64 lun;
-            } __attribute__ ((packed)) fibre;
+            } fibre;
             struct {
                 u64 identity_tag;
                 u64 reserved;
-            } __attribute__ ((packed)) i2o;
+            } i2o;
             struct {
                 u32 array_number;
                 u32 reserved1;
                 u64 reserved2;
-            } __attribute__ ((packed)) raid;
+            } raid;
             struct {
                 u8 device;
                 u8 reserved1;
                 u16 reserved2;
                 u32 reserved3;
                 u64 reserved4;
-            } __attribute__ ((packed)) sata;
+            } sata;
             struct {
                 u64 reserved1;
                 u64 reserved2;
-            } __attribute__ ((packed)) unknown;
+            } unknown;
         } device_path;
         u8 reserved4;
         u8 checksum;
-- 
1.7.10.4

  reply	other threads:[~2014-03-12 19:08 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-12 19:08 [PATCH 0/5] Improvements with __attribute__((packed)) Andrew Cooper
2014-03-12 19:08 ` Andrew Cooper [this message]
2014-03-13  8:06   ` [PATCH 1/5] xen: Remove redundant __attribute__((packed)) statements Jan Beulich
2014-03-13 10:38     ` Andrew Cooper
2014-03-13 10:49   ` George Dunlap
2014-03-12 19:08 ` [PATCH 2/5] xen/common: Cleanup use of __attribute__((packed)) Andrew Cooper
2014-03-13  8:15   ` Jan Beulich
2014-03-13 10:22     ` Andrew Cooper
2014-03-13 10:40       ` Jan Beulich
2014-03-13 10:42         ` Andrew Cooper
2014-03-12 19:08 ` [PATCH 3/5] xen/x86: " Andrew Cooper
2014-03-13  8:32   ` Jan Beulich
2014-03-13 11:00     ` Andrew Cooper
2014-03-13 11:13       ` Jan Beulich
2014-03-13 11:36         ` Keir Fraser
2014-03-12 19:08 ` [PATCH 4/5] xen/arm: " Andrew Cooper
2014-03-13  8:34   ` Jan Beulich
2014-03-13  9:55     ` Ian Campbell
2014-03-13  9:59       ` Tim Deegan
2014-03-13 10:01         ` Ian Campbell
2014-03-13 10:02       ` Jan Beulich
2014-03-12 19:08 ` [PATCH 5/5] DO NOT APPLY: for verification purposes only Andrew Cooper
2014-03-13  6:31 ` [PATCH 0/5] Improvements with __attribute__((packed)) Keir Fraser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1394651319-8893-2-git-send-email-andrew.cooper3@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=eddie.dong@intel.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=jun.nakajima@intel.com \
    --cc=keir@xen.org \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).