PCI: Add mask bit definition for MSI-X table
authorSheng Yang <sheng@linux.intel.com>
Thu, 11 Nov 2010 07:46:55 +0000 (15:46 +0800)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Thu, 23 Dec 2010 20:53:08 +0000 (12:53 -0800)
Then we can use it instead of magic number 1.

Reviewed-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Cc: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Sheng Yang <sheng@linux.intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
drivers/pci/msi.c
include/linux/pci_regs.h

index 7c24dcef29897fce34da71e112669f045fdd820e..44b0aeee83e52c1bcbeeaa73417ec577681cfe0a 100644 (file)
@@ -168,8 +168,9 @@ static u32 __msix_mask_irq(struct msi_desc *desc, u32 flag)
        u32 mask_bits = desc->masked;
        unsigned offset = desc->msi_attrib.entry_nr * PCI_MSIX_ENTRY_SIZE +
                                                PCI_MSIX_ENTRY_VECTOR_CTRL;
-       mask_bits &= ~1;
-       mask_bits |= flag;
+       mask_bits &= ~PCI_MSIX_ENTRY_CTRL_MASKBIT;
+       if (flag)
+               mask_bits |= PCI_MSIX_ENTRY_CTRL_MASKBIT;
        writel(mask_bits, desc->mask_base + offset);
 
        return mask_bits;
index b21d33e4bc2ab0e60a64e2635b0491da0c4fd0dc..d4f2c80a6c3e111fdbd105afa96f75e5140ae40c 100644 (file)
 #define  PCI_MSIX_ENTRY_UPPER_ADDR     4
 #define  PCI_MSIX_ENTRY_DATA           8
 #define  PCI_MSIX_ENTRY_VECTOR_CTRL    12
+#define   PCI_MSIX_ENTRY_CTRL_MASKBIT  1
 
 /* CompactPCI Hotswap Register */