提交 76fd0209 编写于 作者: J Jeff Garzik 提交者: Linus Torvalds

[PATCH] ISDN: several minor fixes

pcbit: kill 'may be used uninitialized' warning.  although the code does
eventually fill the 32 bits it cares about, the variable truly is
accessed uninitialized in each macro.  Easier to just clean it up now.

sc: fix a ton of obviously incorrect printk's (some with missing
arguments even)
Signed-off-by: NJeff Garzik <jeff@garzik.org>
Acked-by: NKarsten Keil <kkeil@suse.de>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 bf02c082
...@@ -311,6 +311,7 @@ pcbit_deliver(void *data) ...@@ -311,6 +311,7 @@ pcbit_deliver(void *data)
dev->read_queue = frame->next; dev->read_queue = frame->next;
spin_unlock_irqrestore(&dev->lock, flags); spin_unlock_irqrestore(&dev->lock, flags);
msg = 0;
SET_MSG_CPU(msg, 0); SET_MSG_CPU(msg, 0);
SET_MSG_PROC(msg, 0); SET_MSG_PROC(msg, 0);
SET_MSG_CMD(msg, frame->skb->data[2]); SET_MSG_CMD(msg, frame->skb->data[2]);
......
...@@ -98,13 +98,14 @@ static int __init sc_init(void) ...@@ -98,13 +98,14 @@ static int __init sc_init(void)
* Confirm the I/O Address with a test * Confirm the I/O Address with a test
*/ */
if(io[b] == 0) { if(io[b] == 0) {
pr_debug("I/O Address 0x%x is in use.\n"); pr_debug("I/O Address invalid.\n");
continue; continue;
} }
outb(0x18, io[b] + 0x400 * EXP_PAGE0); outb(0x18, io[b] + 0x400 * EXP_PAGE0);
if(inb(io[b] + 0x400 * EXP_PAGE0) != 0x18) { if(inb(io[b] + 0x400 * EXP_PAGE0) != 0x18) {
pr_debug("I/O Base 0x%x fails test\n"); pr_debug("I/O Base 0x%x fails test\n",
io[b] + 0x400 * EXP_PAGE0);
continue; continue;
} }
} }
...@@ -158,8 +159,8 @@ static int __init sc_init(void) ...@@ -158,8 +159,8 @@ static int __init sc_init(void)
outb(0xFF, io[b] + RESET_OFFSET); outb(0xFF, io[b] + RESET_OFFSET);
msleep_interruptible(10000); msleep_interruptible(10000);
} }
pr_debug("RAM Base for board %d is 0x%x, %s probe\n", b, ram[b], pr_debug("RAM Base for board %d is 0x%lx, %s probe\n", b,
ram[b] == 0 ? "will" : "won't"); ram[b], ram[b] == 0 ? "will" : "won't");
if(ram[b]) { if(ram[b]) {
/* /*
...@@ -168,7 +169,7 @@ static int __init sc_init(void) ...@@ -168,7 +169,7 @@ static int __init sc_init(void)
* board model * board model
*/ */
if(request_region(ram[b], SRAM_PAGESIZE, "sc test")) { if(request_region(ram[b], SRAM_PAGESIZE, "sc test")) {
pr_debug("request_region for RAM base 0x%x succeeded\n", ram[b]); pr_debug("request_region for RAM base 0x%lx succeeded\n", ram[b]);
model = identify_board(ram[b], io[b]); model = identify_board(ram[b], io[b]);
release_region(ram[b], SRAM_PAGESIZE); release_region(ram[b], SRAM_PAGESIZE);
} }
...@@ -204,7 +205,7 @@ static int __init sc_init(void) ...@@ -204,7 +205,7 @@ static int __init sc_init(void)
* Nope, there was no place in RAM for the * Nope, there was no place in RAM for the
* board, or it couldn't be identified * board, or it couldn't be identified
*/ */
pr_debug("Failed to find an adapter at 0x%x\n", ram[b]); pr_debug("Failed to find an adapter at 0x%lx\n", ram[b]);
continue; continue;
} }
...@@ -451,7 +452,7 @@ static int identify_board(unsigned long rambase, unsigned int iobase) ...@@ -451,7 +452,7 @@ static int identify_board(unsigned long rambase, unsigned int iobase)
HWConfig_pl hwci; HWConfig_pl hwci;
int x; int x;
pr_debug("Attempting to identify adapter @ 0x%x io 0x%x\n", pr_debug("Attempting to identify adapter @ 0x%lx io 0x%x\n",
rambase, iobase); rambase, iobase);
/* /*
...@@ -490,7 +491,7 @@ static int identify_board(unsigned long rambase, unsigned int iobase) ...@@ -490,7 +491,7 @@ static int identify_board(unsigned long rambase, unsigned int iobase)
outb(PRI_BASEPG_VAL, pgport); outb(PRI_BASEPG_VAL, pgport);
msleep_interruptible(1000); msleep_interruptible(1000);
sig = readl(rambase + SIG_OFFSET); sig = readl(rambase + SIG_OFFSET);
pr_debug("Looking for a signature, got 0x%x\n", sig); pr_debug("Looking for a signature, got 0x%lx\n", sig);
if(sig == SIGNATURE) if(sig == SIGNATURE)
return PRI_BOARD; return PRI_BOARD;
...@@ -500,7 +501,7 @@ static int identify_board(unsigned long rambase, unsigned int iobase) ...@@ -500,7 +501,7 @@ static int identify_board(unsigned long rambase, unsigned int iobase)
outb(BRI_BASEPG_VAL, pgport); outb(BRI_BASEPG_VAL, pgport);
msleep_interruptible(1000); msleep_interruptible(1000);
sig = readl(rambase + SIG_OFFSET); sig = readl(rambase + SIG_OFFSET);
pr_debug("Looking for a signature, got 0x%x\n", sig); pr_debug("Looking for a signature, got 0x%lx\n", sig);
if(sig == SIGNATURE) if(sig == SIGNATURE)
return BRI_BOARD; return BRI_BOARD;
...@@ -510,7 +511,7 @@ static int identify_board(unsigned long rambase, unsigned int iobase) ...@@ -510,7 +511,7 @@ static int identify_board(unsigned long rambase, unsigned int iobase)
* Try to spot a card * Try to spot a card
*/ */
sig = readl(rambase + SIG_OFFSET); sig = readl(rambase + SIG_OFFSET);
pr_debug("Looking for a signature, got 0x%x\n", sig); pr_debug("Looking for a signature, got 0x%lx\n", sig);
if(sig != SIGNATURE) if(sig != SIGNATURE)
return -1; return -1;
...@@ -540,7 +541,7 @@ static int identify_board(unsigned long rambase, unsigned int iobase) ...@@ -540,7 +541,7 @@ static int identify_board(unsigned long rambase, unsigned int iobase)
memcpy_fromio(&rcvmsg, &(dpm->rsp_queue[dpm->rsp_tail]), MSG_LEN); memcpy_fromio(&rcvmsg, &(dpm->rsp_queue[dpm->rsp_tail]), MSG_LEN);
pr_debug("Got HWConfig response, status = 0x%x\n", rcvmsg.rsp_status); pr_debug("Got HWConfig response, status = 0x%x\n", rcvmsg.rsp_status);
memcpy(&hwci, &(rcvmsg.msg_data.HWCresponse), sizeof(HWConfig_pl)); memcpy(&hwci, &(rcvmsg.msg_data.HWCresponse), sizeof(HWConfig_pl));
pr_debug("Hardware Config: Interface: %s, RAM Size: %d, Serial: %s\n" pr_debug("Hardware Config: Interface: %s, RAM Size: %ld, Serial: %s\n"
" Part: %s, Rev: %s\n", " Part: %s, Rev: %s\n",
hwci.st_u_sense ? "S/T" : "U", hwci.ram_size, hwci.st_u_sense ? "S/T" : "U", hwci.ram_size,
hwci.serial_no, hwci.part_no, hwci.rev_no); hwci.serial_no, hwci.part_no, hwci.rev_no);
......
...@@ -44,7 +44,7 @@ int sndpkt(int devId, int channel, struct sk_buff *data) ...@@ -44,7 +44,7 @@ int sndpkt(int devId, int channel, struct sk_buff *data)
return -ENODEV; return -ENODEV;
} }
pr_debug("%s: sndpkt: frst = 0x%x nxt = %d f = %d n = %d\n", pr_debug("%s: sndpkt: frst = 0x%lx nxt = %d f = %d n = %d\n",
sc_adapter[card]->devicename, sc_adapter[card]->devicename,
sc_adapter[card]->channel[channel].first_sendbuf, sc_adapter[card]->channel[channel].first_sendbuf,
sc_adapter[card]->channel[channel].next_sendbuf, sc_adapter[card]->channel[channel].next_sendbuf,
...@@ -66,7 +66,7 @@ int sndpkt(int devId, int channel, struct sk_buff *data) ...@@ -66,7 +66,7 @@ int sndpkt(int devId, int channel, struct sk_buff *data)
ReqLnkWrite.buff_offset = sc_adapter[card]->channel[channel].next_sendbuf * ReqLnkWrite.buff_offset = sc_adapter[card]->channel[channel].next_sendbuf *
BUFFER_SIZE + sc_adapter[card]->channel[channel].first_sendbuf; BUFFER_SIZE + sc_adapter[card]->channel[channel].first_sendbuf;
ReqLnkWrite.msg_len = data->len; /* sk_buff size */ ReqLnkWrite.msg_len = data->len; /* sk_buff size */
pr_debug("%s: writing %d bytes to buffer offset 0x%x\n", pr_debug("%s: writing %d bytes to buffer offset 0x%lx\n",
sc_adapter[card]->devicename, sc_adapter[card]->devicename,
ReqLnkWrite.msg_len, ReqLnkWrite.buff_offset); ReqLnkWrite.msg_len, ReqLnkWrite.buff_offset);
memcpy_toshmem(card, (char *)ReqLnkWrite.buff_offset, data->data, ReqLnkWrite.msg_len); memcpy_toshmem(card, (char *)ReqLnkWrite.buff_offset, data->data, ReqLnkWrite.msg_len);
...@@ -74,7 +74,7 @@ int sndpkt(int devId, int channel, struct sk_buff *data) ...@@ -74,7 +74,7 @@ int sndpkt(int devId, int channel, struct sk_buff *data)
/* /*
* sendmessage * sendmessage
*/ */
pr_debug("%s: sndpkt size=%d, buf_offset=0x%x buf_indx=%d\n", pr_debug("%s: sndpkt size=%d, buf_offset=0x%lx buf_indx=%d\n",
sc_adapter[card]->devicename, sc_adapter[card]->devicename,
ReqLnkWrite.msg_len, ReqLnkWrite.buff_offset, ReqLnkWrite.msg_len, ReqLnkWrite.buff_offset,
sc_adapter[card]->channel[channel].next_sendbuf); sc_adapter[card]->channel[channel].next_sendbuf);
...@@ -124,7 +124,7 @@ void rcvpkt(int card, RspMessage *rcvmsg) ...@@ -124,7 +124,7 @@ void rcvpkt(int card, RspMessage *rcvmsg)
return; return;
} }
skb_put(skb, rcvmsg->msg_data.response.msg_len); skb_put(skb, rcvmsg->msg_data.response.msg_len);
pr_debug("%s: getting data from offset: 0x%x\n", pr_debug("%s: getting data from offset: 0x%lx\n",
sc_adapter[card]->devicename, sc_adapter[card]->devicename,
rcvmsg->msg_data.response.buff_offset); rcvmsg->msg_data.response.buff_offset);
memcpy_fromshmem(card, memcpy_fromshmem(card,
...@@ -143,7 +143,7 @@ void rcvpkt(int card, RspMessage *rcvmsg) ...@@ -143,7 +143,7 @@ void rcvpkt(int card, RspMessage *rcvmsg)
/* memset_shmem(card, rcvmsg->msg_data.response.buff_offset, 0, BUFFER_SIZE); */ /* memset_shmem(card, rcvmsg->msg_data.response.buff_offset, 0, BUFFER_SIZE); */
newll.buff_offset = rcvmsg->msg_data.response.buff_offset; newll.buff_offset = rcvmsg->msg_data.response.buff_offset;
newll.msg_len = BUFFER_SIZE; newll.msg_len = BUFFER_SIZE;
pr_debug("%s: recycled buffer at offset 0x%x size %d\n", pr_debug("%s: recycled buffer at offset 0x%lx size %d\n",
sc_adapter[card]->devicename, sc_adapter[card]->devicename,
newll.buff_offset, newll.msg_len); newll.buff_offset, newll.msg_len);
sendmessage(card, CEPID, ceReqTypeLnk, ceReqClass1, ceReqLnkRead, sendmessage(card, CEPID, ceReqTypeLnk, ceReqClass1, ceReqLnkRead,
...@@ -186,7 +186,7 @@ int setup_buffers(int card, int c) ...@@ -186,7 +186,7 @@ int setup_buffers(int card, int c)
sc_adapter[card]->channel[c-1].num_sendbufs = nBuffers / 2; sc_adapter[card]->channel[c-1].num_sendbufs = nBuffers / 2;
sc_adapter[card]->channel[c-1].free_sendbufs = nBuffers / 2; sc_adapter[card]->channel[c-1].free_sendbufs = nBuffers / 2;
sc_adapter[card]->channel[c-1].next_sendbuf = 0; sc_adapter[card]->channel[c-1].next_sendbuf = 0;
pr_debug("%s: send buffer setup complete: first=0x%x n=%d f=%d, nxt=%d\n", pr_debug("%s: send buffer setup complete: first=0x%lx n=%d f=%d, nxt=%d\n",
sc_adapter[card]->devicename, sc_adapter[card]->devicename,
sc_adapter[card]->channel[c-1].first_sendbuf, sc_adapter[card]->channel[c-1].first_sendbuf,
sc_adapter[card]->channel[c-1].num_sendbufs, sc_adapter[card]->channel[c-1].num_sendbufs,
...@@ -203,7 +203,7 @@ int setup_buffers(int card, int c) ...@@ -203,7 +203,7 @@ int setup_buffers(int card, int c)
((sc_adapter[card]->channel[c-1].first_sendbuf + ((sc_adapter[card]->channel[c-1].first_sendbuf +
(nBuffers / 2) * buffer_size) + (buffer_size * i)); (nBuffers / 2) * buffer_size) + (buffer_size * i));
RcvBuffOffset.msg_len = buffer_size; RcvBuffOffset.msg_len = buffer_size;
pr_debug("%s: adding RcvBuffer #%d offset=0x%x sz=%d bufsz:%d\n", pr_debug("%s: adding RcvBuffer #%d offset=0x%lx sz=%d bufsz:%d\n",
sc_adapter[card]->devicename, sc_adapter[card]->devicename,
i + 1, RcvBuffOffset.buff_offset, i + 1, RcvBuffOffset.buff_offset,
RcvBuffOffset.msg_len,buffer_size); RcvBuffOffset.msg_len,buffer_size);
......
...@@ -61,7 +61,7 @@ void memcpy_toshmem(int card, void *dest, const void *src, size_t n) ...@@ -61,7 +61,7 @@ void memcpy_toshmem(int card, void *dest, const void *src, size_t n)
spin_unlock_irqrestore(&sc_adapter[card]->lock, flags); spin_unlock_irqrestore(&sc_adapter[card]->lock, flags);
pr_debug("%s: set page to %#x\n",sc_adapter[card]->devicename, pr_debug("%s: set page to %#x\n",sc_adapter[card]->devicename,
((sc_adapter[card]->shmem_magic + ch * SRAM_PAGESIZE)>>14)|0x80); ((sc_adapter[card]->shmem_magic + ch * SRAM_PAGESIZE)>>14)|0x80);
pr_debug("%s: copying %d bytes from %#x to %#x\n", pr_debug("%s: copying %d bytes from %#lx to %#lx\n",
sc_adapter[card]->devicename, n, sc_adapter[card]->devicename, n,
(unsigned long) src, (unsigned long) src,
sc_adapter[card]->rambase + ((unsigned long) dest %0x4000)); sc_adapter[card]->rambase + ((unsigned long) dest %0x4000));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册