Commit 475be4d8 authored by Joe Perches's avatar Joe Perches

isdn: whitespace coding style cleanup

isdn source code uses a not-current coding style.

Update the coding style used on a per-line basis
so that git diff -w shows only elided blank lines
at EOF.

Done with emacs and some scripts and some typing.

Built x86 allyesconfig.
No detected change in objdump -d or size.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
parent 0b0a635f
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* *
* Author Fritz Elfert * Author Fritz Elfert
* Copyright by Fritz Elfert <fritz@isdn4linux.de> * Copyright by Fritz Elfert <fritz@isdn4linux.de>
* *
* This software may be used and distributed according to the terms * This software may be used and distributed according to the terms
* of the GNU General Public License, incorporated herein by reference. * of the GNU General Public License, incorporated herein by reference.
* *
...@@ -40,21 +40,21 @@ ...@@ -40,21 +40,21 @@
/* Struct for adding new cards */ /* Struct for adding new cards */
typedef struct act2000_cdef { typedef struct act2000_cdef {
int bus; int bus;
int port; int port;
int irq; int irq;
char id[10]; char id[10];
} act2000_cdef; } act2000_cdef;
/* Struct for downloading firmware */ /* Struct for downloading firmware */
typedef struct act2000_ddef { typedef struct act2000_ddef {
int length; /* Length of code */ int length; /* Length of code */
char __user *buffer; /* Ptr. to code */ char __user *buffer; /* Ptr. to code */
} act2000_ddef; } act2000_ddef;
typedef struct act2000_fwid { typedef struct act2000_fwid {
char isdn[4]; char isdn[4];
char revlen[2]; char revlen[2];
char revision[504]; char revision[504];
} act2000_fwid; } act2000_fwid;
#if defined(__KERNEL__) || defined(__DEBUGVAR__) #if defined(__KERNEL__) || defined(__DEBUGVAR__)
...@@ -128,8 +128,8 @@ typedef struct act2000_chan { ...@@ -128,8 +128,8 @@ typedef struct act2000_chan {
typedef struct msn_entry { typedef struct msn_entry {
char eaz; char eaz;
char msn[16]; char msn[16];
struct msn_entry * next; struct msn_entry *next;
} msn_entry; } msn_entry;
typedef struct irq_data_isa { typedef struct irq_data_isa {
...@@ -183,17 +183,17 @@ typedef struct act2000_card { ...@@ -183,17 +183,17 @@ typedef struct act2000_card {
static inline void act2000_schedule_tx(act2000_card *card) static inline void act2000_schedule_tx(act2000_card *card)
{ {
schedule_work(&card->snd_tq); schedule_work(&card->snd_tq);
} }
static inline void act2000_schedule_rx(act2000_card *card) static inline void act2000_schedule_rx(act2000_card *card)
{ {
schedule_work(&card->rcv_tq); schedule_work(&card->rcv_tq);
} }
static inline void act2000_schedule_poll(act2000_card *card) static inline void act2000_schedule_poll(act2000_card *card)
{ {
schedule_work(&card->poll_tq); schedule_work(&card->poll_tq);
} }
extern char *act2000_find_eaz(act2000_card *, char); extern char *act2000_find_eaz(act2000_card *, char);
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* *
* Author Fritz Elfert * Author Fritz Elfert
* Copyright by Fritz Elfert <fritz@isdn4linux.de> * Copyright by Fritz Elfert <fritz@isdn4linux.de>
* *
* This software may be used and distributed according to the terms * This software may be used and distributed according to the terms
* of the GNU General Public License, incorporated herein by reference. * of the GNU General Public License, incorporated herein by reference.
* *
...@@ -25,99 +25,99 @@ ...@@ -25,99 +25,99 @@
static int static int
act2000_isa_reset(unsigned short portbase) act2000_isa_reset(unsigned short portbase)
{ {
unsigned char reg; unsigned char reg;
int i; int i;
int found; int found;
int serial = 0; int serial = 0;
found = 0; found = 0;
if ((reg = inb(portbase + ISA_COR)) != 0xff) { if ((reg = inb(portbase + ISA_COR)) != 0xff) {
outb(reg | ISA_COR_RESET, portbase + ISA_COR); outb(reg | ISA_COR_RESET, portbase + ISA_COR);
mdelay(10); mdelay(10);
outb(reg, portbase + ISA_COR); outb(reg, portbase + ISA_COR);
mdelay(10); mdelay(10);
for (i = 0; i < 16; i++) { for (i = 0; i < 16; i++) {
if (inb(portbase + ISA_ISR) & ISA_ISR_SERIAL) if (inb(portbase + ISA_ISR) & ISA_ISR_SERIAL)
serial |= 0x10000; serial |= 0x10000;
serial >>= 1; serial >>= 1;
} }
if (serial == ISA_SER_ID) if (serial == ISA_SER_ID)
found++; found++;
} }
return found; return found;
} }
int int
act2000_isa_detect(unsigned short portbase) act2000_isa_detect(unsigned short portbase)
{ {
int ret = 0; int ret = 0;
if (request_region(portbase, ACT2000_PORTLEN, "act2000isa")) { if (request_region(portbase, ACT2000_PORTLEN, "act2000isa")) {
ret = act2000_isa_reset(portbase); ret = act2000_isa_reset(portbase);
release_region(portbase, ISA_REGION); release_region(portbase, ISA_REGION);
} }
return ret; return ret;
} }
static irqreturn_t static irqreturn_t
act2000_isa_interrupt(int dummy, void *dev_id) act2000_isa_interrupt(int dummy, void *dev_id)
{ {
act2000_card *card = dev_id; act2000_card *card = dev_id;
u_char istatus; u_char istatus;
istatus = (inb(ISA_PORT_ISR) & 0x07); istatus = (inb(ISA_PORT_ISR) & 0x07);
if (istatus & ISA_ISR_OUT) { if (istatus & ISA_ISR_OUT) {
/* RX fifo has data */ /* RX fifo has data */
istatus &= ISA_ISR_OUT_MASK; istatus &= ISA_ISR_OUT_MASK;
outb(0, ISA_PORT_SIS); outb(0, ISA_PORT_SIS);
act2000_isa_receive(card); act2000_isa_receive(card);
outb(ISA_SIS_INT, ISA_PORT_SIS); outb(ISA_SIS_INT, ISA_PORT_SIS);
} }
if (istatus & ISA_ISR_ERR) { if (istatus & ISA_ISR_ERR) {
/* Error Interrupt */ /* Error Interrupt */
istatus &= ISA_ISR_ERR_MASK; istatus &= ISA_ISR_ERR_MASK;
printk(KERN_WARNING "act2000: errIRQ\n"); printk(KERN_WARNING "act2000: errIRQ\n");
} }
if (istatus) if (istatus)
printk(KERN_DEBUG "act2000: ?IRQ %d %02x\n", card->irq, istatus); printk(KERN_DEBUG "act2000: ?IRQ %d %02x\n", card->irq, istatus);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
static void static void
act2000_isa_select_irq(act2000_card * card) act2000_isa_select_irq(act2000_card *card)
{ {
unsigned char reg; unsigned char reg;
reg = (inb(ISA_PORT_COR) & ~ISA_COR_IRQOFF) | ISA_COR_PERR; reg = (inb(ISA_PORT_COR) & ~ISA_COR_IRQOFF) | ISA_COR_PERR;
switch (card->irq) { switch (card->irq) {
case 3: case 3:
reg = ISA_COR_IRQ03; reg = ISA_COR_IRQ03;
break; break;
case 5: case 5:
reg = ISA_COR_IRQ05; reg = ISA_COR_IRQ05;
break; break;
case 7: case 7:
reg = ISA_COR_IRQ07; reg = ISA_COR_IRQ07;
break; break;
case 10: case 10:
reg = ISA_COR_IRQ10; reg = ISA_COR_IRQ10;
break; break;
case 11: case 11:
reg = ISA_COR_IRQ11; reg = ISA_COR_IRQ11;
break; break;
case 12: case 12:
reg = ISA_COR_IRQ12; reg = ISA_COR_IRQ12;
break; break;
case 15: case 15:
reg = ISA_COR_IRQ15; reg = ISA_COR_IRQ15;
break; break;
} }
outb(reg, ISA_PORT_COR); outb(reg, ISA_PORT_COR);
} }
static void static void
act2000_isa_enable_irq(act2000_card * card) act2000_isa_enable_irq(act2000_card *card)
{ {
act2000_isa_select_irq(card); act2000_isa_select_irq(card);
/* Enable READ irq */ /* Enable READ irq */
...@@ -129,102 +129,102 @@ act2000_isa_enable_irq(act2000_card * card) ...@@ -129,102 +129,102 @@ act2000_isa_enable_irq(act2000_card * card)
* If irq is -1, choose next free irq, else irq is given explicitly. * If irq is -1, choose next free irq, else irq is given explicitly.
*/ */
int int
act2000_isa_config_irq(act2000_card * card, short irq) act2000_isa_config_irq(act2000_card *card, short irq)
{ {
int old_irq; int old_irq;
if (card->flags & ACT2000_FLAGS_IVALID) { if (card->flags & ACT2000_FLAGS_IVALID) {
free_irq(card->irq, card); free_irq(card->irq, card);
} }
card->flags &= ~ACT2000_FLAGS_IVALID; card->flags &= ~ACT2000_FLAGS_IVALID;
outb(ISA_COR_IRQOFF, ISA_PORT_COR); outb(ISA_COR_IRQOFF, ISA_PORT_COR);
if (!irq) if (!irq)
return 0; return 0;
old_irq = card->irq; old_irq = card->irq;
card->irq = irq; card->irq = irq;
if (request_irq(irq, &act2000_isa_interrupt, 0, card->regname, card)) { if (request_irq(irq, &act2000_isa_interrupt, 0, card->regname, card)) {
card->irq = old_irq; card->irq = old_irq;
card->flags |= ACT2000_FLAGS_IVALID; card->flags |= ACT2000_FLAGS_IVALID;
printk(KERN_WARNING printk(KERN_WARNING
"act2000: Could not request irq %d\n",irq); "act2000: Could not request irq %d\n", irq);
return -EBUSY; return -EBUSY;
} else { } else {
act2000_isa_select_irq(card); act2000_isa_select_irq(card);
/* Disable READ and WRITE irq */ /* Disable READ and WRITE irq */
outb(0, ISA_PORT_SIS); outb(0, ISA_PORT_SIS);
outb(0, ISA_PORT_SOS); outb(0, ISA_PORT_SOS);
} }
return 0; return 0;
} }
int int
act2000_isa_config_port(act2000_card * card, unsigned short portbase) act2000_isa_config_port(act2000_card *card, unsigned short portbase)
{ {
if (card->flags & ACT2000_FLAGS_PVALID) { if (card->flags & ACT2000_FLAGS_PVALID) {
release_region(card->port, ISA_REGION); release_region(card->port, ISA_REGION);
card->flags &= ~ACT2000_FLAGS_PVALID; card->flags &= ~ACT2000_FLAGS_PVALID;
} }
if (request_region(portbase, ACT2000_PORTLEN, card->regname) == NULL) if (request_region(portbase, ACT2000_PORTLEN, card->regname) == NULL)
return -EBUSY; return -EBUSY;
else { else {
card->port = portbase; card->port = portbase;
card->flags |= ACT2000_FLAGS_PVALID; card->flags |= ACT2000_FLAGS_PVALID;
return 0; return 0;
} }
} }
/* /*
* Release ressources, used by an adaptor. * Release ressources, used by an adaptor.
*/ */
void void
act2000_isa_release(act2000_card * card) act2000_isa_release(act2000_card *card)
{ {
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&card->lock, flags); spin_lock_irqsave(&card->lock, flags);
if (card->flags & ACT2000_FLAGS_IVALID) if (card->flags & ACT2000_FLAGS_IVALID)
free_irq(card->irq, card); free_irq(card->irq, card);
card->flags &= ~ACT2000_FLAGS_IVALID; card->flags &= ~ACT2000_FLAGS_IVALID;
if (card->flags & ACT2000_FLAGS_PVALID) if (card->flags & ACT2000_FLAGS_PVALID)
release_region(card->port, ISA_REGION); release_region(card->port, ISA_REGION);
card->flags &= ~ACT2000_FLAGS_PVALID; card->flags &= ~ACT2000_FLAGS_PVALID;
spin_unlock_irqrestore(&card->lock, flags); spin_unlock_irqrestore(&card->lock, flags);
} }
static int static int
act2000_isa_writeb(act2000_card * card, u_char data) act2000_isa_writeb(act2000_card *card, u_char data)
{ {
u_char timeout = 40; u_char timeout = 40;
while (timeout) { while (timeout) {
if (inb(ISA_PORT_SOS) & ISA_SOS_READY) { if (inb(ISA_PORT_SOS) & ISA_SOS_READY) {
outb(data, ISA_PORT_SDO); outb(data, ISA_PORT_SDO);
return 0; return 0;
} else { } else {
timeout--; timeout--;
udelay(10); udelay(10);
} }
} }
return 1; return 1;
} }
static int static int
act2000_isa_readb(act2000_card * card, u_char * data) act2000_isa_readb(act2000_card *card, u_char *data)
{ {
u_char timeout = 40; u_char timeout = 40;
while (timeout) { while (timeout) {
if (inb(ISA_PORT_SIS) & ISA_SIS_READY) { if (inb(ISA_PORT_SIS) & ISA_SIS_READY) {
*data = inb(ISA_PORT_SDI); *data = inb(ISA_PORT_SDI);
return 0; return 0;
} else { } else {
timeout--; timeout--;
udelay(10); udelay(10);
} }
} }
return 1; return 1;
} }
void void
...@@ -232,11 +232,11 @@ act2000_isa_receive(act2000_card *card) ...@@ -232,11 +232,11 @@ act2000_isa_receive(act2000_card *card)
{ {
u_char c; u_char c;
if (test_and_set_bit(ACT2000_LOCK_RX, (void *) &card->ilock) != 0) if (test_and_set_bit(ACT2000_LOCK_RX, (void *) &card->ilock) != 0)
return; return;
while (!act2000_isa_readb(card, &c)) { while (!act2000_isa_readb(card, &c)) {
if (card->idat.isa.rcvidx < 8) { if (card->idat.isa.rcvidx < 8) {
card->idat.isa.rcvhdr[card->idat.isa.rcvidx++] = c; card->idat.isa.rcvhdr[card->idat.isa.rcvidx++] = c;
if (card->idat.isa.rcvidx == 8) { if (card->idat.isa.rcvidx == 8) {
int valid = actcapi_chkhdr(card, (actcapi_msghdr *)&card->idat.isa.rcvhdr); int valid = actcapi_chkhdr(card, (actcapi_msghdr *)&card->idat.isa.rcvhdr);
...@@ -291,14 +291,14 @@ act2000_isa_receive(act2000_card *card) ...@@ -291,14 +291,14 @@ act2000_isa_receive(act2000_card *card)
} }
void void
act2000_isa_send(act2000_card * card)