Commit c54c1879 authored by Satoru Takeuchi's avatar Satoru Takeuchi Committed by Greg Kroah-Hartman

PCI: cleanup MSI code

Cleanup MSI code as follows:

 - fix some types
 - fix strange local variable definition
 - delete unnecessary blank line
 - add comment to #endif which is far from corresponding #ifdef
Signed-off-by: default avatarSatoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 8255cf35
...@@ -49,8 +49,8 @@ static void msi_set_mask_bit(unsigned int irq, int flag) ...@@ -49,8 +49,8 @@ static void msi_set_mask_bit(unsigned int irq, int flag)
switch (entry->msi_attrib.type) { switch (entry->msi_attrib.type) {
case PCI_CAP_ID_MSI: case PCI_CAP_ID_MSI:
if (entry->msi_attrib.maskbit) { if (entry->msi_attrib.maskbit) {
int pos; int pos;
u32 mask_bits; u32 mask_bits;
pos = (long)entry->mask_base; pos = (long)entry->mask_base;
pci_read_config_dword(entry->dev, pos, &mask_bits); pci_read_config_dword(entry->dev, pos, &mask_bits);
...@@ -162,6 +162,7 @@ void unmask_msi_irq(unsigned int irq) ...@@ -162,6 +162,7 @@ void unmask_msi_irq(unsigned int irq)
} }
static int msi_free_irq(struct pci_dev* dev, int irq); static int msi_free_irq(struct pci_dev* dev, int irq);
static int msi_init(void) static int msi_init(void)
{ {
static int status = -ENOMEM; static int status = -ENOMEM;
...@@ -291,7 +292,7 @@ static int msi_lookup_irq(struct pci_dev *dev, int type) ...@@ -291,7 +292,7 @@ static int msi_lookup_irq(struct pci_dev *dev, int type)
continue; continue;
spin_unlock_irqrestore(&msi_lock, flags); spin_unlock_irqrestore(&msi_lock, flags);
/* This pre-assigned MSI irq for this device /* This pre-assigned MSI irq for this device
already exits. Override dev->irq with this irq */ already exists. Override dev->irq with this irq */
dev->irq = irq; dev->irq = irq;
return 0; return 0;
} }
...@@ -458,7 +459,7 @@ void pci_restore_msix_state(struct pci_dev *dev) ...@@ -458,7 +459,7 @@ void pci_restore_msix_state(struct pci_dev *dev)
pci_write_config_word(dev, msi_control_reg(pos), save); pci_write_config_word(dev, msi_control_reg(pos), save);
enable_msi_mode(dev, pos, PCI_CAP_ID_MSIX); enable_msi_mode(dev, pos, PCI_CAP_ID_MSIX);
} }
#endif #endif /* CONFIG_PM */
/** /**
* msi_capability_init - configure device's MSI capability structure * msi_capability_init - configure device's MSI capability structure
......
...@@ -7,11 +7,10 @@ struct msi_msg { ...@@ -7,11 +7,10 @@ struct msi_msg {
u32 data; /* 16 bits of msi message data */ u32 data; /* 16 bits of msi message data */
}; };
/* Heper functions */ /* Helper functions */
extern void mask_msi_irq(unsigned int irq); extern void mask_msi_irq(unsigned int irq);
extern void unmask_msi_irq(unsigned int irq); extern void unmask_msi_irq(unsigned int irq);
extern void read_msi_msg(unsigned int irq, struct msi_msg *msg); extern void read_msi_msg(unsigned int irq, struct msi_msg *msg);
extern void write_msi_msg(unsigned int irq, struct msi_msg *msg); extern void write_msi_msg(unsigned int irq, struct msi_msg *msg);
struct msi_desc { struct msi_desc {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment