aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2010-11-10 13:54:58 -0500
committerDavid S. Miller <davem@davemloft.net>2010-11-17 13:58:22 -0500
commit9920239c90d5f6dadfb44325abf3568a5e3fd827 (patch)
tree5508c2643cc7cb3164c169539fbbab810de63bf9 /drivers/isdn
parent1f1aaf82825865a50cef0b4722607abb12aeee52 (diff)
drivers/isdn/hisax: Add printf format/argument verification and fix fallout
Add __attribute__((format... to several functins Make formats and arguments match. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/isdn')
-rw-r--r--drivers/isdn/hisax/avm_pci.c2
-rw-r--r--drivers/isdn/hisax/callc.c4
-rw-r--r--drivers/isdn/hisax/hfc_2bds0.c4
-rw-r--r--drivers/isdn/hisax/hfc_2bs0.c2
-rw-r--r--drivers/isdn/hisax/hfc_pci.c4
-rw-r--r--drivers/isdn/hisax/hfc_sx.c6
-rw-r--r--drivers/isdn/hisax/hisax.h2
-rw-r--r--drivers/isdn/hisax/ipacx.c2
-rw-r--r--drivers/isdn/hisax/isar.c6
-rw-r--r--drivers/isdn/hisax/isdnl1.h1
-rw-r--r--drivers/isdn/hisax/isdnl3.c2
-rw-r--r--drivers/isdn/hisax/netjet.c10
-rw-r--r--drivers/isdn/hisax/st5481_d.c6
13 files changed, 28 insertions, 23 deletions
diff --git a/drivers/isdn/hisax/avm_pci.c b/drivers/isdn/hisax/avm_pci.c
index fcf4ed1cb4b9..0e66af1decd4 100644
--- a/drivers/isdn/hisax/avm_pci.c
+++ b/drivers/isdn/hisax/avm_pci.c
@@ -314,7 +314,7 @@ hdlc_fill_fifo(struct BCState *bcs)
314 bcs->hw.hdlc.ctrl.sr.cmd |= HDLC_CMD_XME; 314 bcs->hw.hdlc.ctrl.sr.cmd |= HDLC_CMD_XME;
315 } 315 }
316 if ((cs->debug & L1_DEB_HSCX) && !(cs->debug & L1_DEB_HSCX_FIFO)) 316 if ((cs->debug & L1_DEB_HSCX) && !(cs->debug & L1_DEB_HSCX_FIFO))
317 debugl1(cs, "hdlc_fill_fifo %d/%ld", count, bcs->tx_skb->len); 317 debugl1(cs, "hdlc_fill_fifo %d/%u", count, bcs->tx_skb->len);
318 p = bcs->tx_skb->data; 318 p = bcs->tx_skb->data;
319 ptr = (u_int *)p; 319 ptr = (u_int *)p;
320 skb_pull(bcs->tx_skb, count); 320 skb_pull(bcs->tx_skb, count);
diff --git a/drivers/isdn/hisax/callc.c b/drivers/isdn/hisax/callc.c
index f150330b5a23..37e685eafd24 100644
--- a/drivers/isdn/hisax/callc.c
+++ b/drivers/isdn/hisax/callc.c
@@ -65,7 +65,7 @@ hisax_findcard(int driverid)
65 return (struct IsdnCardState *) 0; 65 return (struct IsdnCardState *) 0;
66} 66}
67 67
68static void 68static __attribute__((format(printf, 3, 4))) void
69link_debug(struct Channel *chanp, int direction, char *fmt, ...) 69link_debug(struct Channel *chanp, int direction, char *fmt, ...)
70{ 70{
71 va_list args; 71 va_list args;
@@ -1068,7 +1068,7 @@ init_d_st(struct Channel *chanp)
1068 return 0; 1068 return 0;
1069} 1069}
1070 1070
1071static void 1071static __attribute__((format(printf, 2, 3))) void
1072callc_debug(struct FsmInst *fi, char *fmt, ...) 1072callc_debug(struct FsmInst *fi, char *fmt, ...)
1073{ 1073{
1074 va_list args; 1074 va_list args;
diff --git a/drivers/isdn/hisax/hfc_2bds0.c b/drivers/isdn/hisax/hfc_2bds0.c
index 7250f56a5246..a16459a1332c 100644
--- a/drivers/isdn/hisax/hfc_2bds0.c
+++ b/drivers/isdn/hisax/hfc_2bds0.c
@@ -292,7 +292,7 @@ hfc_fill_fifo(struct BCState *bcs)
292 } 292 }
293 count = GetFreeFifoBytes_B(bcs); 293 count = GetFreeFifoBytes_B(bcs);
294 if (cs->debug & L1_DEB_HSCX) 294 if (cs->debug & L1_DEB_HSCX)
295 debugl1(cs, "hfc_fill_fifo %d count(%ld/%d),%lx", 295 debugl1(cs, "hfc_fill_fifo %d count(%u/%d),%lx",
296 bcs->channel, bcs->tx_skb->len, 296 bcs->channel, bcs->tx_skb->len,
297 count, current->state); 297 count, current->state);
298 if (count < bcs->tx_skb->len) { 298 if (count < bcs->tx_skb->len) {
@@ -719,7 +719,7 @@ hfc_fill_dfifo(struct IsdnCardState *cs)
719 } 719 }
720 count = GetFreeFifoBytes_D(cs); 720 count = GetFreeFifoBytes_D(cs);
721 if (cs->debug & L1_DEB_ISAC) 721 if (cs->debug & L1_DEB_ISAC)
722 debugl1(cs, "hfc_fill_Dfifo count(%ld/%d)", 722 debugl1(cs, "hfc_fill_Dfifo count(%u/%d)",
723 cs->tx_skb->len, count); 723 cs->tx_skb->len, count);
724 if (count < cs->tx_skb->len) { 724 if (count < cs->tx_skb->len) {
725 if (cs->debug & L1_DEB_ISAC) 725 if (cs->debug & L1_DEB_ISAC)
diff --git a/drivers/isdn/hisax/hfc_2bs0.c b/drivers/isdn/hisax/hfc_2bs0.c
index b1f6481e1193..626f85df302b 100644
--- a/drivers/isdn/hisax/hfc_2bs0.c
+++ b/drivers/isdn/hisax/hfc_2bs0.c
@@ -282,7 +282,7 @@ hfc_fill_fifo(struct BCState *bcs)
282 count += cs->hw.hfc.fifosize; 282 count += cs->hw.hfc.fifosize;
283 } /* L1_MODE_TRANS */ 283 } /* L1_MODE_TRANS */
284 if (cs->debug & L1_DEB_HSCX) 284 if (cs->debug & L1_DEB_HSCX)
285 debugl1(cs, "hfc_fill_fifo %d count(%ld/%d)", 285 debugl1(cs, "hfc_fill_fifo %d count(%u/%d)",
286 bcs->channel, bcs->tx_skb->len, 286 bcs->channel, bcs->tx_skb->len,
287 count); 287 count);
288 if (count < bcs->tx_skb->len) { 288 if (count < bcs->tx_skb->len) {
diff --git a/drivers/isdn/hisax/hfc_pci.c b/drivers/isdn/hisax/hfc_pci.c
index 917cc84065bd..3147020d188b 100644
--- a/drivers/isdn/hisax/hfc_pci.c
+++ b/drivers/isdn/hisax/hfc_pci.c
@@ -550,7 +550,7 @@ hfcpci_fill_dfifo(struct IsdnCardState *cs)
550 count += D_FIFO_SIZE; /* count now contains available bytes */ 550 count += D_FIFO_SIZE; /* count now contains available bytes */
551 551
552 if (cs->debug & L1_DEB_ISAC) 552 if (cs->debug & L1_DEB_ISAC)
553 debugl1(cs, "hfcpci_fill_Dfifo count(%ld/%d)", 553 debugl1(cs, "hfcpci_fill_Dfifo count(%u/%d)",
554 cs->tx_skb->len, count); 554 cs->tx_skb->len, count);
555 if (count < cs->tx_skb->len) { 555 if (count < cs->tx_skb->len) {
556 if (cs->debug & L1_DEB_ISAC) 556 if (cs->debug & L1_DEB_ISAC)
@@ -681,7 +681,7 @@ hfcpci_fill_fifo(struct BCState *bcs)
681 count += B_FIFO_SIZE; /* count now contains available bytes */ 681 count += B_FIFO_SIZE; /* count now contains available bytes */
682 682
683 if (cs->debug & L1_DEB_HSCX) 683 if (cs->debug & L1_DEB_HSCX)
684 debugl1(cs, "hfcpci_fill_fifo %d count(%ld/%d),%lx", 684 debugl1(cs, "hfcpci_fill_fifo %d count(%u/%d),%lx",
685 bcs->channel, bcs->tx_skb->len, 685 bcs->channel, bcs->tx_skb->len,
686 count, current->state); 686 count, current->state);
687 687
diff --git a/drivers/isdn/hisax/hfc_sx.c b/drivers/isdn/hisax/hfc_sx.c
index 5aa138eb0b3c..1235b7131ae1 100644
--- a/drivers/isdn/hisax/hfc_sx.c
+++ b/drivers/isdn/hisax/hfc_sx.c
@@ -179,7 +179,7 @@ write_fifo(struct IsdnCardState *cs, struct sk_buff *skb, u_char fifo, int trans
179 count += fifo_size; /* count now contains available bytes */ 179 count += fifo_size; /* count now contains available bytes */
180 180
181 if (cs->debug & L1_DEB_ISAC_FIFO) 181 if (cs->debug & L1_DEB_ISAC_FIFO)
182 debugl1(cs, "hfcsx_write_fifo %d count(%ld/%d)", 182 debugl1(cs, "hfcsx_write_fifo %d count(%u/%d)",
183 fifo, skb->len, count); 183 fifo, skb->len, count);
184 if (count < skb->len) { 184 if (count < skb->len) {
185 if (cs->debug & L1_DEB_ISAC_FIFO) 185 if (cs->debug & L1_DEB_ISAC_FIFO)
@@ -265,7 +265,7 @@ read_fifo(struct IsdnCardState *cs, u_char fifo, int trans_max)
265 count++; 265 count++;
266 266
267 if (cs->debug & L1_DEB_ISAC_FIFO) 267 if (cs->debug & L1_DEB_ISAC_FIFO)
268 debugl1(cs, "hfcsx_read_fifo %d count %ld)", 268 debugl1(cs, "hfcsx_read_fifo %d count %u)",
269 fifo, count); 269 fifo, count);
270 270
271 if ((count > fifo_size) || (count < 4)) { 271 if ((count > fifo_size) || (count < 4)) {
@@ -986,7 +986,7 @@ HFCSX_l1hw(struct PStack *st, int pr, void *arg)
986 default: 986 default:
987 spin_unlock_irqrestore(&cs->lock, flags); 987 spin_unlock_irqrestore(&cs->lock, flags);
988 if (cs->debug & L1_DEB_WARN) 988 if (cs->debug & L1_DEB_WARN)
989 debugl1(cs, "hfcsx_l1hw loop invalid %4lx", arg); 989 debugl1(cs, "hfcsx_l1hw loop invalid %4lx", (unsigned long)arg);
990 return; 990 return;
991 } 991 }
992 cs->hw.hfcsx.trm |= 0x80; /* enable IOM-loop */ 992 cs->hw.hfcsx.trm |= 0x80; /* enable IOM-loop */
diff --git a/drivers/isdn/hisax/hisax.h b/drivers/isdn/hisax/hisax.h
index 32ab3924aa73..de1c669c7b13 100644
--- a/drivers/isdn/hisax/hisax.h
+++ b/drivers/isdn/hisax/hisax.h
@@ -1286,7 +1286,9 @@ int jiftime(char *s, long mark);
1286 1286
1287int HiSax_command(isdn_ctrl * ic); 1287int HiSax_command(isdn_ctrl * ic);
1288int HiSax_writebuf_skb(int id, int chan, int ack, struct sk_buff *skb); 1288int HiSax_writebuf_skb(int id, int chan, int ack, struct sk_buff *skb);
1289__attribute__((format(printf, 3, 4)))
1289void HiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, ...); 1290void HiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, ...);
1291__attribute__((format(printf, 3, 0)))
1290void VHiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, va_list args); 1292void VHiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, va_list args);
1291void HiSax_reportcard(int cardnr, int sel); 1293void HiSax_reportcard(int cardnr, int sel);
1292int QuickHex(char *txt, u_char * p, int cnt); 1294int QuickHex(char *txt, u_char * p, int cnt);
diff --git a/drivers/isdn/hisax/ipacx.c b/drivers/isdn/hisax/ipacx.c
index 751b25f2ff58..332104103e18 100644
--- a/drivers/isdn/hisax/ipacx.c
+++ b/drivers/isdn/hisax/ipacx.c
@@ -717,7 +717,7 @@ bch_mode(struct BCState *bcs, int mode, int bc)
717 717
718 bc = bc ? 1 : 0; // in case bc is greater than 1 718 bc = bc ? 1 : 0; // in case bc is greater than 1
719 if (cs->debug & L1_DEB_HSCX) 719 if (cs->debug & L1_DEB_HSCX)
720 debugl1(cs, "mode_bch() switch B-% mode %d chan %d", hscx, mode, bc); 720 debugl1(cs, "mode_bch() switch B-%d mode %d chan %d", hscx, mode, bc);
721 bcs->mode = mode; 721 bcs->mode = mode;
722 bcs->channel = bc; 722 bcs->channel = bc;
723 723
diff --git a/drivers/isdn/hisax/isar.c b/drivers/isdn/hisax/isar.c
index 2e72227bd071..1be4552d94b4 100644
--- a/drivers/isdn/hisax/isar.c
+++ b/drivers/isdn/hisax/isar.c
@@ -953,7 +953,7 @@ isar_pump_statev_modem(struct BCState *bcs, u_char devt) {
953 break; 953 break;
954 case PSEV_GSTN_CLR: 954 case PSEV_GSTN_CLR:
955 if (cs->debug & L1_DEB_HSCX) 955 if (cs->debug & L1_DEB_HSCX)
956 debugl1(cs, "pump stev GSTN CLEAR", devt); 956 debugl1(cs, "pump stev GSTN CLEAR");
957 break; 957 break;
958 default: 958 default:
959 if (cs->debug & L1_DEB_HSCX) 959 if (cs->debug & L1_DEB_HSCX)
@@ -1268,7 +1268,7 @@ isar_int_main(struct IsdnCardState *cs)
1268static void 1268static void
1269ftimer_handler(struct BCState *bcs) { 1269ftimer_handler(struct BCState *bcs) {
1270 if (bcs->cs->debug) 1270 if (bcs->cs->debug)
1271 debugl1(bcs->cs, "ftimer flags %04x", 1271 debugl1(bcs->cs, "ftimer flags %04lx",
1272 bcs->Flag); 1272 bcs->Flag);
1273 test_and_clear_bit(BC_FLG_FTI_RUN, &bcs->Flag); 1273 test_and_clear_bit(BC_FLG_FTI_RUN, &bcs->Flag);
1274 if (test_and_clear_bit(BC_FLG_LL_CONN, &bcs->Flag)) { 1274 if (test_and_clear_bit(BC_FLG_LL_CONN, &bcs->Flag)) {
@@ -1748,7 +1748,7 @@ isar_auxcmd(struct IsdnCardState *cs, isdn_ctrl *ic) {
1748 struct BCState *bcs; 1748 struct BCState *bcs;
1749 1749
1750 if (cs->debug & L1_DEB_HSCX) 1750 if (cs->debug & L1_DEB_HSCX)
1751 debugl1(cs, "isar_auxcmd cmd/ch %x/%d", ic->command, ic->arg); 1751 debugl1(cs, "isar_auxcmd cmd/ch %x/%ld", ic->command, ic->arg);
1752 switch (ic->command) { 1752 switch (ic->command) {
1753 case (ISDN_CMD_FAXCMD): 1753 case (ISDN_CMD_FAXCMD):
1754 bcs = cs->channel[ic->arg].bcs; 1754 bcs = cs->channel[ic->arg].bcs;
diff --git a/drivers/isdn/hisax/isdnl1.h b/drivers/isdn/hisax/isdnl1.h
index 172ad4c8c961..425d86116f2b 100644
--- a/drivers/isdn/hisax/isdnl1.h
+++ b/drivers/isdn/hisax/isdnl1.h
@@ -21,6 +21,7 @@
21#define B_XMTBUFREADY 1 21#define B_XMTBUFREADY 1
22#define B_ACKPENDING 2 22#define B_ACKPENDING 2
23 23
24__attribute__((format(printf, 2, 3)))
24void debugl1(struct IsdnCardState *cs, char *fmt, ...); 25void debugl1(struct IsdnCardState *cs, char *fmt, ...);
25void DChannel_proc_xmt(struct IsdnCardState *cs); 26void DChannel_proc_xmt(struct IsdnCardState *cs);
26void DChannel_proc_rcv(struct IsdnCardState *cs); 27void DChannel_proc_rcv(struct IsdnCardState *cs);
diff --git a/drivers/isdn/hisax/isdnl3.c b/drivers/isdn/hisax/isdnl3.c
index fd0b643ab740..ad291f21b201 100644
--- a/drivers/isdn/hisax/isdnl3.c
+++ b/drivers/isdn/hisax/isdnl3.c
@@ -66,7 +66,7 @@ static char *strL3Event[] =
66 "EV_TIMEOUT", 66 "EV_TIMEOUT",
67}; 67};
68 68
69static void 69static __attribute__((format(printf, 2, 3))) void
70l3m_debug(struct FsmInst *fi, char *fmt, ...) 70l3m_debug(struct FsmInst *fi, char *fmt, ...)
71{ 71{
72 va_list args; 72 va_list args;
diff --git a/drivers/isdn/hisax/netjet.c b/drivers/isdn/hisax/netjet.c
index 5d7f0f2ff9b9..644891efc26f 100644
--- a/drivers/isdn/hisax/netjet.c
+++ b/drivers/isdn/hisax/netjet.c
@@ -254,7 +254,7 @@ static int make_raw_data(struct BCState *bcs) {
254 val >>= 1; 254 val >>= 1;
255 } 255 }
256 if (bcs->cs->debug & L1_DEB_HSCX) 256 if (bcs->cs->debug & L1_DEB_HSCX)
257 debugl1(bcs->cs,"tiger make_raw: in %ld out %d.%d", 257 debugl1(bcs->cs,"tiger make_raw: in %u out %d.%d",
258 bcs->tx_skb->len, s_cnt, bitcnt); 258 bcs->tx_skb->len, s_cnt, bitcnt);
259 if (bitcnt) { 259 if (bitcnt) {
260 while (8>bitcnt++) { 260 while (8>bitcnt++) {
@@ -361,7 +361,7 @@ static int make_raw_data_56k(struct BCState *bcs) {
361 val >>= 1; 361 val >>= 1;
362 } 362 }
363 if (bcs->cs->debug & L1_DEB_HSCX) 363 if (bcs->cs->debug & L1_DEB_HSCX)
364 debugl1(bcs->cs,"tiger make_raw_56k: in %ld out %d.%d", 364 debugl1(bcs->cs,"tiger make_raw_56k: in %u out %d.%d",
365 bcs->tx_skb->len, s_cnt, bitcnt); 365 bcs->tx_skb->len, s_cnt, bitcnt);
366 if (bitcnt) { 366 if (bitcnt) {
367 while (8>bitcnt++) { 367 while (8>bitcnt++) {
@@ -612,7 +612,7 @@ void netjet_fill_dma(struct BCState *bcs)
612 if (!bcs->tx_skb) 612 if (!bcs->tx_skb)
613 return; 613 return;
614 if (bcs->cs->debug & L1_DEB_HSCX) 614 if (bcs->cs->debug & L1_DEB_HSCX)
615 debugl1(bcs->cs,"tiger fill_dma1: c%d %4x", bcs->channel, 615 debugl1(bcs->cs,"tiger fill_dma1: c%d %4lx", bcs->channel,
616 bcs->Flag); 616 bcs->Flag);
617 if (test_and_set_bit(BC_FLG_BUSY, &bcs->Flag)) 617 if (test_and_set_bit(BC_FLG_BUSY, &bcs->Flag))
618 return; 618 return;
@@ -625,7 +625,7 @@ void netjet_fill_dma(struct BCState *bcs)
625 return; 625 return;
626 }; 626 };
627 if (bcs->cs->debug & L1_DEB_HSCX) 627 if (bcs->cs->debug & L1_DEB_HSCX)
628 debugl1(bcs->cs,"tiger fill_dma2: c%d %4x", bcs->channel, 628 debugl1(bcs->cs,"tiger fill_dma2: c%d %4lx", bcs->channel,
629 bcs->Flag); 629 bcs->Flag);
630 if (test_and_clear_bit(BC_FLG_NOFRAME, &bcs->Flag)) { 630 if (test_and_clear_bit(BC_FLG_NOFRAME, &bcs->Flag)) {
631 write_raw(bcs, bcs->hw.tiger.sendp, bcs->hw.tiger.free); 631 write_raw(bcs, bcs->hw.tiger.sendp, bcs->hw.tiger.free);
@@ -667,7 +667,7 @@ void netjet_fill_dma(struct BCState *bcs)
667 write_raw(bcs, p, cnt); 667 write_raw(bcs, p, cnt);
668 } 668 }
669 if (bcs->cs->debug & L1_DEB_HSCX) 669 if (bcs->cs->debug & L1_DEB_HSCX)
670 debugl1(bcs->cs,"tiger fill_dma3: c%d %4x", bcs->channel, 670 debugl1(bcs->cs,"tiger fill_dma3: c%d %4lx", bcs->channel,
671 bcs->Flag); 671 bcs->Flag);
672} 672}
673 673
diff --git a/drivers/isdn/hisax/st5481_d.c b/drivers/isdn/hisax/st5481_d.c
index b7876b19fe73..44082637a09f 100644
--- a/drivers/isdn/hisax/st5481_d.c
+++ b/drivers/isdn/hisax/st5481_d.c
@@ -167,7 +167,8 @@ static struct FsmNode L1FnList[] __initdata =
167 {ST_L1_F8, EV_IND_RSY, l1_ignore}, 167 {ST_L1_F8, EV_IND_RSY, l1_ignore},
168}; 168};
169 169
170static void l1m_debug(struct FsmInst *fi, char *fmt, ...) 170static __attribute__((format(printf, 2, 3)))
171void l1m_debug(struct FsmInst *fi, char *fmt, ...)
171{ 172{
172 va_list args; 173 va_list args;
173 char buf[256]; 174 char buf[256];
@@ -269,7 +270,8 @@ static char *strDoutEvent[] =
269 "EV_DOUT_UNDERRUN", 270 "EV_DOUT_UNDERRUN",
270}; 271};
271 272
272static void dout_debug(struct FsmInst *fi, char *fmt, ...) 273static __attribute__((format(printf, 2, 3)))
274void dout_debug(struct FsmInst *fi, char *fmt, ...)
273{ 275{
274 va_list args; 276 va_list args;
275 char buf[256]; 277 char buf[256];