Skip to content

Commit

Permalink
xen/pciback: Cleanup the driver based on checkpatch warnings and errors.
Browse files Browse the repository at this point in the history
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: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
  • Loading branch information
Konrad Rzeszutek Wilk committed Jul 20, 2011
1 parent 30edc14 commit 8bfd4e0
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 37 deletions.
4 changes: 2 additions & 2 deletions drivers/xen/xen-pciback/conf_space.c
Original file line number Diff line number Diff line change
Expand Up @@ -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); \
Expand Down
42 changes: 21 additions & 21 deletions drivers/xen/xen-pciback/conf_space_header.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
6 changes: 3 additions & 3 deletions drivers/xen/xen-pciback/pci_stub.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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);
}

Expand Down
6 changes: 3 additions & 3 deletions drivers/xen/xen-pciback/pciback.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
#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 {
struct list_head list;
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))

Expand Down
16 changes: 8 additions & 8 deletions drivers/xen/xen-pciback/xenbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8bfd4e0

Please sign in to comment.