Commit 2985ad5c authored by Steven Cole's avatar Steven Cole Committed by Christoph Hellwig

[PATCH] Avast there ye swabs, prepare to fire a broadside!

Chuck Ebbert notes that kernel developers are apparently pirates in the
_original_ meaning of the word, and like to "cannonicalize".

I prepared a patch in case anyone cares enough about this.  I tested on
i386 by building and booting.
parent cfdffa91
......@@ -1451,7 +1451,7 @@ static int set_serial_info(struct async_struct * info,
goto check_and_exit;
}
new_serial.irq = irq_cannonicalize(new_serial.irq);
new_serial.irq = irq_canonicalize(new_serial.irq);
if ((new_serial.irq >= NR_IRQS) || (new_serial.irq < 0) ||
(new_serial.baud_base < 9600)|| (new_serial.type < PORT_UNKNOWN) ||
......@@ -2662,7 +2662,7 @@ static int __init rs_init(void)
state->icount.rx = state->icount.tx = 0;
state->icount.frame = state->icount.parity = 0;
state->icount.overrun = state->icount.brk = 0;
state->irq = irq_cannonicalize(state->irq);
state->irq = irq_canonicalize(state->irq);
if (state->hub6)
state->io_type = SERIAL_IO_HUB6;
if (state->port && check_region(state->port,8)) {
......
......@@ -161,7 +161,7 @@ void mask_irq(int irq)
DBG_IRQ(irq, ("mask_irq(%d) %d+%d eiem 0x%lx\n", irq,
IRQ_REGION(irq), IRQ_OFFSET(irq), cpu_eiem));
irq = irq_cannonicalize(irq);
irq = irq_canonicalize(irq);
region = irq_region[IRQ_REGION(irq)];
if (region->ops.mask_irq)
region->ops.mask_irq(region->data.dev, IRQ_OFFSET(irq));
......@@ -173,7 +173,7 @@ void unmask_irq(int irq)
DBG_IRQ(irq, ("unmask_irq(%d) %d+%d eiem 0x%lx\n", irq,
IRQ_REGION(irq), IRQ_OFFSET(irq), cpu_eiem));
irq = irq_cannonicalize(irq);
irq = irq_canonicalize(irq);
region = irq_region[IRQ_REGION(irq)];
if (region->ops.unmask_irq)
region->ops.unmask_irq(region->data.dev, IRQ_OFFSET(irq));
......@@ -185,7 +185,7 @@ void disable_irq(int irq)
DBG_IRQ(irq, ("disable_irq(%d) %d+%d eiem 0x%lx\n", irq,
IRQ_REGION(irq), IRQ_OFFSET(irq), cpu_eiem));
irq = irq_cannonicalize(irq);
irq = irq_canonicalize(irq);
region = irq_region[IRQ_REGION(irq)];
if (region->ops.disable_irq)
region->ops.disable_irq(region->data.dev, IRQ_OFFSET(irq));
......@@ -199,7 +199,7 @@ void enable_irq(int irq)
DBG_IRQ(irq, ("enable_irq(%d) %d+%d eiem 0x%lx\n", irq,
IRQ_REGION(irq), IRQ_OFFSET(irq), cpu_eiem));
irq = irq_cannonicalize(irq);
irq = irq_canonicalize(irq);
region = irq_region[IRQ_REGION(irq)];
if (region->ops.enable_irq)
......@@ -594,7 +594,7 @@ int request_irq(unsigned int irq,
printk(KERN_INFO "request_irq(%d, %p, 0x%lx, %s, %p)\n",irq, handler, irqflags, devname, dev_id);
#endif
irq = irq_cannonicalize(irq);
irq = irq_canonicalize(irq);
/* request_irq()/free_irq() may not be called from interrupt context. */
if (in_interrupt())
BUG();
......@@ -654,7 +654,7 @@ void free_irq(unsigned int irq, void *dev_id)
struct irqaction *action, **p;
/* See comments in request_irq() about interrupt context */
irq = irq_cannonicalize(irq);
irq = irq_canonicalize(irq);
if (in_interrupt()) BUG();
......
......@@ -101,7 +101,7 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
ppc_md.setup_arch = oak_setup_arch;
ppc_md.show_percpuinfo = oak_show_percpuinfo;
ppc_md.irq_cannonicalize = NULL;
ppc_md.irq_canonicalize = NULL;
ppc_md.init_IRQ = oak_init_IRQ;
ppc_md.get_irq = oak_get_irq;
ppc_md.init = NULL;
......
......@@ -189,7 +189,7 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
ppc_md.setup_arch = adir_setup_arch;
ppc_md.show_cpuinfo = adir_show_cpuinfo;
ppc_md.irq_cannonicalize = NULL;
ppc_md.irq_canonicalize = NULL;
ppc_md.init_IRQ = adir_init_IRQ;
ppc_md.get_irq = adir_get_irq;
ppc_md.init = NULL;
......
......@@ -306,7 +306,7 @@ chrp_halt(void)
}
u_int __chrp
chrp_irq_cannonicalize(u_int irq)
chrp_irq_canonicalize(u_int irq)
{
if (irq == 2)
return 9;
......@@ -456,7 +456,7 @@ chrp_init(unsigned long r3, unsigned long r4, unsigned long r5,
ppc_md.setup_arch = chrp_setup_arch;
ppc_md.show_percpuinfo = of_show_percpuinfo;
ppc_md.show_cpuinfo = chrp_show_cpuinfo;
ppc_md.irq_cannonicalize = chrp_irq_cannonicalize;
ppc_md.irq_canonicalize = chrp_irq_canonicalize;
ppc_md.init_IRQ = chrp_init_IRQ;
ppc_md.get_irq = openpic_get_irq;
......
......@@ -437,7 +437,7 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
ppc_md.setup_arch = ev64260_setup_arch;
ppc_md.show_cpuinfo = ev64260_show_cpuinfo;
ppc_md.irq_cannonicalize = NULL;
ppc_md.irq_canonicalize = NULL;
ppc_md.init_IRQ = ev64260_init_irq;
ppc_md.get_irq = gt64260_get_irq;
ppc_md.init = NULL;
......
......@@ -559,7 +559,7 @@ void __init platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
ppc_md.setup_arch = gemini_setup_arch;
ppc_md.show_cpuinfo = gemini_show_cpuinfo;
ppc_md.irq_cannonicalize = NULL;
ppc_md.irq_canonicalize = NULL;
ppc_md.init_IRQ = gemini_init_IRQ;
ppc_md.get_irq = openpic_get_irq;
ppc_md.init = NULL;
......
......@@ -67,7 +67,7 @@ lopec_show_cpuinfo(struct seq_file *m)
}
static u32
lopec_irq_cannonicalize(u32 irq)
lopec_irq_canonicalize(u32 irq)
{
if (irq == 2)
return 9;
......@@ -360,7 +360,7 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
ppc_md.setup_arch = lopec_setup_arch;
ppc_md.show_cpuinfo = lopec_show_cpuinfo;
ppc_md.irq_cannonicalize = lopec_irq_cannonicalize;
ppc_md.irq_canonicalize = lopec_irq_canonicalize;
ppc_md.init_IRQ = lopec_init_IRQ;
ppc_md.get_irq = openpic_get_irq;
......
......@@ -201,7 +201,7 @@ mcpn765_init_IRQ(void)
}
static u32
mcpn765_irq_cannonicalize(u32 irq)
mcpn765_irq_canonicalize(u32 irq)
{
if (irq == 2)
return 9;
......@@ -434,7 +434,7 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
ppc_md.setup_arch = mcpn765_setup_arch;
ppc_md.show_cpuinfo = mcpn765_show_cpuinfo;
ppc_md.irq_cannonicalize = mcpn765_irq_cannonicalize;
ppc_md.irq_canonicalize = mcpn765_irq_canonicalize;
ppc_md.init_IRQ = mcpn765_init_IRQ;
ppc_md.get_irq = openpic_get_irq;
ppc_md.init = mcpn765_init2;
......
......@@ -619,7 +619,7 @@ pmac_init(unsigned long r3, unsigned long r4, unsigned long r5,
ppc_md.setup_arch = pmac_setup_arch;
ppc_md.show_cpuinfo = pmac_show_cpuinfo;
ppc_md.show_percpuinfo = pmac_show_percpuinfo;
ppc_md.irq_cannonicalize = NULL;
ppc_md.irq_canonicalize = NULL;
ppc_md.init_IRQ = pmac_pic_init;
ppc_md.get_irq = pmac_get_irq; /* Changed later on ... */
......
......@@ -206,7 +206,7 @@ pplus_power_off(void)
}
static unsigned int
pplus_irq_cannonicalize(u_int irq)
pplus_irq_canonicalize(u_int irq)
{
if (irq == 2)
{
......@@ -469,7 +469,7 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
ppc_md.setup_arch = pplus_setup_arch;
ppc_md.show_percpuinfo = NULL;
ppc_md.show_cpuinfo = pplus_show_cpuinfo;
ppc_md.irq_cannonicalize = pplus_irq_cannonicalize;
ppc_md.irq_canonicalize = pplus_irq_canonicalize;
ppc_md.init_IRQ = pplus_init_IRQ;
/* this gets changed later on if we have an OpenPIC -- Cort */
ppc_md.get_irq = i8259_irq;
......
......@@ -976,7 +976,7 @@ mk48t59_calibrate_decr(void)
}
static unsigned int __prep
prep_irq_cannonicalize(u_int irq)
prep_irq_canonicalize(u_int irq)
{
if (irq == 2)
{
......@@ -1150,7 +1150,7 @@ prep_init(unsigned long r3, unsigned long r4, unsigned long r5,
ppc_md.setup_arch = prep_setup_arch;
ppc_md.show_percpuinfo = prep_show_percpuinfo;
ppc_md.show_cpuinfo = NULL; /* set in prep_setup_arch() */
ppc_md.irq_cannonicalize = prep_irq_cannonicalize;
ppc_md.irq_canonicalize = prep_irq_canonicalize;
ppc_md.init_IRQ = prep_init_IRQ;
/* this gets changed later on if we have an OpenPIC -- Cort */
ppc_md.get_irq = i8259_irq;
......
......@@ -349,7 +349,7 @@ sandpoint_get_irq(struct pt_regs *regs)
}
static u32
sandpoint_irq_cannonicalize(u32 irq)
sandpoint_irq_canonicalize(u32 irq)
{
if (irq == 2)
{
......@@ -602,7 +602,7 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
ppc_md.setup_arch = sandpoint_setup_arch;
ppc_md.show_cpuinfo = sandpoint_show_cpuinfo;
ppc_md.irq_cannonicalize = sandpoint_irq_cannonicalize;
ppc_md.irq_canonicalize = sandpoint_irq_canonicalize;
ppc_md.init_IRQ = sandpoint_init_IRQ;
ppc_md.get_irq = sandpoint_get_irq;
ppc_md.init = sandpoint_init2;
......
......@@ -331,7 +331,7 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
ppc_md.setup_arch = zx4500_setup_arch;
ppc_md.show_cpuinfo = zx4500_show_cpuinfo;
ppc_md.irq_cannonicalize = NULL;
ppc_md.irq_canonicalize = NULL;
ppc_md.init_IRQ = zx4500_init_IRQ;
ppc_md.get_irq = openpic_get_irq;
ppc_md.init = NULL;
......
......@@ -243,7 +243,7 @@ m8260_init(unsigned long r3, unsigned long r4, unsigned long r5,
ppc_md.setup_arch = m8260_setup_arch;
ppc_md.show_percpuinfo = m8260_show_percpuinfo;
ppc_md.irq_cannonicalize = NULL;
ppc_md.irq_canonicalize = NULL;
ppc_md.init_IRQ = m8260_init_IRQ;
ppc_md.get_irq = m8260_get_irq;
ppc_md.init = NULL;
......
......@@ -377,7 +377,7 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
ppc_md.setup_arch = m8xx_setup_arch;
ppc_md.show_percpuinfo = m8xx_show_percpuinfo;
ppc_md.irq_cannonicalize = NULL;
ppc_md.irq_canonicalize = NULL;
ppc_md.init_IRQ = m8xx_init_IRQ;
ppc_md.get_irq = m8xx_get_irq;
ppc_md.init = NULL;
......
......@@ -4608,7 +4608,7 @@ int mgsl_enum_isa_devices()
/* Copy user configuration info to device instance data */
info->io_base = (unsigned int)io[i];
info->irq_level = (unsigned int)irq[i];
info->irq_level = irq_cannonicalize(info->irq_level);
info->irq_level = irq_canonicalize(info->irq_level);
info->dma_level = (unsigned int)dma[i];
info->bus_type = MGSL_BUS_TYPE_ISA;
info->io_addr_size = 16;
......
......@@ -167,7 +167,7 @@ static int __init ac_probe1(int ioaddr, struct net_device *dev)
dev->irq = config2irq(inb(ioaddr + AC_CONFIG));
printk(", using");
} else {
dev->irq = irq_cannonicalize(dev->irq);
dev->irq = irq_canonicalize(dev->irq);
printk(", assigning");
}
......
......@@ -1830,7 +1830,7 @@ static void __init serial8250_isa_init_ports(void)
for (i = 0, up = serial8250_ports; i < ARRAY_SIZE(old_serial_port);
i++, up++) {
up->port.iobase = old_serial_port[i].port;
up->port.irq = irq_cannonicalize(old_serial_port[i].irq);
up->port.irq = irq_canonicalize(old_serial_port[i].irq);
up->port.uartclk = old_serial_port[i].baud_base * 16;
up->port.flags = old_serial_port[i].flags |
UPF_RESOURCES;
......
......@@ -683,7 +683,7 @@ uart_set_info(struct uart_state *state, struct serial_struct *newinfo)
if (HIGH_BITS_OFFSET)
new_port += (unsigned long) new_serial.port_high << HIGH_BITS_OFFSET;
new_serial.irq = irq_cannonicalize(new_serial.irq);
new_serial.irq = irq_canonicalize(new_serial.irq);
/*
* This semaphore protects state->count. It is also
......
......@@ -64,7 +64,7 @@
# define NR_IRQS 16
#endif
static __inline__ int irq_cannonicalize(int irq)
static __inline__ int irq_canonicalize(int irq)
{
/*
* XXX is this true for all Alpha's? The old serial driver
......
......@@ -57,4 +57,4 @@
*/
#define FIQ_START 64
#define irq_cannonicalize(i) (i)
#define irq_canonicalize(i) (i)
......@@ -95,4 +95,4 @@
#define AUX_IRQ (machine_is_netwinder() ? IRQ_NETWINDER_PS2MOUSE : IRQ_ISA_PS2MOUSE)
#define IRQ_FLOPPYDISK IRQ_ISA_FLOPPY
#define irq_cannonicalize(_i) (((_i) == IRQ_ISA_CASCADE) ? IRQ_ISA_2 : _i)
#define irq_canonicalize(_i) (((_i) == IRQ_ISA_CASCADE) ? IRQ_ISA_2 : _i)
......@@ -31,4 +31,4 @@
/* timer is part of the DUART */
#define IRQ_TIMER IRQ_DUART
#define irq_cannonicalize(i) (i)
#define irq_canonicalize(i) (i)
......@@ -26,4 +26,4 @@
#define IRQ_EXPMODCS0 12
#define IRQ_EXPMODCS1 13
#define irq_cannonicalize(i) (i)
#define irq_canonicalize(i) (i)
......@@ -3,8 +3,8 @@
#include <asm/arch/irqs.h>
#ifndef irq_cannonicalize
#define irq_cannonicalize(i) (i)
#ifndef irq_canonicalize
#define irq_canonicalize(i) (i)
#endif
#ifndef NR_IRQS
......
......@@ -13,7 +13,7 @@
#define IRQ_SCHED_TIMER (40) /* interrupt source for scheduling timer */
static __inline__ int irq_cannonicalize(int irq)
static __inline__ int irq_canonicalize(int irq)
{
return irq;
}
......
......@@ -15,7 +15,7 @@
/* include comes from machine specific directory */
#include "irq_vectors.h"
static __inline__ int irq_cannonicalize(int irq)
static __inline__ int irq_canonicalize(int irq)
{
return ((irq == 2) ? 9 : irq);
}
......
......@@ -6,7 +6,7 @@
* David Mosberger-Tang <davidm@hpl.hp.com>
* Stephane Eranian <eranian@hpl.hp.com>
*
* 11/24/98 S.Eranian updated TIMER_IRQ and irq_cannonicalize
* 11/24/98 S.Eranian updated TIMER_IRQ and irq_canonicalize
* 01/20/99 S.Eranian added keyboard interrupt
* 02/29/00 D.Mosberger moved most things into hw_irq.h
*/
......@@ -14,7 +14,7 @@
#define NR_IRQS 256
static __inline__ int
irq_cannonicalize (int irq)
irq_canonicalize (int irq)
{
/*
* We do the legacy thing here of pretending that irqs < 16
......
......@@ -45,7 +45,7 @@
#define IRQ_SCHED_TIMER (8) /* interrupt source for scheduling timer */
static __inline__ int irq_cannonicalize(int irq)
static __inline__ int irq_canonicalize(int irq)
{
return irq;
}
......
......@@ -16,12 +16,12 @@
#define TIMER_IRQ 0
#ifdef CONFIG_I8259
static inline int irq_cannonicalize(int irq)
static inline int irq_canonicalize(int irq)
{
return ((irq == 2) ? 9 : irq);
}
#else
#define irq_cannonicalize(irq) (irq) /* Sane hardware, sane code ... */
#define irq_canonicalize(irq) (irq) /* Sane hardware, sane code ... */
#endif
struct irqaction;
......
......@@ -34,12 +34,12 @@ extern int node_level_to_irq[MAX_COMPACT_NODES][PERNODE_LEVELS];
(node_level_to_irq[CPUID_TO_COMPACT_NODEID(c)][(l)])
#ifdef CONFIG_I8259
static inline int irq_cannonicalize(int irq)
static inline int irq_canonicalize(int irq)
{
return ((irq == 2) ? 9 : irq);
}
#else
#define irq_cannonicalize(irq) (irq) /* Sane hardware, sane code ... */
#define irq_canonicalize(irq) (irq) /* Sane hardware, sane code ... */
#endif
......
......@@ -66,7 +66,7 @@ struct irq_region {
extern struct irq_region *irq_region[NR_IRQ_REGS];
static __inline__ int irq_cannonicalize(int irq)
static __inline__ int irq_canonicalize(int irq)
{
#ifdef CONFIG_EISA
return (irq == (IRQ_FROM_REGION(EISA_IRQ_REGION)+2)
......
......@@ -66,7 +66,7 @@ extern void enable_irq(unsigned int);
#define NR_IRQS ((NR_UIC_IRQS * NR_UICS) + NR_BOARD_IRQS)
#endif
static __inline__ int
irq_cannonicalize(int irq)
irq_canonicalize(int irq)
{
return (irq);
}
......@@ -78,7 +78,7 @@ irq_cannonicalize(int irq)
#define NR_IRQS (NR_UIC_IRQS + NR_BOARD_IRQS)
static __inline__ int
irq_cannonicalize(int irq)
irq_canonicalize(int irq)
{
return (irq);
}
......@@ -148,7 +148,7 @@ irq_cannonicalize(int irq)
#define mk_int_int_mask(IL) (1 << (7 - (IL/2)))
/* always the same on 8xx -- Cort */
static __inline__ int irq_cannonicalize(int irq)
static __inline__ int irq_canonicalize(int irq)
{
return irq;
}
......@@ -196,10 +196,10 @@ static __inline__ int irq_cannonicalize(int irq)
* powermacs as well as prep/chrp boxes.
* Prep and chrp both have cascaded 8259 PICs.
*/
static __inline__ int irq_cannonicalize(int irq)
static __inline__ int irq_canonicalize(int irq)
{
if (ppc_md.irq_cannonicalize)
return ppc_md.irq_cannonicalize(irq);
if (ppc_md.irq_canonicalize)
return ppc_md.irq_canonicalize(irq);
return irq;
}
......
......@@ -25,7 +25,7 @@ struct machdep_calls {
int (*show_cpuinfo)(struct seq_file *m);
int (*show_percpuinfo)(struct seq_file *m, int i);
/* Optional, may be NULL. */
unsigned int (*irq_cannonicalize)(unsigned int irq);
unsigned int (*irq_canonicalize)(unsigned int irq);
void (*init_IRQ)(void);
int (*get_irq)(struct pt_regs *);
......
......@@ -46,7 +46,7 @@ static inline unsigned long virt_irq_to_real(unsigned long virt_irq) {
* powermacs as well as prep/chrp boxes.
* Prep and chrp both have cascaded 8259 PICs.
*/
static __inline__ int irq_cannonicalize(int irq)
static __inline__ int irq_canonicalize(int irq)
{
return irq;
}
......
......@@ -25,6 +25,6 @@
#define SERIAL_PORT_DFNS STD_SERIAL_PORT_DEFNS
/* XXX: This should be moved ino irq.h */
#define irq_cannonicalize(x) (x)
#define irq_canonicalize(x) (x)
#endif /* _ASM_SERIAL_BIGSUR_H */
......@@ -21,4 +21,4 @@
#define SERIAL_PORT_DFNS STD_SERIAL_PORT_DEFNS
/* XXX: This should be moved ino irq.h */
#define irq_cannonicalize(x) (x)
#define irq_canonicalize(x) (x)
......@@ -49,7 +49,7 @@
#define SERIAL_PORT_DFNS STD_SERIAL_PORT_DEFNS
/* XXX: This should be moved ino irq.h */
#define irq_cannonicalize(x) (x)
#define irq_canonicalize(x) (x)
#endif
#endif /* _ASM_SERIAL_H */
......@@ -22,7 +22,7 @@ BTFIXUPDEF_CALL(char *, __irq_itoa, unsigned int)
#define NR_IRQS 16
#define irq_cannonicalize(irq) (irq)
#define irq_canonicalize(irq) (irq)
/* Dave Redman (djhr@tadpole.co.uk)
* changed these to function pointers.. it saves cycles and will allow
......
......@@ -114,7 +114,7 @@ static __inline__ char *__irq_itoa(unsigned int irq)
#define NR_IRQS 16
#define irq_cannonicalize(irq) (irq)
#define irq_canonicalize(irq) (irq)
extern void disable_irq(unsigned int);
#define disable_irq_nosync disable_irq
extern void enable_irq(unsigned int);
......
......@@ -37,7 +37,7 @@ struct pt_regs;
struct hw_interrupt_type;
struct irqaction;
#define irq_cannonicalize(irq) (irq)
#define irq_canonicalize(irq) (irq)
/* Initialize irq handling for IRQs.
BASE_IRQ, BASE_IRQ+INTERVAL, ..., BASE_IRQ+NUM*INTERVAL
......
......@@ -23,7 +23,7 @@
*/
#define NR_IRQS 224
static __inline__ int irq_cannonicalize(int irq)
static __inline__ int irq_canonicalize(int irq)
{
return ((irq == 2) ? 9 : irq);
}
......
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