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);
 
        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;
        return 0;
 }
 
-static void
+static __attribute__((format(printf, 2, 3))) void
 callc_debug(struct FsmInst *fi, char *fmt, ...)
 {
        va_list args;
 
        }
        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) {
        }
        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)
 
            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) {
 
                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)
                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);
 
 
          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)
          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)) {
                                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 */
 
 
 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);
 
 
         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;
   
 
                        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)
 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)) {
        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;
 
 #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);
 
        "EV_TIMEOUT",
 };
 
-static void
+static __attribute__((format(printf, 2, 3))) void
 l3m_debug(struct FsmInst *fi, char *fmt, ...)
 {
        va_list args;
 
                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++) {
                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++) {
        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;
                        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);
                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);
 }
 
 
        {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];
        "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];