]> git.karo-electronics.de Git - linux-beck.git/commitdiff
drivers/isdn/hisax: Add printf format/argument verification and fix fallout
authorJoe Perches <joe@perches.com>
Wed, 10 Nov 2010 18:54:58 +0000 (18:54 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 17 Nov 2010 18:58:22 +0000 (10:58 -0800)
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>
13 files changed:
drivers/isdn/hisax/avm_pci.c
drivers/isdn/hisax/callc.c
drivers/isdn/hisax/hfc_2bds0.c
drivers/isdn/hisax/hfc_2bs0.c
drivers/isdn/hisax/hfc_pci.c
drivers/isdn/hisax/hfc_sx.c
drivers/isdn/hisax/hisax.h
drivers/isdn/hisax/ipacx.c
drivers/isdn/hisax/isar.c
drivers/isdn/hisax/isdnl1.h
drivers/isdn/hisax/isdnl3.c
drivers/isdn/hisax/netjet.c
drivers/isdn/hisax/st5481_d.c

index fcf4ed1cb4b9f2c44eef2bc1591faaf8b4343d9b..0e66af1decd43266129c4fc350ea0dbddeee111f 100644 (file)
@@ -314,7 +314,7 @@ hdlc_fill_fifo(struct BCState *bcs)
                        bcs->hw.hdlc.ctrl.sr.cmd |= HDLC_CMD_XME;
        }
        if ((cs->debug & L1_DEB_HSCX) && !(cs->debug & L1_DEB_HSCX_FIFO))
-               debugl1(cs, "hdlc_fill_fifo %d/%ld", count, bcs->tx_skb->len);
+               debugl1(cs, "hdlc_fill_fifo %d/%u", count, bcs->tx_skb->len);
        p = bcs->tx_skb->data;
        ptr = (u_int *)p;
        skb_pull(bcs->tx_skb, count);
index f150330b5a23e24adb74af94535c83bbbeea7c36..37e685eafd24a015ba5a61c62193bbceb82eb054 100644 (file)
@@ -65,7 +65,7 @@ hisax_findcard(int driverid)
        return (struct IsdnCardState *) 0;
 }
 
-static void
+static __attribute__((format(printf, 3, 4))) void
 link_debug(struct Channel *chanp, int direction, char *fmt, ...)
 {
        va_list args;
@@ -1068,7 +1068,7 @@ init_d_st(struct Channel *chanp)
        return 0;
 }
 
-static void
+static __attribute__((format(printf, 2, 3))) void
 callc_debug(struct FsmInst *fi, char *fmt, ...)
 {
        va_list args;
index 7250f56a5246f4daad7d8573f3d1f59b5ee95d21..a16459a1332ceab1be36f77b3eade4ee2c36b885 100644 (file)
@@ -292,7 +292,7 @@ hfc_fill_fifo(struct BCState *bcs)
        }
        count = GetFreeFifoBytes_B(bcs);
        if (cs->debug & L1_DEB_HSCX)
-               debugl1(cs, "hfc_fill_fifo %d count(%ld/%d),%lx",
+               debugl1(cs, "hfc_fill_fifo %d count(%u/%d),%lx",
                        bcs->channel, bcs->tx_skb->len,
                        count, current->state);
        if (count < bcs->tx_skb->len) {
@@ -719,7 +719,7 @@ hfc_fill_dfifo(struct IsdnCardState *cs)
        }
        count = GetFreeFifoBytes_D(cs);
        if (cs->debug & L1_DEB_ISAC)
-               debugl1(cs, "hfc_fill_Dfifo count(%ld/%d)",
+               debugl1(cs, "hfc_fill_Dfifo count(%u/%d)",
                        cs->tx_skb->len, count);
        if (count < cs->tx_skb->len) {
                if (cs->debug & L1_DEB_ISAC)
index b1f6481e119371b51ce43516fb25cefd7b852502..626f85df302b395964393e4b904c6d22bd5c2c10 100644 (file)
@@ -282,7 +282,7 @@ hfc_fill_fifo(struct BCState *bcs)
            count += cs->hw.hfc.fifosize; 
        } /* L1_MODE_TRANS */
        if (cs->debug & L1_DEB_HSCX)
-               debugl1(cs, "hfc_fill_fifo %d count(%ld/%d)",
+               debugl1(cs, "hfc_fill_fifo %d count(%u/%d)",
                        bcs->channel, bcs->tx_skb->len,
                        count);
        if (count < bcs->tx_skb->len) {
index 917cc84065bd0a318875240cc2e3b8290a6c6758..3147020d188be82f8e03d4dccc7d4c762e2a372c 100644 (file)
@@ -550,7 +550,7 @@ hfcpci_fill_dfifo(struct IsdnCardState *cs)
                count += D_FIFO_SIZE;   /* count now contains available bytes */
 
        if (cs->debug & L1_DEB_ISAC)
-               debugl1(cs, "hfcpci_fill_Dfifo count(%ld/%d)",
+               debugl1(cs, "hfcpci_fill_Dfifo count(%u/%d)",
                        cs->tx_skb->len, count);
        if (count < cs->tx_skb->len) {
                if (cs->debug & L1_DEB_ISAC)
@@ -681,7 +681,7 @@ hfcpci_fill_fifo(struct BCState *bcs)
                count += B_FIFO_SIZE;   /* count now contains available bytes */
 
        if (cs->debug & L1_DEB_HSCX)
-               debugl1(cs, "hfcpci_fill_fifo %d count(%ld/%d),%lx",
+               debugl1(cs, "hfcpci_fill_fifo %d count(%u/%d),%lx",
                        bcs->channel, bcs->tx_skb->len,
                        count, current->state);
 
index 5aa138eb0b3c6a3cd45abfc2b3fb024f4b56d27a..1235b7131ae16e8f886eb5ddddd5aef8417bf2b9 100644 (file)
@@ -179,7 +179,7 @@ write_fifo(struct IsdnCardState *cs, struct sk_buff *skb, u_char fifo, int trans
          count += fifo_size;   /* count now contains available bytes */
 
        if (cs->debug & L1_DEB_ISAC_FIFO)
-         debugl1(cs, "hfcsx_write_fifo %d count(%ld/%d)",
+         debugl1(cs, "hfcsx_write_fifo %d count(%u/%d)",
                  fifo, skb->len, count);
        if (count < skb->len) {
          if (cs->debug & L1_DEB_ISAC_FIFO)
@@ -265,7 +265,7 @@ read_fifo(struct IsdnCardState *cs, u_char fifo, int trans_max)
          count++;
 
          if (cs->debug & L1_DEB_ISAC_FIFO)
-           debugl1(cs, "hfcsx_read_fifo %d count %ld)",
+           debugl1(cs, "hfcsx_read_fifo %d count %u)",
                    fifo, count);
 
          if ((count > fifo_size) || (count < 4)) {
@@ -986,7 +986,7 @@ HFCSX_l1hw(struct PStack *st, int pr, void *arg)
                                default:
                                        spin_unlock_irqrestore(&cs->lock, flags);
                                        if (cs->debug & L1_DEB_WARN)
-                                               debugl1(cs, "hfcsx_l1hw loop invalid %4lx", arg);
+                                               debugl1(cs, "hfcsx_l1hw loop invalid %4lx", (unsigned long)arg);
                                        return;
                        }
                        cs->hw.hfcsx.trm |= 0x80;       /* enable IOM-loop */
index 32ab3924aa7341f5f390623faee36d9a308abc67..de1c669c7b1302a31c72a23c05d037f96c650764 100644 (file)
@@ -1286,7 +1286,9 @@ int jiftime(char *s, long mark);
 
 int HiSax_command(isdn_ctrl * ic);
 int HiSax_writebuf_skb(int id, int chan, int ack, struct sk_buff *skb);
+__attribute__((format(printf, 3, 4)))
 void HiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, ...);
+__attribute__((format(printf, 3, 0)))
 void VHiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, va_list args);
 void HiSax_reportcard(int cardnr, int sel);
 int QuickHex(char *txt, u_char * p, int cnt);
index 751b25f2ff5811f7be494ae6457f1d73ac3b47c1..332104103e18c5ff653a0ffee72e5a0d6063025d 100644 (file)
@@ -717,7 +717,7 @@ bch_mode(struct BCState *bcs, int mode, int bc)
 
         bc = bc ? 1 : 0;  // in case bc is greater than 1
        if (cs->debug & L1_DEB_HSCX)
-               debugl1(cs, "mode_bch() switch B-% mode %d chan %d", hscx, mode, bc);
+               debugl1(cs, "mode_bch() switch B-%d mode %d chan %d", hscx, mode, bc);
        bcs->mode = mode;
        bcs->channel = bc;
   
index 2e72227bd071b9d18329e60a0e4b06a444700ec9..1be4552d94b4b81188ae86dff4163ef1c6d6e83b 100644 (file)
@@ -953,7 +953,7 @@ isar_pump_statev_modem(struct BCState *bcs, u_char devt) {
                        break;
                case PSEV_GSTN_CLR:
                        if (cs->debug & L1_DEB_HSCX)
-                               debugl1(cs, "pump stev GSTN CLEAR", devt);
+                               debugl1(cs, "pump stev GSTN CLEAR");
                        break;
                default:
                        if (cs->debug & L1_DEB_HSCX)
@@ -1268,7 +1268,7 @@ isar_int_main(struct IsdnCardState *cs)
 static void
 ftimer_handler(struct BCState *bcs) {
        if (bcs->cs->debug)
-               debugl1(bcs->cs, "ftimer flags %04x",
+               debugl1(bcs->cs, "ftimer flags %04lx",
                        bcs->Flag);
        test_and_clear_bit(BC_FLG_FTI_RUN, &bcs->Flag);
        if (test_and_clear_bit(BC_FLG_LL_CONN, &bcs->Flag)) {
@@ -1748,7 +1748,7 @@ isar_auxcmd(struct IsdnCardState *cs, isdn_ctrl *ic) {
        struct BCState *bcs;
 
        if (cs->debug & L1_DEB_HSCX)
-               debugl1(cs, "isar_auxcmd cmd/ch %x/%d", ic->command, ic->arg);
+               debugl1(cs, "isar_auxcmd cmd/ch %x/%ld", ic->command, ic->arg);
        switch (ic->command) {
                case (ISDN_CMD_FAXCMD):
                        bcs = cs->channel[ic->arg].bcs;
index 172ad4c8c9619dccbbc071e2b3dd65253ce21ce5..425d86116f2bbb40c62200e2c23218f6c0ea015c 100644 (file)
@@ -21,6 +21,7 @@
 #define B_XMTBUFREADY  1
 #define B_ACKPENDING   2
 
+__attribute__((format(printf, 2, 3)))
 void debugl1(struct IsdnCardState *cs, char *fmt, ...);
 void DChannel_proc_xmt(struct IsdnCardState *cs);
 void DChannel_proc_rcv(struct IsdnCardState *cs);
index fd0b643ab7408cfee4b288447ab30587b623796a..ad291f21b201394d5e0340d29e0e51d1feb8d2b1 100644 (file)
@@ -66,7 +66,7 @@ static char *strL3Event[] =
        "EV_TIMEOUT",
 };
 
-static void
+static __attribute__((format(printf, 2, 3))) void
 l3m_debug(struct FsmInst *fi, char *fmt, ...)
 {
        va_list args;
index 5d7f0f2ff9b9c99133272ce5e7e91bc61c9ca785..644891efc26fb52ba994616878c923b787a5f5a1 100644 (file)
@@ -254,7 +254,7 @@ static int make_raw_data(struct BCState *bcs) {
                val >>= 1;
        }
        if (bcs->cs->debug & L1_DEB_HSCX)
-               debugl1(bcs->cs,"tiger make_raw: in %ld out %d.%d",
+               debugl1(bcs->cs,"tiger make_raw: in %u out %d.%d",
                        bcs->tx_skb->len, s_cnt, bitcnt);
        if (bitcnt) {
                while (8>bitcnt++) {
@@ -361,7 +361,7 @@ static int make_raw_data_56k(struct BCState *bcs) {
                val >>= 1;
        }
        if (bcs->cs->debug & L1_DEB_HSCX)
-               debugl1(bcs->cs,"tiger make_raw_56k: in %ld out %d.%d",
+               debugl1(bcs->cs,"tiger make_raw_56k: in %u out %d.%d",
                        bcs->tx_skb->len, s_cnt, bitcnt);
        if (bitcnt) {
                while (8>bitcnt++) {
@@ -612,7 +612,7 @@ void netjet_fill_dma(struct BCState *bcs)
        if (!bcs->tx_skb)
                return;
        if (bcs->cs->debug & L1_DEB_HSCX)
-               debugl1(bcs->cs,"tiger fill_dma1: c%d %4x", bcs->channel,
+               debugl1(bcs->cs,"tiger fill_dma1: c%d %4lx", bcs->channel,
                        bcs->Flag);
        if (test_and_set_bit(BC_FLG_BUSY, &bcs->Flag))
                return;
@@ -625,7 +625,7 @@ void netjet_fill_dma(struct BCState *bcs)
                        return;         
        };
        if (bcs->cs->debug & L1_DEB_HSCX)
-               debugl1(bcs->cs,"tiger fill_dma2: c%d %4x", bcs->channel,
+               debugl1(bcs->cs,"tiger fill_dma2: c%d %4lx", bcs->channel,
                        bcs->Flag);
        if (test_and_clear_bit(BC_FLG_NOFRAME, &bcs->Flag)) {
                write_raw(bcs, bcs->hw.tiger.sendp, bcs->hw.tiger.free);
@@ -667,7 +667,7 @@ void netjet_fill_dma(struct BCState *bcs)
                write_raw(bcs, p, cnt);
        }
        if (bcs->cs->debug & L1_DEB_HSCX)
-               debugl1(bcs->cs,"tiger fill_dma3: c%d %4x", bcs->channel,
+               debugl1(bcs->cs,"tiger fill_dma3: c%d %4lx", bcs->channel,
                        bcs->Flag);
 }
 
index b7876b19fe7348ad03ab04d3740cf610845705c5..44082637a09fbcfe71701dc69c07fdbcca9c54c4 100644 (file)
@@ -167,7 +167,8 @@ static struct FsmNode L1FnList[] __initdata =
        {ST_L1_F8, EV_IND_RSY,           l1_ignore},
 };
 
-static void l1m_debug(struct FsmInst *fi, char *fmt, ...)
+static __attribute__((format(printf, 2, 3)))
+void l1m_debug(struct FsmInst *fi, char *fmt, ...)
 {
        va_list args;
        char buf[256];
@@ -269,7 +270,8 @@ static char *strDoutEvent[] =
        "EV_DOUT_UNDERRUN",
 };
 
-static void dout_debug(struct FsmInst *fi, char *fmt, ...)
+static __attribute__((format(printf, 2, 3)))
+void dout_debug(struct FsmInst *fi, char *fmt, ...)
 {
        va_list args;
        char buf[256];