提交 7058b061 编写于 作者: P Paolo Ciarrocchi 提交者: Ingo Molnar

x86: coding style fixes to arch/x86/pci/irq.

Before:
total: 60 errors, 85 warnings, 1237 lines checked

After:
total: 1 errors, 82 warnings, 1226 lines checked

WARNING: line over 80 characters

Compile tested.

paolo@paolo-desktop:/tmp$ size irq.o.*
   text    data     bss     dec     hex filename
   6128     440      76    6644    19f4 irq.o.after
   6128     440      76    6644    19f4 irq.o.before
Signed-off-by: NPaolo Ciarrocchi <paolo.ciarrocchi@gmail.com>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 ce8e37cd
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/dmi.h> #include <linux/dmi.h>
#include <asm/io.h> #include <linux/io.h>
#include <asm/smp.h> #include <linux/smp.h>
#include <asm/io_apic.h> #include <asm/io_apic.h>
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/acpi.h> #include <linux/acpi.h>
...@@ -61,7 +61,7 @@ void (*pcibios_disable_irq)(struct pci_dev *dev) = NULL; ...@@ -61,7 +61,7 @@ void (*pcibios_disable_irq)(struct pci_dev *dev) = NULL;
* and perform checksum verification. * and perform checksum verification.
*/ */
static inline struct irq_routing_table * pirq_check_routing_table(u8 *addr) static inline struct irq_routing_table *pirq_check_routing_table(u8 *addr)
{ {
struct irq_routing_table *rt; struct irq_routing_table *rt;
int i; int i;
...@@ -74,7 +74,7 @@ static inline struct irq_routing_table * pirq_check_routing_table(u8 *addr) ...@@ -74,7 +74,7 @@ static inline struct irq_routing_table * pirq_check_routing_table(u8 *addr)
rt->size < sizeof(struct irq_routing_table)) rt->size < sizeof(struct irq_routing_table))
return NULL; return NULL;
sum = 0; sum = 0;
for (i=0; i < rt->size; i++) for (i = 0; i < rt->size; i++)
sum += addr[i]; sum += addr[i];
if (!sum) { if (!sum) {
DBG(KERN_DEBUG "PCI: Interrupt Routing Table found at 0x%p\n", rt); DBG(KERN_DEBUG "PCI: Interrupt Routing Table found at 0x%p\n", rt);
...@@ -100,7 +100,7 @@ static struct irq_routing_table * __init pirq_find_routing_table(void) ...@@ -100,7 +100,7 @@ static struct irq_routing_table * __init pirq_find_routing_table(void)
return rt; return rt;
printk(KERN_WARNING "PCI: PIRQ table NOT found at pirqaddr\n"); printk(KERN_WARNING "PCI: PIRQ table NOT found at pirqaddr\n");
} }
for(addr = (u8 *) __va(0xf0000); addr < (u8 *) __va(0x100000); addr += 16) { for (addr = (u8 *) __va(0xf0000); addr < (u8 *) __va(0x100000); addr += 16) {
rt = pirq_check_routing_table(addr); rt = pirq_check_routing_table(addr);
if (rt) if (rt)
return rt; return rt;
...@@ -122,20 +122,20 @@ static void __init pirq_peer_trick(void) ...@@ -122,20 +122,20 @@ static void __init pirq_peer_trick(void)
struct irq_info *e; struct irq_info *e;
memset(busmap, 0, sizeof(busmap)); memset(busmap, 0, sizeof(busmap));
for(i=0; i < (rt->size - sizeof(struct irq_routing_table)) / sizeof(struct irq_info); i++) { for (i = 0; i < (rt->size - sizeof(struct irq_routing_table)) / sizeof(struct irq_info); i++) {
e = &rt->slots[i]; e = &rt->slots[i];
#ifdef DEBUG #ifdef DEBUG
{ {
int j; int j;
DBG(KERN_DEBUG "%02x:%02x slot=%02x", e->bus, e->devfn/8, e->slot); DBG(KERN_DEBUG "%02x:%02x slot=%02x", e->bus, e->devfn/8, e->slot);
for(j=0; j<4; j++) for (j = 0; j < 4; j++)
DBG(" %d:%02x/%04x", j, e->irq[j].link, e->irq[j].bitmap); DBG(" %d:%02x/%04x", j, e->irq[j].link, e->irq[j].bitmap);
DBG("\n"); DBG("\n");
} }
#endif #endif
busmap[e->bus] = 1; busmap[e->bus] = 1;
} }
for(i = 1; i < 256; i++) { for (i = 1; i < 256; i++) {
int node; int node;
if (!busmap[i] || pci_find_bus(0, i)) if (!busmap[i] || pci_find_bus(0, i))
continue; continue;
...@@ -285,7 +285,7 @@ static int pirq_ite_get(struct pci_dev *router, struct pci_dev *dev, int pirq) ...@@ -285,7 +285,7 @@ static int pirq_ite_get(struct pci_dev *router, struct pci_dev *dev, int pirq)
static const unsigned char pirqmap[4] = { 1, 0, 2, 3 }; static const unsigned char pirqmap[4] = { 1, 0, 2, 3 };
WARN_ON_ONCE(pirq > 4); WARN_ON_ONCE(pirq > 4);
return read_config_nybble(router,0x43, pirqmap[pirq-1]); return read_config_nybble(router, 0x43, pirqmap[pirq-1]);
} }
static int pirq_ite_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq) static int pirq_ite_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq)
...@@ -487,9 +487,7 @@ static int pirq_amd756_get(struct pci_dev *router, struct pci_dev *dev, int pirq ...@@ -487,9 +487,7 @@ static int pirq_amd756_get(struct pci_dev *router, struct pci_dev *dev, int pirq
u8 irq; u8 irq;
irq = 0; irq = 0;
if (pirq <= 4) if (pirq <= 4)
{
irq = read_config_nybble(router, 0x56, pirq - 1); irq = read_config_nybble(router, 0x56, pirq - 1);
}
printk(KERN_INFO "AMD756: dev %04x:%04x, router pirq : %d get irq : %2d\n", printk(KERN_INFO "AMD756: dev %04x:%04x, router pirq : %d get irq : %2d\n",
dev->vendor, dev->device, pirq, irq); dev->vendor, dev->device, pirq, irq);
return irq; return irq;
...@@ -500,9 +498,7 @@ static int pirq_amd756_set(struct pci_dev *router, struct pci_dev *dev, int pirq ...@@ -500,9 +498,7 @@ static int pirq_amd756_set(struct pci_dev *router, struct pci_dev *dev, int pirq
printk(KERN_INFO "AMD756: dev %04x:%04x, router pirq : %d SET irq : %2d\n", printk(KERN_INFO "AMD756: dev %04x:%04x, router pirq : %d SET irq : %2d\n",
dev->vendor, dev->device, pirq, irq); dev->vendor, dev->device, pirq, irq);
if (pirq <= 4) if (pirq <= 4)
{
write_config_nybble(router, 0x56, pirq - 1, irq); write_config_nybble(router, 0x56, pirq - 1, irq);
}
return 1; return 1;
} }
...@@ -549,8 +545,7 @@ static __init int intel_router_probe(struct irq_router *r, struct pci_dev *route ...@@ -549,8 +545,7 @@ static __init int intel_router_probe(struct irq_router *r, struct pci_dev *route
if (pci_dev_present(pirq_440gx)) if (pci_dev_present(pirq_440gx))
return 0; return 0;
switch(device) switch (device) {
{
case PCI_DEVICE_ID_INTEL_82371FB_0: case PCI_DEVICE_ID_INTEL_82371FB_0:
case PCI_DEVICE_ID_INTEL_82371SB_0: case PCI_DEVICE_ID_INTEL_82371SB_0:
case PCI_DEVICE_ID_INTEL_82371AB_0: case PCI_DEVICE_ID_INTEL_82371AB_0:
...@@ -606,7 +601,7 @@ static __init int via_router_probe(struct irq_router *r, ...@@ -606,7 +601,7 @@ static __init int via_router_probe(struct irq_router *r,
* workarounds for some buggy BIOSes * workarounds for some buggy BIOSes
*/ */
if (device == PCI_DEVICE_ID_VIA_82C586_0) { if (device == PCI_DEVICE_ID_VIA_82C586_0) {
switch(router->device) { switch (router->device) {
case PCI_DEVICE_ID_VIA_82C686: case PCI_DEVICE_ID_VIA_82C686:
/* /*
* Asus k7m bios wrongly reports 82C686A * Asus k7m bios wrongly reports 82C686A
...@@ -624,7 +619,7 @@ static __init int via_router_probe(struct irq_router *r, ...@@ -624,7 +619,7 @@ static __init int via_router_probe(struct irq_router *r,
} }
} }
switch(device) { switch (device) {
case PCI_DEVICE_ID_VIA_82C586_0: case PCI_DEVICE_ID_VIA_82C586_0:
r->name = "VIA"; r->name = "VIA";
r->get = pirq_via586_get; r->get = pirq_via586_get;
...@@ -647,8 +642,7 @@ static __init int via_router_probe(struct irq_router *r, ...@@ -647,8 +642,7 @@ static __init int via_router_probe(struct irq_router *r,
static __init int vlsi_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) static __init int vlsi_router_probe(struct irq_router *r, struct pci_dev *router, u16 device)
{ {
switch(device) switch (device) {
{
case PCI_DEVICE_ID_VLSI_82C534: case PCI_DEVICE_ID_VLSI_82C534:
r->name = "VLSI 82C534"; r->name = "VLSI 82C534";
r->get = pirq_vlsi_get; r->get = pirq_vlsi_get;
...@@ -661,8 +655,7 @@ static __init int vlsi_router_probe(struct irq_router *r, struct pci_dev *router ...@@ -661,8 +655,7 @@ static __init int vlsi_router_probe(struct irq_router *r, struct pci_dev *router
static __init int serverworks_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) static __init int serverworks_router_probe(struct irq_router *r, struct pci_dev *router, u16 device)
{ {
switch(device) switch (device) {
{
case PCI_DEVICE_ID_SERVERWORKS_OSB4: case PCI_DEVICE_ID_SERVERWORKS_OSB4:
case PCI_DEVICE_ID_SERVERWORKS_CSB5: case PCI_DEVICE_ID_SERVERWORKS_CSB5:
r->name = "ServerWorks"; r->name = "ServerWorks";
...@@ -686,8 +679,7 @@ static __init int sis_router_probe(struct irq_router *r, struct pci_dev *router, ...@@ -686,8 +679,7 @@ static __init int sis_router_probe(struct irq_router *r, struct pci_dev *router,
static __init int cyrix_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) static __init int cyrix_router_probe(struct irq_router *r, struct pci_dev *router, u16 device)
{ {
switch(device) switch (device) {
{
case PCI_DEVICE_ID_CYRIX_5520: case PCI_DEVICE_ID_CYRIX_5520:
r->name = "NatSemi"; r->name = "NatSemi";
r->get = pirq_cyrix_get; r->get = pirq_cyrix_get;
...@@ -699,8 +691,7 @@ static __init int cyrix_router_probe(struct irq_router *r, struct pci_dev *route ...@@ -699,8 +691,7 @@ static __init int cyrix_router_probe(struct irq_router *r, struct pci_dev *route
static __init int opti_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) static __init int opti_router_probe(struct irq_router *r, struct pci_dev *router, u16 device)
{ {
switch(device) switch (device) {
{
case PCI_DEVICE_ID_OPTI_82C700: case PCI_DEVICE_ID_OPTI_82C700:
r->name = "OPTI"; r->name = "OPTI";
r->get = pirq_opti_get; r->get = pirq_opti_get;
...@@ -712,8 +703,7 @@ static __init int opti_router_probe(struct irq_router *r, struct pci_dev *router ...@@ -712,8 +703,7 @@ static __init int opti_router_probe(struct irq_router *r, struct pci_dev *router
static __init int ite_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) static __init int ite_router_probe(struct irq_router *r, struct pci_dev *router, u16 device)
{ {
switch(device) switch (device) {
{
case PCI_DEVICE_ID_ITE_IT8330G_0: case PCI_DEVICE_ID_ITE_IT8330G_0:
r->name = "ITE"; r->name = "ITE";
r->get = pirq_ite_get; r->get = pirq_ite_get;
...@@ -725,8 +715,7 @@ static __init int ite_router_probe(struct irq_router *r, struct pci_dev *router, ...@@ -725,8 +715,7 @@ static __init int ite_router_probe(struct irq_router *r, struct pci_dev *router,
static __init int ali_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) static __init int ali_router_probe(struct irq_router *r, struct pci_dev *router, u16 device)
{ {
switch(device) switch (device) {
{
case PCI_DEVICE_ID_AL_M1533: case PCI_DEVICE_ID_AL_M1533:
case PCI_DEVICE_ID_AL_M1563: case PCI_DEVICE_ID_AL_M1563:
printk(KERN_DEBUG "PCI: Using ALI IRQ Router\n"); printk(KERN_DEBUG "PCI: Using ALI IRQ Router\n");
...@@ -740,8 +729,7 @@ static __init int ali_router_probe(struct irq_router *r, struct pci_dev *router, ...@@ -740,8 +729,7 @@ static __init int ali_router_probe(struct irq_router *r, struct pci_dev *router,
static __init int amd_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) static __init int amd_router_probe(struct irq_router *r, struct pci_dev *router, u16 device)
{ {
switch(device) switch (device) {
{
case PCI_DEVICE_ID_AMD_VIPER_740B: case PCI_DEVICE_ID_AMD_VIPER_740B:
r->name = "AMD756"; r->name = "AMD756";
break; break;
...@@ -830,7 +818,7 @@ static void __init pirq_find_router(struct irq_router *r) ...@@ -830,7 +818,7 @@ static void __init pirq_find_router(struct irq_router *r)
return; return;
} }
for( h = pirq_routers; h->vendor; h++) { for (h = pirq_routers; h->vendor; h++) {
/* First look for a router match */ /* First look for a router match */
if (rt->rtr_vendor == h->vendor && h->probe(r, pirq_router_dev, rt->rtr_device)) if (rt->rtr_vendor == h->vendor && h->probe(r, pirq_router_dev, rt->rtr_device))
break; break;
...@@ -921,8 +909,10 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign) ...@@ -921,8 +909,10 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign)
*/ */
newirq = dev->irq; newirq = dev->irq;
if (newirq && !((1 << newirq) & mask)) { if (newirq && !((1 << newirq) & mask)) {
if ( pci_probe & PCI_USE_PIRQ_MASK) newirq = 0; if (pci_probe & PCI_USE_PIRQ_MASK)
else printk("\n" KERN_WARNING newirq = 0;
else
printk("\n" KERN_WARNING
"PCI: IRQ %i for device %s doesn't match PIRQ mask " "PCI: IRQ %i for device %s doesn't match PIRQ mask "
"- try pci=usepirqmask\n" KERN_DEBUG, newirq, "- try pci=usepirqmask\n" KERN_DEBUG, newirq,
pci_name(dev)); pci_name(dev));
...@@ -942,8 +932,8 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign) ...@@ -942,8 +932,8 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign)
irq = pirq & 0xf; irq = pirq & 0xf;
DBG(" -> hardcoded IRQ %d\n", irq); DBG(" -> hardcoded IRQ %d\n", irq);
msg = "Hardcoded"; msg = "Hardcoded";
} else if ( r->get && (irq = r->get(pirq_router_dev, dev, pirq)) && \ } else if (r->get && (irq = r->get(pirq_router_dev, dev, pirq)) && \
((!(pci_probe & PCI_USE_PIRQ_MASK)) || ((1 << irq) & mask)) ) { ((!(pci_probe & PCI_USE_PIRQ_MASK)) || ((1 << irq) & mask))) {
DBG(" -> got IRQ %d\n", irq); DBG(" -> got IRQ %d\n", irq);
msg = "Found"; msg = "Found";
eisa_set_level_irq(irq); eisa_set_level_irq(irq);
...@@ -978,9 +968,9 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign) ...@@ -978,9 +968,9 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign)
continue; continue;
if (info->irq[pin].link == pirq) { if (info->irq[pin].link == pirq) {
/* We refuse to override the dev->irq information. Give a warning! */ /* We refuse to override the dev->irq information. Give a warning! */
if ( dev2->irq && dev2->irq != irq && \ if (dev2->irq && dev2->irq != irq && \
(!(pci_probe & PCI_USE_PIRQ_MASK) || \ (!(pci_probe & PCI_USE_PIRQ_MASK) || \
((1 << dev2->irq) & mask)) ) { ((1 << dev2->irq) & mask))) {
#ifndef CONFIG_PCI_MSI #ifndef CONFIG_PCI_MSI
printk(KERN_INFO "IRQ routing conflict for %s, have irq %d, want irq %d\n", printk(KERN_INFO "IRQ routing conflict for %s, have irq %d, want irq %d\n",
pci_name(dev2), dev2->irq, irq); pci_name(dev2), dev2->irq, irq);
...@@ -1024,8 +1014,7 @@ static void __init pcibios_fixup_irqs(void) ...@@ -1024,8 +1014,7 @@ static void __init pcibios_fixup_irqs(void)
/* /*
* Recalculate IRQ numbers if we use the I/O APIC. * Recalculate IRQ numbers if we use the I/O APIC.
*/ */
if (io_apic_assign_pci_irqs) if (io_apic_assign_pci_irqs) {
{
int irq; int irq;
if (pin) { if (pin) {
...@@ -1038,7 +1027,7 @@ static void __init pcibios_fixup_irqs(void) ...@@ -1038,7 +1027,7 @@ static void __init pcibios_fixup_irqs(void)
* busses itself so we should get into this branch reliably. * busses itself so we should get into this branch reliably.
*/ */
if (irq < 0 && dev->bus->parent) { /* go back to the bridge */ if (irq < 0 && dev->bus->parent) { /* go back to the bridge */
struct pci_dev * bridge = dev->bus->self; struct pci_dev *bridge = dev->bus->self;
pin = (pin + PCI_SLOT(dev->devfn)) % 4; pin = (pin + PCI_SLOT(dev->devfn)) % 4;
irq = IO_APIC_get_PCI_irq_vector(bridge->bus->number, irq = IO_APIC_get_PCI_irq_vector(bridge->bus->number,
...@@ -1131,7 +1120,7 @@ static int __init pcibios_irq_init(void) ...@@ -1131,7 +1120,7 @@ static int __init pcibios_irq_init(void)
pirq_find_router(&pirq_router); pirq_find_router(&pirq_router);
if (pirq_table->exclusive_irqs) { if (pirq_table->exclusive_irqs) {
int i; int i;
for (i=0; i<16; i++) for (i = 0; i < 16; i++)
if (!(pirq_table->exclusive_irqs & (1 << i))) if (!(pirq_table->exclusive_irqs & (1 << i)))
pirq_penalty[i] += 100; pirq_penalty[i] += 100;
} }
...@@ -1196,7 +1185,7 @@ static int pirq_enable_irq(struct pci_dev *dev) ...@@ -1196,7 +1185,7 @@ static int pirq_enable_irq(struct pci_dev *dev)
*/ */
temp_dev = dev; temp_dev = dev;
while (irq < 0 && dev->bus->parent) { /* go back to the bridge */ while (irq < 0 && dev->bus->parent) { /* go back to the bridge */
struct pci_dev * bridge = dev->bus->self; struct pci_dev *bridge = dev->bus->self;
pin = (pin + PCI_SLOT(dev->devfn)) % 4; pin = (pin + PCI_SLOT(dev->devfn)) % 4;
irq = IO_APIC_get_PCI_irq_vector(bridge->bus->number, irq = IO_APIC_get_PCI_irq_vector(bridge->bus->number,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册