提交 8bfd4e02 编写于 作者: K Konrad Rzeszutek Wilk

xen/pciback: Cleanup the driver based on checkpatch warnings and errors.

Checkpatch found some extra warnings and errors. This mega
patch fixes them all in one big swoop. We also spruce
up the pcistub_ids to use DEFINE_PCI_DEVICE_TABLE macro
(suggested by Jan Beulich).
Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
上级 30edc14b
......@@ -18,8 +18,8 @@
static int permissive;
module_param(permissive, bool, 0644);
#define DEFINE_PCI_CONFIG(op, size, type) \
int pciback_##op##_config_##size \
#define DEFINE_PCI_CONFIG(op, size, type) \
int pciback_##op##_config_##size \
(struct pci_dev *dev, int offset, type value, void *data) \
{ \
return pci_##op##_config_##size(dev, offset, value); \
......
......@@ -249,27 +249,27 @@ static const struct config_field header_common[] = {
{}
};
#define CFG_FIELD_BAR(reg_offset) \
{ \
.offset = reg_offset, \
.size = 4, \
.init = bar_init, \
.reset = bar_reset, \
.release = bar_release, \
.u.dw.read = bar_read, \
.u.dw.write = bar_write, \
}
#define CFG_FIELD_ROM(reg_offset) \
{ \
.offset = reg_offset, \
.size = 4, \
.init = rom_init, \
.reset = bar_reset, \
.release = bar_release, \
.u.dw.read = bar_read, \
.u.dw.write = rom_write, \
}
#define CFG_FIELD_BAR(reg_offset) \
{ \
.offset = reg_offset, \
.size = 4, \
.init = bar_init, \
.reset = bar_reset, \
.release = bar_release, \
.u.dw.read = bar_read, \
.u.dw.write = bar_write, \
}
#define CFG_FIELD_ROM(reg_offset) \
{ \
.offset = reg_offset, \
.size = 4, \
.init = rom_init, \
.reset = bar_reset, \
.release = bar_release, \
.u.dw.read = bar_read, \
.u.dw.write = rom_write, \
}
static const struct config_field header_0[] = {
CFG_FIELD_BAR(PCI_BASE_ADDRESS_0),
......
......@@ -13,7 +13,7 @@
#include <linux/pci.h>
#include <linux/wait.h>
#include <linux/sched.h>
#include <asm/atomic.h>
#include <linux/atomic.h>
#include <xen/events.h>
#include <asm/xen/pci.h>
#include <asm/xen/hypervisor.h>
......@@ -486,7 +486,7 @@ static void pcistub_remove(struct pci_dev *dev)
}
}
static const struct pci_device_id pcistub_ids[] = {
static DEFINE_PCI_DEVICE_TABLE(pcistub_ids) = {
{
.vendor = PCI_ANY_ID,
.device = PCI_ANY_ID,
......@@ -592,7 +592,7 @@ static pci_ers_result_t common_process(struct pcistub_device *psdev,
if (test_bit(_XEN_PCIF_active,
(unsigned long *)&psdev->pdev->sh_info->flags)) {
dev_dbg(&psdev->dev->dev,
"schedule pci_conf service in pciback \n");
"schedule pci_conf service in pciback\n");
test_and_schedule_op(psdev->pdev);
}
......
......@@ -12,7 +12,7 @@
#include <linux/list.h>
#include <linux/spinlock.h>
#include <linux/workqueue.h>
#include <asm/atomic.h>
#include <linux/atomic.h>
#include <xen/interface/io/pciif.h>
struct pci_dev_entry {
......@@ -20,8 +20,8 @@ struct pci_dev_entry {
struct pci_dev *dev;
};
#define _PDEVF_op_active (0)
#define PDEVF_op_active (1<<(_PDEVF_op_active))
#define _PDEVF_op_active (0)
#define PDEVF_op_active (1<<(_PDEVF_op_active))
#define _PCIB_op_pending (1)
#define PCIB_op_pending (1<<(_PCIB_op_pending))
......
......@@ -683,20 +683,20 @@ static const struct xenbus_device_id xenpci_ids[] = {
};
static struct xenbus_driver xenbus_pciback_driver = {
.name = "pciback",
.owner = THIS_MODULE,
.ids = xenpci_ids,
.probe = pciback_xenbus_probe,
.remove = pciback_xenbus_remove,
.otherend_changed = pciback_frontend_changed,
.name = "pciback",
.owner = THIS_MODULE,
.ids = xenpci_ids,
.probe = pciback_xenbus_probe,
.remove = pciback_xenbus_remove,
.otherend_changed = pciback_frontend_changed,
};
int __init pciback_xenbus_register(void)
{
pciback_wq = create_workqueue("pciback_workqueue");
if (!pciback_wq) {
printk(KERN_ERR "pciback_xenbus_register: create"
"pciback_workqueue failed\n");
printk(KERN_ERR "%s: create"
"pciback_workqueue failed\n", __func__);
return -EFAULT;
}
return xenbus_register_backend(&xenbus_pciback_driver);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册