PCI: pcie, aer: checkpatch style cleanup in pcie/aer/*

Before:
 drivers/pci/pcie/aer/aer_inject.c
  total: 4 errors, 4 warnings, 473 lines checked
 drivers/pci/pcie/aer/aerdrv.c
  total: 5 errors, 2 warnings, 333 lines checked
 drivers/pci/pcie/aer/aerdrv.h
  total: 1 errors, 0 warnings, 139 lines checked
 drivers/pci/pcie/aer/aerdrv_core.c
  total: 4 errors, 3 warnings, 872 lines checked
 drivers/pci/pcie/aer/aerdrv_errprint.c
  total: 12 errors, 11 warnings, 248 lines checked

After:
 drivers/pci/pcie/aer/aer_inject.c
  total: 0 errors, 0 warnings, 466 lines checked
 drivers/pci/pcie/aer/aerdrv.c
  total: 0 errors, 0 warnings, 335 lines checked
 drivers/pci/pcie/aer/aerdrv.h
  total: 0 errors, 0 warnings, 139 lines checked
 drivers/pci/pcie/aer/aerdrv_core.c
  total: 0 errors, 0 warnings, 869 lines checked
 drivers/pci/pcie/aer/aerdrv_errprint.c
  total: 0 errors, 10 warnings, 247 lines checked

Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Reviewed-by: Andrew Patterson <andrew.patterson@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
This commit is contained in:
Hidetoshi Seto
2009-09-07 17:07:29 +09:00
committed by Jesse Barnes
parent b439b1d4e3
commit c9a918838c
5 changed files with 62 additions and 71 deletions

View File

@@ -22,11 +22,10 @@
#include <linux/miscdevice.h> #include <linux/miscdevice.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <asm/uaccess.h> #include <linux/uaccess.h>
#include "aerdrv.h" #include "aerdrv.h"
struct aer_error_inj struct aer_error_inj {
{
u8 bus; u8 bus;
u8 dev; u8 dev;
u8 fn; u8 fn;
@@ -38,8 +37,7 @@ struct aer_error_inj
u32 header_log3; u32 header_log3;
}; };
struct aer_error struct aer_error {
{
struct list_head list; struct list_head list;
unsigned int bus; unsigned int bus;
unsigned int devfn; unsigned int devfn;
@@ -55,8 +53,7 @@ struct aer_error
u32 source_id; u32 source_id;
}; };
struct pci_bus_ops struct pci_bus_ops {
{
struct list_head list; struct list_head list;
struct pci_bus *bus; struct pci_bus *bus;
struct pci_ops *ops; struct pci_ops *ops;
@@ -258,7 +255,6 @@ static int pci_bus_set_aer_ops(struct pci_bus *bus)
bus_ops = NULL; bus_ops = NULL;
out: out:
spin_unlock_irqrestore(&inject_lock, flags); spin_unlock_irqrestore(&inject_lock, flags);
if (bus_ops)
kfree(bus_ops); kfree(bus_ops);
return 0; return 0;
} }
@@ -401,9 +397,7 @@ static int aer_inject(struct aer_error_inj *einj)
else else
ret = -EINVAL; ret = -EINVAL;
out_put: out_put:
if (err_alloc)
kfree(err_alloc); kfree(err_alloc);
if (rperr_alloc)
kfree(rperr_alloc); kfree(rperr_alloc);
pci_dev_put(dev); pci_dev_put(dev);
return ret; return ret;
@@ -458,8 +452,7 @@ static void __exit aer_inject_exit(void)
} }
spin_lock_irqsave(&inject_lock, flags); spin_lock_irqsave(&inject_lock, flags);
list_for_each_entry_safe(err, err_next, list_for_each_entry_safe(err, err_next, &pci_bus_ops_list, list) {
&pci_bus_ops_list, list) {
list_del(&err->list); list_del(&err->list);
kfree(err); kfree(err);
} }

View File

@@ -138,8 +138,8 @@ static struct aer_rpc* aer_alloc_rpc(struct pcie_device *dev)
{ {
struct aer_rpc *rpc; struct aer_rpc *rpc;
if (!(rpc = kzalloc(sizeof(struct aer_rpc), rpc = kzalloc(sizeof(struct aer_rpc), GFP_KERNEL);
GFP_KERNEL))) if (!rpc)
return NULL; return NULL;
/* /*
@@ -196,19 +196,21 @@ static int __devinit aer_probe (struct pcie_device *dev)
struct device *device = &dev->device; struct device *device = &dev->device;
/* Init */ /* Init */
if ((status = aer_init(dev))) status = aer_init(dev);
if (status)
return status; return status;
/* Alloc rpc data structure */ /* Alloc rpc data structure */
if (!(rpc = aer_alloc_rpc(dev))) { rpc = aer_alloc_rpc(dev);
if (!rpc) {
dev_printk(KERN_DEBUG, device, "alloc rpc failed\n"); dev_printk(KERN_DEBUG, device, "alloc rpc failed\n");
aer_remove(dev); aer_remove(dev);
return -ENOMEM; return -ENOMEM;
} }
/* Request IRQ ISR */ /* Request IRQ ISR */
if ((status = request_irq(dev->irq, aer_irq, IRQF_SHARED, "aerdrv", status = request_irq(dev->irq, aer_irq, IRQF_SHARED, "aerdrv", dev);
dev))) { if (status) {
dev_printk(KERN_DEBUG, device, "request IRQ failed\n"); dev_printk(KERN_DEBUG, device, "request IRQ failed\n");
aer_remove(dev); aer_remove(dev);
return status; return status;

View File

@@ -136,4 +136,4 @@ static inline int aer_osc_setup(struct pcie_device *pciedev)
} }
#endif #endif
#endif //_AERDRV_H_ #endif /* _AERDRV_H_ */

View File

@@ -49,10 +49,11 @@ int pci_enable_pcie_error_reporting(struct pci_dev *dev)
PCI_EXP_DEVCTL_NFERE | PCI_EXP_DEVCTL_NFERE |
PCI_EXP_DEVCTL_FERE | PCI_EXP_DEVCTL_FERE |
PCI_EXP_DEVCTL_URRE; PCI_EXP_DEVCTL_URRE;
pci_write_config_word(dev, pos+PCI_EXP_DEVCTL, pci_write_config_word(dev, pos+PCI_EXP_DEVCTL, reg16);
reg16);
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(pci_enable_pcie_error_reporting);
int pci_disable_pcie_error_reporting(struct pci_dev *dev) int pci_disable_pcie_error_reporting(struct pci_dev *dev)
{ {
@@ -68,10 +69,11 @@ int pci_disable_pcie_error_reporting(struct pci_dev *dev)
PCI_EXP_DEVCTL_NFERE | PCI_EXP_DEVCTL_NFERE |
PCI_EXP_DEVCTL_FERE | PCI_EXP_DEVCTL_FERE |
PCI_EXP_DEVCTL_URRE); PCI_EXP_DEVCTL_URRE);
pci_write_config_word(dev, pos+PCI_EXP_DEVCTL, pci_write_config_word(dev, pos+PCI_EXP_DEVCTL, reg16);
reg16);
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(pci_disable_pcie_error_reporting);
int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev) int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev)
{ {
@@ -92,6 +94,7 @@ int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev)
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(pci_cleanup_aer_uncorrect_error_status);
#if 0 #if 0
int pci_cleanup_aer_correct_error_status(struct pci_dev *dev) int pci_cleanup_aer_correct_error_status(struct pci_dev *dev)
@@ -110,7 +113,6 @@ int pci_cleanup_aer_correct_error_status(struct pci_dev *dev)
} }
#endif /* 0 */ #endif /* 0 */
static int set_device_error_reporting(struct pci_dev *dev, void *data) static int set_device_error_reporting(struct pci_dev *dev, void *data)
{ {
bool enable = *((bool *)data); bool enable = *((bool *)data);
@@ -164,7 +166,8 @@ static int add_error_device(struct aer_err_info *e_info, struct pci_dev *dev)
e_info->dev[e_info->error_dev_num] = dev; e_info->dev[e_info->error_dev_num] = dev;
e_info->error_dev_num++; e_info->error_dev_num++;
return 1; return 1;
} else }
return 0; return 0;
} }
@@ -411,8 +414,7 @@ static pci_ers_result_t broadcast_error_message(struct pci_dev *dev,
pci_cleanup_aer_uncorrect_error_status(dev); pci_cleanup_aer_uncorrect_error_status(dev);
dev->error_state = pci_channel_io_normal; dev->error_state = pci_channel_io_normal;
} }
} } else {
else {
/* /*
* If the error is reported by an end point, we think this * If the error is reported by an end point, we think this
* error is related to the upstream link of the end point. * error is related to the upstream link of the end point.
@@ -865,8 +867,3 @@ int aer_init(struct pcie_device *dev)
return AER_SUCCESS; return AER_SUCCESS;
} }
EXPORT_SYMBOL_GPL(pci_enable_pcie_error_reporting);
EXPORT_SYMBOL_GPL(pci_disable_pcie_error_reporting);
EXPORT_SYMBOL_GPL(pci_cleanup_aer_uncorrect_error_status);

View File

@@ -245,4 +245,3 @@ void aer_print_error(struct pci_dev *dev, struct aer_err_info *info)
} }
} }
} }