Commit 7738925d authored by Sam Ravnborg's avatar Sam Ravnborg Committed by David S. Miller

sparc32: fix sparse warnings in pcic.c

Fix following warnings:
pcic.c:164:14: warning: symbol 'pcic_regs' was not declared. Should it be static?
pcic.c:165:14: warning: symbol 'pcic_speculative' was not declared. Should it be static?
pcic.c:166:14: warning: symbol 'pcic_trapped' was not declared. Should it be static?
pcic.c:332:66: warning: Using plain integer as NULL pointer
pcic.c:344:66: warning: Using plain integer as NULL pointer
pcic.c:539:38: warning: Using plain integer as NULL pointer
pcic.c:677:1: warning: symbol 'pcic_pin_to_irq' was not declared. Should it be static?
pcic.c:783:6: warning: symbol 'pcic_nmi' was not declared. Should it be static?

Add extern for pcic_regs.
Define a few variables static.
Replace 0 with NULL.
Delete unused funtion pcic_pin_to_irq().
Include kernel.h so we could drop declaration of
t_nmi and add prototype for pcic_nmi.
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1918660b
...@@ -140,6 +140,10 @@ void __init clock_stop_probe(void); ...@@ -140,6 +140,10 @@ void __init clock_stop_probe(void);
void __init auxio_probe(void); void __init auxio_probe(void);
void __init auxio_power_probe(void); void __init auxio_power_probe(void);
/* pcic.c */
extern void __iomem *pcic_regs;
void pcic_nmi(unsigned int pend, struct pt_regs *regs);
#else /* CONFIG_SPARC32 */ #else /* CONFIG_SPARC32 */
#endif /* CONFIG_SPARC32 */ #endif /* CONFIG_SPARC32 */
#endif /* !(__SPARC_KERNEL_H) */ #endif /* !(__SPARC_KERNEL_H) */
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/irq_regs.h> #include <asm/irq_regs.h>
#include "kernel.h"
#include "irq.h" #include "irq.h"
/* /*
...@@ -162,8 +163,8 @@ static int pcic0_up; ...@@ -162,8 +163,8 @@ static int pcic0_up;
static struct linux_pcic pcic0; static struct linux_pcic pcic0;
void __iomem *pcic_regs; void __iomem *pcic_regs;
volatile int pcic_speculative; static volatile int pcic_speculative;
volatile int pcic_trapped; static volatile int pcic_trapped;
/* forward */ /* forward */
unsigned int pcic_build_device_irq(struct platform_device *op, unsigned int pcic_build_device_irq(struct platform_device *op,
...@@ -329,7 +330,7 @@ int __init pcic_probe(void) ...@@ -329,7 +330,7 @@ int __init pcic_probe(void)
pcic->pcic_res_cfg_addr.name = "pcic_cfg_addr"; pcic->pcic_res_cfg_addr.name = "pcic_cfg_addr";
if ((pcic->pcic_config_space_addr = if ((pcic->pcic_config_space_addr =
ioremap(regs[2].phys_addr, regs[2].reg_size * 2)) == 0) { ioremap(regs[2].phys_addr, regs[2].reg_size * 2)) == NULL) {
prom_printf("PCIC: Error, cannot map " prom_printf("PCIC: Error, cannot map "
"PCI Configuration Space Address.\n"); "PCI Configuration Space Address.\n");
prom_halt(); prom_halt();
...@@ -341,7 +342,7 @@ int __init pcic_probe(void) ...@@ -341,7 +342,7 @@ int __init pcic_probe(void)
*/ */
pcic->pcic_res_cfg_data.name = "pcic_cfg_data"; pcic->pcic_res_cfg_data.name = "pcic_cfg_data";
if ((pcic->pcic_config_space_data = if ((pcic->pcic_config_space_data =
ioremap(regs[3].phys_addr, regs[3].reg_size * 2)) == 0) { ioremap(regs[3].phys_addr, regs[3].reg_size * 2)) == NULL) {
prom_printf("PCIC: Error, cannot map " prom_printf("PCIC: Error, cannot map "
"PCI Configuration Space Data.\n"); "PCI Configuration Space Data.\n");
prom_halt(); prom_halt();
...@@ -353,7 +354,6 @@ int __init pcic_probe(void) ...@@ -353,7 +354,6 @@ int __init pcic_probe(void)
strcpy(pbm->prom_name, namebuf); strcpy(pbm->prom_name, namebuf);
{ {
extern volatile int t_nmi[4];
extern int pcic_nmi_trap_patch[4]; extern int pcic_nmi_trap_patch[4];
t_nmi[0] = pcic_nmi_trap_patch[0]; t_nmi[0] = pcic_nmi_trap_patch[0];
...@@ -536,7 +536,7 @@ pcic_fill_irq(struct linux_pcic *pcic, struct pci_dev *dev, int node) ...@@ -536,7 +536,7 @@ pcic_fill_irq(struct linux_pcic *pcic, struct pci_dev *dev, int node)
prom_getstring(node, "name", namebuf, sizeof(namebuf)); prom_getstring(node, "name", namebuf, sizeof(namebuf));
} }
if ((p = pcic->pcic_imap) == 0) { if ((p = pcic->pcic_imap) == NULL) {
dev->irq = 0; dev->irq = 0;
return; return;
} }
...@@ -670,30 +670,6 @@ void pcibios_fixup_bus(struct pci_bus *bus) ...@@ -670,30 +670,6 @@ void pcibios_fixup_bus(struct pci_bus *bus)
} }
} }
/*
* pcic_pin_to_irq() is exported to bus probing code
*/
unsigned int
pcic_pin_to_irq(unsigned int pin, const char *name)
{
struct linux_pcic *pcic = &pcic0;
unsigned int irq;
unsigned int ivec;
if (pin < 4) {
ivec = readw(pcic->pcic_regs+PCI_INT_SELECT_LO);
irq = ivec >> (pin << 2) & 0xF;
} else if (pin < 8) {
ivec = readw(pcic->pcic_regs+PCI_INT_SELECT_HI);
irq = ivec >> ((pin-4) << 2) & 0xF;
} else { /* Corrupted map */
printk("PCIC: BAD PIN %d FOR %s\n", pin, name);
for (;;) {} /* XXX Cannot panic properly in case of PROLL */
}
/* P3 */ /* printk("PCIC: dev %s pin %d ivec 0x%x irq %x\n", name, pin, ivec, irq); */
return irq;
}
/* Makes compiler happy */ /* Makes compiler happy */
static volatile int pcic_timer_dummy; static volatile int pcic_timer_dummy;
......
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