]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/pci/pcie/aer/aer_inject.c
include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit...
[mv-sheeva.git] / drivers / pci / pcie / aer / aer_inject.c
index 8c30a9544d61f07176fbf69a59b84c2afabf9e8a..f8f425b8731ddb91f8663069da23495bf75befcb 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/init.h>
 #include <linux/miscdevice.h>
 #include <linux/pci.h>
+#include <linux/slab.h>
 #include <linux/fs.h>
 #include <linux/uaccess.h>
 #include <linux/stddef.h>
@@ -321,7 +322,7 @@ static int aer_inject(struct aer_error_inj *einj)
        unsigned long flags;
        unsigned int devfn = PCI_DEVFN(einj->dev, einj->fn);
        int pos_cap_err, rp_pos_cap_err;
-       u32 sever, mask;
+       u32 sever, cor_mask, uncor_mask;
        int ret = 0;
 
        dev = pci_get_domain_bus_and_slot((int)einj->domain, einj->bus, devfn);
@@ -339,6 +340,9 @@ static int aer_inject(struct aer_error_inj *einj)
                goto out_put;
        }
        pci_read_config_dword(dev, pos_cap_err + PCI_ERR_UNCOR_SEVER, &sever);
+       pci_read_config_dword(dev, pos_cap_err + PCI_ERR_COR_MASK, &cor_mask);
+       pci_read_config_dword(dev, pos_cap_err + PCI_ERR_UNCOR_MASK,
+                             &uncor_mask);
 
        rp_pos_cap_err = pci_find_ext_capability(rpdev, PCI_EXT_CAP_ID_ERR);
        if (!rp_pos_cap_err) {
@@ -374,17 +378,14 @@ static int aer_inject(struct aer_error_inj *einj)
        err->header_log2 = einj->header_log2;
        err->header_log3 = einj->header_log3;
 
-       pci_read_config_dword(dev, pos_cap_err + PCI_ERR_COR_MASK, &mask);
-       if (einj->cor_status && !(einj->cor_status & ~mask)) {
+       if (einj->cor_status && !(einj->cor_status & ~cor_mask)) {
                ret = -EINVAL;
                printk(KERN_WARNING "The correctable error(s) is masked "
                                "by device\n");
                spin_unlock_irqrestore(&inject_lock, flags);
                goto out_put;
        }
-
-       pci_read_config_dword(dev, pos_cap_err + PCI_ERR_UNCOR_MASK, &mask);
-       if (einj->uncor_status && !(einj->uncor_status & ~mask)) {
+       if (einj->uncor_status && !(einj->uncor_status & ~uncor_mask)) {
                ret = -EINVAL;
                printk(KERN_WARNING "The uncorrectable error(s) is masked "
                                "by device\n");