Skip to contentSkip to conversation

Ping: [PATCH] PCI: shrink pci_dev_info's is_extfn/is_virtfn members

PATCH Jan Beulich 2 participants 2 messages Jan 9, 2012

lore
Share & tools
lore
#0 lore raw

They are used as boolean flags only, so convert them accordingly (shrinking the structure size by 8 bytes).

xen/arch/ia64/xen/hypercall.c +2 -2
@@ -695,8 +695,8 @@ long do_physdev_op(int cmd, XEN_GUEST_HA
         if ( copy_from_guest(&manage_pci_ext, arg, 1) != 0 )
             break;
 
-        pdev_info.is_extfn = manage_pci_ext.is_extfn;
-        pdev_info.is_virtfn = manage_pci_ext.is_virtfn;
+        pdev_info.is_extfn = !!manage_pci_ext.is_extfn;
+        pdev_info.is_virtfn = !!manage_pci_ext.is_virtfn;
         pdev_info.physfn.bus = manage_pci_ext.physfn.bus;
         pdev_info.physfn.devfn = manage_pci_ext.physfn.devfn;
         ret = pci_add_device(0, manage_pci_ext.bus,
xen/include/xen/pci.h +2 -2
@@ -33,8 +33,8 @@
 #define MAX_MSIX_TABLE_ENTRIES  2048
 #define MAX_MSIX_TABLE_PAGES    8
 struct pci_dev_info {
-    unsigned is_extfn;
-    unsigned is_virtfn;
+    bool_t is_extfn;
+    bool_t is_virtfn;
     struct {
         u8 bus;
         u8 devfn;

PCI: shrink pci_dev_info's is_extfn/is_virtfn members

They are used as boolean flags only, so convert them accordingly (shrinking the structure size by 8 bytes).

xen/arch/ia64/xen/hypercall.c +2 -2
@@ -695,8 +695,8 @@ long do_physdev_op(int cmd, XEN_GUEST_HA
         if ( copy_from_guest(&manage_pci_ext, arg, 1) != 0 )
             break;
 
-        pdev_info.is_extfn = manage_pci_ext.is_extfn;
-        pdev_info.is_virtfn = manage_pci_ext.is_virtfn;
+        pdev_info.is_extfn = !!manage_pci_ext.is_extfn;
+        pdev_info.is_virtfn = !!manage_pci_ext.is_virtfn;
         pdev_info.physfn.bus = manage_pci_ext.physfn.bus;
         pdev_info.physfn.devfn = manage_pci_ext.physfn.devfn;
         ret = pci_add_device(0, manage_pci_ext.bus,
xen/include/xen/pci.h +2 -2
@@ -33,8 +33,8 @@
 #define MAX_MSIX_TABLE_ENTRIES  2048
 #define MAX_MSIX_TABLE_PAGES    8
 struct pci_dev_info {
-    unsigned is_extfn;
-    unsigned is_virtfn;
+    bool_t is_extfn;
+    bool_t is_virtfn;
     struct {
         u8 bus;
         u8 devfn;

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

Acked-by
#1 lore raw
Quoted 4 lines · Jan Beulich

They are used as boolean flags only, so convert them accordingly (shrinking the structure size by 8 bytes).

Quoted 33 lines
xen/arch/ia64/xen/hypercall.c +2 -2
@@ -695,8 +695,8 @@ long do_physdev_op(int cmd, XEN_GUEST_HA
         if ( copy_from_guest(&manage_pci_ext, arg, 1) != 0 )
             break;
 
-        pdev_info.is_extfn = manage_pci_ext.is_extfn;
-        pdev_info.is_virtfn = manage_pci_ext.is_virtfn;
+        pdev_info.is_extfn = !!manage_pci_ext.is_extfn;
+        pdev_info.is_virtfn = !!manage_pci_ext.is_virtfn;
         pdev_info.physfn.bus = manage_pci_ext.physfn.bus;
         pdev_info.physfn.devfn = manage_pci_ext.physfn.devfn;
         ret = pci_add_device(0, manage_pci_ext.bus,
xen/include/xen/pci.h +2 -2
@@ -33,8 +33,8 @@
 #define MAX_MSIX_TABLE_ENTRIES  2048
 #define MAX_MSIX_TABLE_PAGES    8
 struct pci_dev_info {
-    unsigned is_extfn;
-    unsigned is_virtfn;
+    bool_t is_extfn;
+    bool_t is_virtfn;
     struct {
         u8 bus;
         u8 devfn;

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel