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
......@@ -129,7 +129,7 @@ typedef struct act2000_chan {
typedef struct msn_entry {
char eaz;
char msn[16];
struct msn_entry * next;
struct msn_entry *next;
} msn_entry;
typedef struct irq_data_isa {
......
......@@ -85,7 +85,7 @@ act2000_isa_interrupt(int dummy, void *dev_id)
}
static void
act2000_isa_select_irq(act2000_card * card)
act2000_isa_select_irq(act2000_card *card)
{
unsigned char reg;
......@@ -117,7 +117,7 @@ act2000_isa_select_irq(act2000_card * card)
}
static void
act2000_isa_enable_irq(act2000_card * card)
act2000_isa_enable_irq(act2000_card *card)
{
act2000_isa_select_irq(card);
/* Enable READ irq */
......@@ -129,7 +129,7 @@ act2000_isa_enable_irq(act2000_card * card)
* If irq is -1, choose next free irq, else irq is given explicitly.
*/
int
act2000_isa_config_irq(act2000_card * card, short irq)
act2000_isa_config_irq(act2000_card *card, short irq)
{
int old_irq;
......@@ -147,7 +147,7 @@ act2000_isa_config_irq(act2000_card * card, short irq)
card->irq = old_irq;
card->flags |= ACT2000_FLAGS_IVALID;
printk(KERN_WARNING
"act2000: Could not request irq %d\n",irq);
"act2000: Could not request irq %d\n", irq);
return -EBUSY;
} else {
act2000_isa_select_irq(card);
......@@ -159,7 +159,7 @@ act2000_isa_config_irq(act2000_card * card, short irq)
}
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) {
release_region(card->port, ISA_REGION);
......@@ -178,7 +178,7 @@ act2000_isa_config_port(act2000_card * card, unsigned short portbase)
* Release ressources, used by an adaptor.
*/
void
act2000_isa_release(act2000_card * card)
act2000_isa_release(act2000_card *card)
{
unsigned long flags;
......@@ -194,7 +194,7 @@ act2000_isa_release(act2000_card * card)
}
static int
act2000_isa_writeb(act2000_card * card, u_char data)
act2000_isa_writeb(act2000_card *card, u_char data)
{
u_char timeout = 40;
......@@ -211,7 +211,7 @@ act2000_isa_writeb(act2000_card * card, u_char data)
}
static int
act2000_isa_readb(act2000_card * card, u_char * data)
act2000_isa_readb(act2000_card *card, u_char *data)
{
u_char timeout = 40;
......@@ -291,7 +291,7 @@ act2000_isa_receive(act2000_card *card)
}
void
act2000_isa_send(act2000_card * card)
act2000_isa_send(act2000_card *card)
{
unsigned long flags;
struct sk_buff *skb;
......@@ -307,7 +307,7 @@ act2000_isa_send(act2000_card * card)
card->ack_msg = card->sbuf->data;
msg = (actcapi_msg *)card->sbuf->data;
if ((msg->hdr.cmd.cmd == 0x86) &&
(msg->hdr.cmd.subcmd == 0) ) {
(msg->hdr.cmd.subcmd == 0)) {
/* Save flags in message */
card->need_b3ack = msg->msg.data_b3_req.flags;
msg->msg.data_b3_req.flags = 0;
......@@ -335,7 +335,7 @@ act2000_isa_send(act2000_card * card)
}
msg = (actcapi_msg *)card->ack_msg;
if ((msg->hdr.cmd.cmd == 0x86) &&
(msg->hdr.cmd.subcmd == 0) ) {
(msg->hdr.cmd.subcmd == 0)) {
/*
* If it's user data, reset data-ptr
* and put skb into ackq.
......@@ -354,11 +354,11 @@ act2000_isa_send(act2000_card * card)
* Get firmware ID, check for 'ISDN' signature.
*/
static int
act2000_isa_getid(act2000_card * card)
act2000_isa_getid(act2000_card *card)
{
act2000_fwid fid;
u_char *p = (u_char *) & fid;
u_char *p = (u_char *)&fid;
int count = 0;
while (1) {
......@@ -392,7 +392,7 @@ act2000_isa_getid(act2000_card * card)
* Download microcode into card, check Firmware signature.
*/
int
act2000_isa_download(act2000_card * card, act2000_ddef __user * cb)
act2000_isa_download(act2000_card *card, act2000_ddef __user *cb)
{
unsigned int length;
int l;
......
......@@ -114,22 +114,22 @@ typedef enum {
/* Macros for accessing ports */
#define ISA_PORT_COR (card->port+ISA_COR)
#define ISA_PORT_ISR (card->port+ISA_ISR)
#define ISA_PORT_EPR (card->port+ISA_EPR)
#define ISA_PORT_EER (card->port+ISA_EER)
#define ISA_PORT_SDI (card->port+ISA_SDI)
#define ISA_PORT_SDO (card->port+ISA_SDO)
#define ISA_PORT_SIS (card->port+ISA_SIS)
#define ISA_PORT_SOS (card->port+ISA_SOS)
#define ISA_PORT_COR (card->port + ISA_COR)
#define ISA_PORT_ISR (card->port + ISA_ISR)
#define ISA_PORT_EPR (card->port + ISA_EPR)
#define ISA_PORT_EER (card->port + ISA_EER)
#define ISA_PORT_SDI (card->port + ISA_SDI)
#define ISA_PORT_SDO (card->port + ISA_SDO)
#define ISA_PORT_SIS (card->port + ISA_SIS)
#define ISA_PORT_SOS (card->port + ISA_SOS)
/* Prototypes */
extern int act2000_isa_detect(unsigned short portbase);
extern int act2000_isa_config_irq(act2000_card * card, short irq);
extern int act2000_isa_config_port(act2000_card * card, unsigned short portbase);
extern int act2000_isa_download(act2000_card * card, act2000_ddef __user * cb);
extern void act2000_isa_release(act2000_card * card);
extern int act2000_isa_config_irq(act2000_card *card, short irq);
extern int act2000_isa_config_port(act2000_card *card, unsigned short portbase);
extern int act2000_isa_download(act2000_card *card, act2000_ddef __user *cb);
extern void act2000_isa_release(act2000_card *card);
extern void act2000_isa_receive(act2000_card *card);
extern void act2000_isa_send(act2000_card *card);
......
......@@ -88,7 +88,7 @@ static actcapi_msgdsc valid_msg[] = {
* 2 = Valid message, B-Channel-data
*/
int
actcapi_chkhdr(act2000_card * card, actcapi_msghdr *hdr)
actcapi_chkhdr(act2000_card *card, actcapi_msghdr *hdr)
{
int i;
......@@ -99,7 +99,7 @@ actcapi_chkhdr(act2000_card * card, actcapi_msghdr *hdr)
for (i = 0; i < num_valid_imsg; i++)
if ((hdr->cmd.cmd == valid_msg[i].cmd.cmd) &&
(hdr->cmd.subcmd == valid_msg[i].cmd.subcmd)) {
return (i?1:2);
return (i ? 1 : 2);
}
return 0;
}
......@@ -113,19 +113,19 @@ actcapi_chkhdr(act2000_card * card, actcapi_msghdr *hdr)
m->hdr.cmd.cmd = c; \
m->hdr.cmd.subcmd = s; \
m->hdr.msgnum = actcapi_nextsmsg(card); \
} else m = NULL;\
}
} else m = NULL; \
}
#define ACTCAPI_CHKSKB if (!skb) { \
printk(KERN_WARNING "actcapi: alloc_skb failed\n"); \
return; \
}
}
#define ACTCAPI_QUEUE_TX { \
actcapi_debug_msg(skb, 1); \
skb_queue_tail(&card->sndq, skb); \
act2000_schedule_tx(card); \
}
}
int
actcapi_listen_req(act2000_card *card)
......@@ -145,7 +145,7 @@ actcapi_listen_req(act2000_card *card)
m->msg.listen_req.controller = 0;
m->msg.listen_req.infomask = 0x3f; /* All information */
m->msg.listen_req.eazmask = eazmask;
m->msg.listen_req.simask = (eazmask)?0x86:0; /* All SI's */
m->msg.listen_req.simask = (eazmask) ? 0x86 : 0; /* All SI's */
ACTCAPI_QUEUE_TX;
return 0;
}
......@@ -168,7 +168,7 @@ actcapi_connect_req(act2000_card *card, act2000_chan *chan, char *phone,
m->msg.connect_req.infomask = 0x3f;
m->msg.connect_req.si1 = si1;
m->msg.connect_req.si2 = si2;
m->msg.connect_req.eaz = eaz?eaz:'0';
m->msg.connect_req.eaz = eaz ? eaz : '0';
m->msg.connect_req.addr.len = strlen(phone) + 1;
m->msg.connect_req.addr.tnp = 0x81;
memcpy(m->msg.connect_req.addr.num, phone, strlen(phone));
......@@ -209,14 +209,14 @@ actcapi_manufacturer_req_net(act2000_card *card)
}
m->msg.manufacturer_req_net.manuf_msg = 0x11;
m->msg.manufacturer_req_net.controller = 1;
m->msg.manufacturer_req_net.nettype = (card->ptype == ISDN_PTYPE_EURO)?1:0;
m->msg.manufacturer_req_net.nettype = (card->ptype == ISDN_PTYPE_EURO) ? 1 : 0;
ACTCAPI_QUEUE_TX;
printk(KERN_INFO "act2000 %s: D-channel protocol now %s\n",
card->interface.id, (card->ptype == ISDN_PTYPE_EURO)?"euro":"1tr6");
card->interface.id, (card->ptype == ISDN_PTYPE_EURO) ? "euro" : "1tr6");
card->interface.features &=
~(ISDN_FEATURE_P_UNKNOWN | ISDN_FEATURE_P_EURO | ISDN_FEATURE_P_1TR6);
card->interface.features |=
((card->ptype == ISDN_PTYPE_EURO)?ISDN_FEATURE_P_EURO:ISDN_FEATURE_P_1TR6);
((card->ptype == ISDN_PTYPE_EURO) ? ISDN_FEATURE_P_EURO : ISDN_FEATURE_P_1TR6);
return 0;
}
......@@ -238,7 +238,7 @@ actcapi_manufacturer_req_v42(act2000_card *card, ulong arg)
}
m->msg.manufacturer_req_v42.manuf_msg = 0x10;
m->msg.manufacturer_req_v42.controller = 0;
m->msg.manufacturer_req_v42.v42control = (arg?1:0);
m->msg.manufacturer_req_v42.v42control = (arg ? 1 : 0);
ACTCAPI_QUEUE_TX;
return 0;
}
......@@ -434,7 +434,7 @@ actcapi_connect_b3_resp(act2000_card *card, act2000_chan *chan, __u8 rejectcause
actcapi_msg *m;
struct sk_buff *skb;
ACTCAPI_MKHDR((rejectcause?3:17), 0x82, 0x03);
ACTCAPI_MKHDR((rejectcause ? 3 : 17), 0x82, 0x03);
ACTCAPI_CHKSKB;
m->msg.connect_b3_resp.ncci = chan->ncci;
m->msg.connect_b3_resp.rejectcause = rejectcause;
......@@ -1030,7 +1030,7 @@ actcapi_debug_msg(struct sk_buff *skb, int direction)
descr = valid_msg[i].description;
break;
}
printk(KERN_DEBUG "%s %s msg\n", direction?"Outgoing":"Incoming", descr);
printk(KERN_DEBUG "%s %s msg\n", direction ? "Outgoing" : "Incoming", descr);
printk(KERN_DEBUG " ApplID = %d\n", msg->hdr.applicationID);
printk(KERN_DEBUG " Len = %d\n", msg->hdr.len);
printk(KERN_DEBUG " MsgNum = 0x%04x\n", msg->hdr.msgnum);
......@@ -1086,7 +1086,7 @@ actcapi_debug_msg(struct sk_buff *skb, int direction)
int l = msg->hdr.len - 12;
int j;
char *p = tmp;
for (j = 0; j < l ; j++)
for (j = 0; j < l; j++)
p += sprintf(p, "%02x ", msg->msg.info_ind.el.display[j]);
printk(KERN_DEBUG " D = '%s'\n", tmp);
}
......
......@@ -46,10 +46,10 @@ typedef struct actcapi_addr {
typedef union actcapi_infonr { /* info number */
__u16 mask; /* info-mask field */
struct bmask { /* bit definitions */
unsigned codes : 3; /* code set */
unsigned rsvd : 5; /* reserved */
unsigned svind : 1; /* single, variable length ind. */
unsigned wtype : 7; /* W-element type */
unsigned codes:3; /* code set */
unsigned rsvd:5; /* reserved */
unsigned svind:1; /* single, variable length ind. */
unsigned wtype:7; /* W-element type */
} bmask;
} actcapi_infonr;
......@@ -59,12 +59,12 @@ typedef union actcapi_infoel { /* info element */
__u8 display[40]; /* display contents */
__u8 uuinfo[40]; /* User-user info field */
struct cause { /* Cause information */
unsigned ext2 : 1; /* extension */
unsigned cod : 2; /* coding standard */
unsigned spare : 1; /* spare */
unsigned loc : 4; /* location */
unsigned ext1 : 1; /* extension */
unsigned cval : 7; /* Cause value */
unsigned ext2:1; /* extension */
unsigned cod:2; /* coding standard */
unsigned spare:1; /* spare */
unsigned loc:4; /* location */
unsigned ext1:1; /* extension */
unsigned cval:7; /* Cause value */
} cause;
struct charge { /* Charging information */
__u8 toc; /* type of charging info */
......@@ -111,14 +111,14 @@ typedef struct actcapi_ncpd {
* Bit 5-7 = Controller
* Bit 8-15 = NCCI
*/
#define MAKE_NCCI(plci,contr,ncci) \
#define MAKE_NCCI(plci, contr, ncci) \
((plci & 0x1f) | ((contr & 0x7) << 5) | ((ncci & 0xff) << 8))
#define EVAL_NCCI(fakencci,plci,contr,ncci) { \
#define EVAL_NCCI(fakencci, plci, contr, ncci) { \
plci = fakencci & 0x1f; \
contr = (fakencci >> 5) & 0x7; \
ncci = (fakencci >> 8) & 0xff; \
}
}
/*
* Layout of PLCI field in a B3 DATA CAPI message is different from
......@@ -128,13 +128,13 @@ typedef struct actcapi_ncpd {
* Bit 5-7 = Controller
* Bit 8-15 = reserved (must be 0)
*/
#define MAKE_PLCI(plci,contr) \
#define MAKE_PLCI(plci, contr) \
((plci & 0x1f) | ((contr & 0x7) << 5))
#define EVAL_PLCI(fakeplci,plci,contr) { \
#define EVAL_PLCI(fakeplci, plci, contr) { \
plci = fakeplci & 0x1f; \
contr = (fakeplci >> 5) & 0x7; \
}
}
typedef struct actcapi_msg {
actcapi_msghdr hdr;
......
......@@ -33,9 +33,9 @@ static int act_port = -1; /* -1 = Autoprobe */
static int act_irq = -1;
static char *act_id = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
MODULE_DESCRIPTION( "ISDN4Linux: Driver for IBM Active 2000 ISDN card");
MODULE_AUTHOR( "Fritz Elfert");
MODULE_LICENSE( "GPL");
MODULE_DESCRIPTION("ISDN4Linux: Driver for IBM Active 2000 ISDN card");
MODULE_AUTHOR("Fritz Elfert");
MODULE_LICENSE("GPL");
MODULE_PARM_DESC(act_bus, "BusType of first card, 1=ISA, 2=MCA, 3=PCMCIA, currently only ISA");
MODULE_PARM_DESC(membase, "Base port address of first card");
MODULE_PARM_DESC(act_irq, "IRQ of first card");
......@@ -111,10 +111,10 @@ act2000_find_eaz(act2000_card *card, char eaz)
while (p) {
if (p->eaz == eaz)
return(p->msn);
return (p->msn);
p = p->next;
}
return("\0");
return ("\0");
}
/*
......@@ -230,17 +230,17 @@ act2000_receive(struct work_struct *work)
static void
act2000_poll(unsigned long data)
{
act2000_card * card = (act2000_card *)data;
act2000_card *card = (act2000_card *)data;
unsigned long flags;
act2000_receive(&card->poll_tq);
spin_lock_irqsave(&card->lock, flags);
mod_timer(&card->ptimer, jiffies+3);
mod_timer(&card->ptimer, jiffies + 3);
spin_unlock_irqrestore(&card->lock, flags);
}
static int
act2000_command(act2000_card * card, isdn_ctrl * c)
act2000_command(act2000_card *card, isdn_ctrl *c)
{
ulong a;
act2000_chan *chan;
......@@ -280,7 +280,7 @@ act2000_command(act2000_card * card, isdn_ctrl * c)
}
return ret;
case ACT2000_IOCTL_SETPROTO:
card->ptype = a?ISDN_PTYPE_EURO:ISDN_PTYPE_1TR6;
card->ptype = a ? ISDN_PTYPE_EURO : ISDN_PTYPE_1TR6;
if (!(card->flags & ACT2000_FLAGS_RUNNING))
return 0;
actcapi_manufacturer_req_net(card);
......@@ -292,7 +292,7 @@ act2000_command(act2000_card * card, isdn_ctrl * c)
if ((ret = act2000_set_msn(card, tmp)))
return ret;
if (card->flags & ACT2000_FLAGS_RUNNING)
return(actcapi_manufacturer_req_msn(card));
return (actcapi_manufacturer_req_msn(card));
return 0;
case ACT2000_IOCTL_ADDCARD:
if (copy_from_user(&cdef, arg,
......@@ -471,7 +471,7 @@ act2000_sendbuf(act2000_card *card, int channel, int ack, struct sk_buff *skb)
/* Read the Status-replies from the Interface */
static int
act2000_readstatus(u_char __user * buf, int len, act2000_card * card)
act2000_readstatus(u_char __user *buf, int len, act2000_card *card)
{
int count;
u_char __user *p;
......@@ -506,7 +506,7 @@ act2000_findcard(int driverid)
* Wrapper functions for interface to linklevel
*/
static int
if_command(isdn_ctrl * c)
if_command(isdn_ctrl *c)
{
act2000_card *card = act2000_findcard(c->driver);
......@@ -534,7 +534,7 @@ if_writecmd(const u_char __user *buf, int len, int id, int channel)
}
static int
if_readstatus(u_char __user * buf, int len, int id, int channel)
if_readstatus(u_char __user *buf, int len, int id, int channel)
{
act2000_card *card = act2000_findcard(id);
......@@ -602,7 +602,7 @@ act2000_alloccard(int bus, int port, int irq, char *id)
card->interface.hl_hdrlen = 20;
card->ptype = ISDN_PTYPE_EURO;
strlcpy(card->interface.id, id, sizeof(card->interface.id));
for (i=0; i<ACT2000_BCH; i++) {
for (i = 0; i < ACT2000_BCH; i++) {
card->bch[i].plci = 0x8000;
card->bch[i].ncci = 0x8000;
card->bch[i].l2prot = ISDN_PROTO_L2_X75I;
......@@ -620,7 +620,7 @@ act2000_alloccard(int bus, int port, int irq, char *id)
* register card at linklevel
*/
static int
act2000_registercard(act2000_card * card)
act2000_registercard(act2000_card *card)
{
switch (card->bus) {
case ACT2000_BUS_ISA:
......@@ -645,7 +645,7 @@ act2000_registercard(act2000_card * card)
}
static void
unregister_card(act2000_card * card)
unregister_card(act2000_card *card)
{
isdn_ctrl cmd;
......
......@@ -391,7 +391,7 @@ gen_data_b3_resp_for(struct capiminor *mp, struct sk_buff *skb)
struct sk_buff *nskb;
nskb = alloc_skb(CAPI_DATA_B3_RESP_LEN, GFP_KERNEL);
if (nskb) {
u16 datahandle = CAPIMSG_U16(skb->data,CAPIMSG_BASELEN+4+4+2);
u16 datahandle = CAPIMSG_U16(skb->data, CAPIMSG_BASELEN + 4 + 4 + 2);
unsigned char *s = skb_put(nskb, CAPI_DATA_B3_RESP_LEN);
capimsg_setu16(s, 0, CAPI_DATA_B3_RESP_LEN);
capimsg_setu16(s, 2, mp->ap->applid);
......@@ -618,7 +618,7 @@ static void capi_recv_message(struct capi20_appl *ap, struct sk_buff *skb)
goto unlock_out;
}
if (CAPIMSG_SUBCOMMAND(skb->data) == CAPI_IND) {
datahandle = CAPIMSG_U16(skb->data, CAPIMSG_BASELEN+4+4+2);
datahandle = CAPIMSG_U16(skb->data, CAPIMSG_BASELEN + 4 + 4 + 2);
pr_debug("capi_signal: DATA_B3_IND %u len=%d\n",
datahandle, skb->len-CAPIMSG_LEN(skb->data));
skb_queue_tail(&mp->inqueue, skb);
......@@ -627,10 +627,10 @@ static void capi_recv_message(struct capi20_appl *ap, struct sk_buff *skb)
} else if (CAPIMSG_SUBCOMMAND(skb->data) == CAPI_CONF) {
datahandle = CAPIMSG_U16(skb->data, CAPIMSG_BASELEN+4);
datahandle = CAPIMSG_U16(skb->data, CAPIMSG_BASELEN + 4);
pr_debug("capi_signal: DATA_B3_CONF %u 0x%x\n",
datahandle,
CAPIMSG_U16(skb->data, CAPIMSG_BASELEN+4+2));
CAPIMSG_U16(skb->data, CAPIMSG_BASELEN + 4 + 2));
kfree_skb(skb);
capiminor_del_ack(mp, datahandle);
tty = tty_port_tty_get(&mp->port);
......@@ -736,7 +736,7 @@ capi_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos
}
static unsigned int
capi_poll(struct file *file, poll_table * wait)
capi_poll(struct file *file, poll_table *wait)
{
struct capidev *cdev = file->private_data;
unsigned int mask = 0;
......@@ -804,7 +804,7 @@ register_out:
if (copy_from_user(&data.contr, argp,
sizeof(data.contr)))
return -EFAULT;
cdev->errcode = capi20_get_serial (data.contr, data.serial);
cdev->errcode = capi20_get_serial(data.contr, data.serial);
if (cdev->errcode)
return -EIO;
if (copy_to_user(argp, data.serial,
......@@ -1070,7 +1070,7 @@ static int capinc_tty_write(struct tty_struct *tty,
mp->outbytes += skb->len;
}