]> xenbits.xensource.com Git - xen.git/commitdiff
vpci/msi: fix size of the vectors fields
authorRoger Pau Monné <roger.pau@citrix.com>
Tue, 27 Mar 2018 08:27:46 +0000 (10:27 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 27 Mar 2018 08:27:46 +0000 (10:27 +0200)
The current size (5bits) is not enough to store the maximum number of
vectors (32), bump it by one bit.

Also change the layout so that 'vectors' is aligned to a 8bit
boundary.

Note that the size of the struct is still the same.

Coverity ID: 1430810

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/include/xen/vpci.h

index cb39e0ebea91240cbbf8aa3530cb32df09b84641..29616624add6b7de759dc4b7bc6b139a388ed0e5 100644 (file)
@@ -100,15 +100,15 @@ struct vpci {
         /* Data. */
         uint16_t data;
         /* Maximum number of vectors supported by the device. */
-        uint8_t max_vectors : 5;
-        /* Enabled? */
-        bool enabled        : 1;
+        uint8_t max_vectors : 6;
         /* Supports per-vector masking? */
         bool masking        : 1;
         /* 64-bit address capable? */
         bool address64      : 1;
         /* Number of vectors configured. */
-        uint8_t vectors     : 5;
+        uint8_t vectors     : 6;
+        /* Enabled? */
+        bool enabled        : 1;
         /* Arch-specific data. */
         struct vpci_arch_msi arch;
     } *msi;