Commit 35a4a573 authored by Kees Cook's avatar Kees Cook Committed by David S. Miller

isdn: clean up debug format string usage

Avoid unneeded local string buffers for constructing debug output.  Also
cleans up debug calls that contain a single parameter so that they cannot
be accidentally parsed as format strings.
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Cc: Karsten Keil <isdn@linux-pingi.de>
Cc: David Miller <davem@davemloft.net>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a2a69f0b
...@@ -314,7 +314,7 @@ Amd7930_empty_Dfifo(struct IsdnCardState *cs, int flag) ...@@ -314,7 +314,7 @@ Amd7930_empty_Dfifo(struct IsdnCardState *cs, int flag)
t += sprintf(t, "Amd7930: empty_Dfifo cnt: %d |", cs->rcvidx); t += sprintf(t, "Amd7930: empty_Dfifo cnt: %d |", cs->rcvidx);
QuickHex(t, cs->rcvbuf, cs->rcvidx); QuickHex(t, cs->rcvbuf, cs->rcvidx);
debugl1(cs, cs->dlog); debugl1(cs, "%s", cs->dlog);
} }
/* moves received data in sk-buffer */ /* moves received data in sk-buffer */
memcpy(skb_put(skb, cs->rcvidx), cs->rcvbuf, cs->rcvidx); memcpy(skb_put(skb, cs->rcvidx), cs->rcvbuf, cs->rcvidx);
...@@ -406,7 +406,7 @@ Amd7930_fill_Dfifo(struct IsdnCardState *cs) ...@@ -406,7 +406,7 @@ Amd7930_fill_Dfifo(struct IsdnCardState *cs)
t += sprintf(t, "Amd7930: fill_Dfifo cnt: %d |", count); t += sprintf(t, "Amd7930: fill_Dfifo cnt: %d |", count);
QuickHex(t, deb_ptr, count); QuickHex(t, deb_ptr, count);
debugl1(cs, cs->dlog); debugl1(cs, "%s", cs->dlog);
} }
/* AMD interrupts on */ /* AMD interrupts on */
AmdIrqOn(cs); AmdIrqOn(cs);
......
...@@ -285,7 +285,7 @@ hdlc_empty_fifo(struct BCState *bcs, int count) ...@@ -285,7 +285,7 @@ hdlc_empty_fifo(struct BCState *bcs, int count)
t += sprintf(t, "hdlc_empty_fifo %c cnt %d", t += sprintf(t, "hdlc_empty_fifo %c cnt %d",
bcs->channel ? 'B' : 'A', count); bcs->channel ? 'B' : 'A', count);
QuickHex(t, p, count); QuickHex(t, p, count);
debugl1(cs, bcs->blog); debugl1(cs, "%s", bcs->blog);
} }
} }
...@@ -345,7 +345,7 @@ hdlc_fill_fifo(struct BCState *bcs) ...@@ -345,7 +345,7 @@ hdlc_fill_fifo(struct BCState *bcs)
t += sprintf(t, "hdlc_fill_fifo %c cnt %d", t += sprintf(t, "hdlc_fill_fifo %c cnt %d",
bcs->channel ? 'B' : 'A', count); bcs->channel ? 'B' : 'A', count);
QuickHex(t, p, count); QuickHex(t, p, count);
debugl1(cs, bcs->blog); debugl1(cs, "%s", bcs->blog);
} }
} }
......
...@@ -1896,7 +1896,7 @@ static void EChannel_proc_rcv(struct hisax_d_if *d_if) ...@@ -1896,7 +1896,7 @@ static void EChannel_proc_rcv(struct hisax_d_if *d_if)
ptr--; ptr--;
*ptr++ = '\n'; *ptr++ = '\n';
*ptr = 0; *ptr = 0;
HiSax_putstatus(cs, NULL, cs->dlog); HiSax_putstatus(cs, NULL, "%s", cs->dlog);
} else } else
HiSax_putstatus(cs, "LogEcho: ", HiSax_putstatus(cs, "LogEcho: ",
"warning Frame too big (%d)", "warning Frame too big (%d)",
......
...@@ -427,7 +427,7 @@ Memhscx_empty_fifo(struct BCState *bcs, int count) ...@@ -427,7 +427,7 @@ Memhscx_empty_fifo(struct BCState *bcs, int count)
t += sprintf(t, "hscx_empty_fifo %c cnt %d", t += sprintf(t, "hscx_empty_fifo %c cnt %d",
bcs->hw.hscx.hscx ? 'B' : 'A', count); bcs->hw.hscx.hscx ? 'B' : 'A', count);
QuickHex(t, ptr, count); QuickHex(t, ptr, count);
debugl1(cs, bcs->blog); debugl1(cs, "%s", bcs->blog);
} }
} }
...@@ -469,7 +469,7 @@ Memhscx_fill_fifo(struct BCState *bcs) ...@@ -469,7 +469,7 @@ Memhscx_fill_fifo(struct BCState *bcs)
t += sprintf(t, "hscx_fill_fifo %c cnt %d", t += sprintf(t, "hscx_fill_fifo %c cnt %d",
bcs->hw.hscx.hscx ? 'B' : 'A', count); bcs->hw.hscx.hscx ? 'B' : 'A', count);
QuickHex(t, ptr, count); QuickHex(t, ptr, count);
debugl1(cs, bcs->blog); debugl1(cs, "%s", bcs->blog);
} }
} }
......
...@@ -535,7 +535,7 @@ check_arcofi(struct IsdnCardState *cs) ...@@ -535,7 +535,7 @@ check_arcofi(struct IsdnCardState *cs)
t = tmp; t = tmp;
t += sprintf(tmp, "Arcofi data"); t += sprintf(tmp, "Arcofi data");
QuickHex(t, p, cs->dc.isac.mon_rxp); QuickHex(t, p, cs->dc.isac.mon_rxp);
debugl1(cs, tmp); debugl1(cs, "%s", tmp);
if ((cs->dc.isac.mon_rxp == 2) && (cs->dc.isac.mon_rx[0] == 0xa0)) { if ((cs->dc.isac.mon_rxp == 2) && (cs->dc.isac.mon_rx[0] == 0xa0)) {
switch (cs->dc.isac.mon_rx[1]) { switch (cs->dc.isac.mon_rx[1]) {
case 0x80: case 0x80:
......
...@@ -344,7 +344,7 @@ static inline void receive_chars(struct IsdnCardState *cs, ...@@ -344,7 +344,7 @@ static inline void receive_chars(struct IsdnCardState *cs,
t += sprintf(t, "modem read cnt %d", cs->hw.elsa.rcvcnt); t += sprintf(t, "modem read cnt %d", cs->hw.elsa.rcvcnt);
QuickHex(t, cs->hw.elsa.rcvbuf, cs->hw.elsa.rcvcnt); QuickHex(t, cs->hw.elsa.rcvbuf, cs->hw.elsa.rcvcnt);
debugl1(cs, tmp); debugl1(cs, "%s", tmp);
} }
cs->hw.elsa.rcvcnt = 0; cs->hw.elsa.rcvcnt = 0;
} }
......
...@@ -901,7 +901,7 @@ receive_emsg(struct IsdnCardState *cs) ...@@ -901,7 +901,7 @@ receive_emsg(struct IsdnCardState *cs)
ptr--; ptr--;
*ptr++ = '\n'; *ptr++ = '\n';
*ptr = 0; *ptr = 0;
HiSax_putstatus(cs, NULL, cs->dlog); HiSax_putstatus(cs, NULL, "%s", cs->dlog);
} else } else
HiSax_putstatus(cs, "LogEcho: ", "warning Frame too big (%d)", total - 3); HiSax_putstatus(cs, "LogEcho: ", "warning Frame too big (%d)", total - 3);
} }
......
...@@ -674,7 +674,7 @@ receive_emsg(struct IsdnCardState *cs) ...@@ -674,7 +674,7 @@ receive_emsg(struct IsdnCardState *cs)
ptr--; ptr--;
*ptr++ = '\n'; *ptr++ = '\n';
*ptr = 0; *ptr = 0;
HiSax_putstatus(cs, NULL, cs->dlog); HiSax_putstatus(cs, NULL, "%s", cs->dlog);
} else } else
HiSax_putstatus(cs, "LogEcho: ", "warning Frame too big (%d)", skb->len); HiSax_putstatus(cs, "LogEcho: ", "warning Frame too big (%d)", skb->len);
} }
......
...@@ -75,7 +75,7 @@ hscx_empty_fifo(struct BCState *bcs, int count) ...@@ -75,7 +75,7 @@ hscx_empty_fifo(struct BCState *bcs, int count)
t += sprintf(t, "hscx_empty_fifo %c cnt %d", t += sprintf(t, "hscx_empty_fifo %c cnt %d",
bcs->hw.hscx.hscx ? 'B' : 'A', count); bcs->hw.hscx.hscx ? 'B' : 'A', count);
QuickHex(t, ptr, count); QuickHex(t, ptr, count);
debugl1(cs, bcs->blog); debugl1(cs, "%s", bcs->blog);
} }
} }
...@@ -115,7 +115,7 @@ hscx_fill_fifo(struct BCState *bcs) ...@@ -115,7 +115,7 @@ hscx_fill_fifo(struct BCState *bcs)
t += sprintf(t, "hscx_fill_fifo %c cnt %d", t += sprintf(t, "hscx_fill_fifo %c cnt %d",
bcs->hw.hscx.hscx ? 'B' : 'A', count); bcs->hw.hscx.hscx ? 'B' : 'A', count);
QuickHex(t, ptr, count); QuickHex(t, ptr, count);
debugl1(cs, bcs->blog); debugl1(cs, "%s", bcs->blog);
} }
} }
......
...@@ -134,7 +134,7 @@ icc_empty_fifo(struct IsdnCardState *cs, int count) ...@@ -134,7 +134,7 @@ icc_empty_fifo(struct IsdnCardState *cs, int count)
t += sprintf(t, "icc_empty_fifo cnt %d", count); t += sprintf(t, "icc_empty_fifo cnt %d", count);
QuickHex(t, ptr, count); QuickHex(t, ptr, count);
debugl1(cs, cs->dlog); debugl1(cs, "%s", cs->dlog);
} }
} }
...@@ -176,7 +176,7 @@ icc_fill_fifo(struct IsdnCardState *cs) ...@@ -176,7 +176,7 @@ icc_fill_fifo(struct IsdnCardState *cs)
t += sprintf(t, "icc_fill_fifo cnt %d", count); t += sprintf(t, "icc_fill_fifo cnt %d", count);
QuickHex(t, ptr, count); QuickHex(t, ptr, count);
debugl1(cs, cs->dlog); debugl1(cs, "%s", cs->dlog);
} }
} }
......
...@@ -260,7 +260,7 @@ dch_empty_fifo(struct IsdnCardState *cs, int count) ...@@ -260,7 +260,7 @@ dch_empty_fifo(struct IsdnCardState *cs, int count)
t += sprintf(t, "dch_empty_fifo() cnt %d", count); t += sprintf(t, "dch_empty_fifo() cnt %d", count);
QuickHex(t, ptr, count); QuickHex(t, ptr, count);
debugl1(cs, cs->dlog); debugl1(cs, "%s", cs->dlog);
} }
} }
...@@ -307,7 +307,7 @@ dch_fill_fifo(struct IsdnCardState *cs) ...@@ -307,7 +307,7 @@ dch_fill_fifo(struct IsdnCardState *cs)
t += sprintf(t, "dch_fill_fifo() cnt %d", count); t += sprintf(t, "dch_fill_fifo() cnt %d", count);
QuickHex(t, ptr, count); QuickHex(t, ptr, count);
debugl1(cs, cs->dlog); debugl1(cs, "%s", cs->dlog);
} }
} }
...@@ -539,7 +539,7 @@ bch_empty_fifo(struct BCState *bcs, int count) ...@@ -539,7 +539,7 @@ bch_empty_fifo(struct BCState *bcs, int count)
t += sprintf(t, "bch_empty_fifo() B-%d cnt %d", hscx, count); t += sprintf(t, "bch_empty_fifo() B-%d cnt %d", hscx, count);
QuickHex(t, ptr, count); QuickHex(t, ptr, count);
debugl1(cs, bcs->blog); debugl1(cs, "%s", bcs->blog);
} }
} }
...@@ -582,7 +582,7 @@ bch_fill_fifo(struct BCState *bcs) ...@@ -582,7 +582,7 @@ bch_fill_fifo(struct BCState *bcs)
t += sprintf(t, "chb_fill_fifo() B-%d cnt %d", hscx, count); t += sprintf(t, "chb_fill_fifo() B-%d cnt %d", hscx, count);
QuickHex(t, ptr, count); QuickHex(t, ptr, count);
debugl1(cs, bcs->blog); debugl1(cs, "%s", bcs->blog);
} }
} }
......
...@@ -137,7 +137,7 @@ isac_empty_fifo(struct IsdnCardState *cs, int count) ...@@ -137,7 +137,7 @@ isac_empty_fifo(struct IsdnCardState *cs, int count)
t += sprintf(t, "isac_empty_fifo cnt %d", count); t += sprintf(t, "isac_empty_fifo cnt %d", count);
QuickHex(t, ptr, count); QuickHex(t, ptr, count);
debugl1(cs, cs->dlog); debugl1(cs, "%s", cs->dlog);
} }
} }
...@@ -179,7 +179,7 @@ isac_fill_fifo(struct IsdnCardState *cs) ...@@ -179,7 +179,7 @@ isac_fill_fifo(struct IsdnCardState *cs)
t += sprintf(t, "isac_fill_fifo cnt %d", count); t += sprintf(t, "isac_fill_fifo cnt %d", count);
QuickHex(t, ptr, count); QuickHex(t, ptr, count);
debugl1(cs, cs->dlog); debugl1(cs, "%s", cs->dlog);
} }
} }
......
...@@ -74,7 +74,7 @@ sendmsg(struct IsdnCardState *cs, u_char his, u_char creg, u_char len, ...@@ -74,7 +74,7 @@ sendmsg(struct IsdnCardState *cs, u_char his, u_char creg, u_char len,
t = tmp; t = tmp;
t += sprintf(t, "sendmbox cnt %d", len); t += sprintf(t, "sendmbox cnt %d", len);
QuickHex(t, &msg[len-i], (i > 64) ? 64 : i); QuickHex(t, &msg[len-i], (i > 64) ? 64 : i);
debugl1(cs, tmp); debugl1(cs, "%s", tmp);
i -= 64; i -= 64;
} }
} }
...@@ -105,7 +105,7 @@ rcv_mbox(struct IsdnCardState *cs, struct isar_reg *ireg, u_char *msg) ...@@ -105,7 +105,7 @@ rcv_mbox(struct IsdnCardState *cs, struct isar_reg *ireg, u_char *msg)
t = tmp; t = tmp;
t += sprintf(t, "rcv_mbox cnt %d", ireg->clsb); t += sprintf(t, "rcv_mbox cnt %d", ireg->clsb);
QuickHex(t, &msg[ireg->clsb - i], (i > 64) ? 64 : i); QuickHex(t, &msg[ireg->clsb - i], (i > 64) ? 64 : i);
debugl1(cs, tmp); debugl1(cs, "%s", tmp);
i -= 64; i -= 64;
} }
} }
...@@ -1248,7 +1248,7 @@ isar_int_main(struct IsdnCardState *cs) ...@@ -1248,7 +1248,7 @@ isar_int_main(struct IsdnCardState *cs)
tp += sprintf(debbuf, "msg iis(%x) msb(%x)", tp += sprintf(debbuf, "msg iis(%x) msb(%x)",
ireg->iis, ireg->cmsb); ireg->iis, ireg->cmsb);
QuickHex(tp, (u_char *)ireg->par, ireg->clsb); QuickHex(tp, (u_char *)ireg->par, ireg->clsb);
debugl1(cs, debbuf); debugl1(cs, "%s", debbuf);
} }
break; break;
case ISAR_IIS_INVMSG: case ISAR_IIS_INVMSG:
......
...@@ -81,10 +81,7 @@ modejade(struct BCState *bcs, int mode, int bc) ...@@ -81,10 +81,7 @@ modejade(struct BCState *bcs, int mode, int bc)
int jade = bcs->hw.hscx.hscx; int jade = bcs->hw.hscx.hscx;
if (cs->debug & L1_DEB_HSCX) { if (cs->debug & L1_DEB_HSCX) {
char tmp[40]; debugl1(cs, "jade %c mode %d ichan %d", 'A' + jade, mode, bc);
sprintf(tmp, "jade %c mode %d ichan %d",
'A' + jade, mode, bc);
debugl1(cs, tmp);
} }
bcs->mode = mode; bcs->mode = mode;
bcs->channel = bc; bcs->channel = bc;
...@@ -257,23 +254,18 @@ void ...@@ -257,23 +254,18 @@ void
clear_pending_jade_ints(struct IsdnCardState *cs) clear_pending_jade_ints(struct IsdnCardState *cs)
{ {
int val; int val;
char tmp[64];
cs->BC_Write_Reg(cs, 0, jade_HDLC_IMR, 0x00); cs->BC_Write_Reg(cs, 0, jade_HDLC_IMR, 0x00);
cs->BC_Write_Reg(cs, 1, jade_HDLC_IMR, 0x00); cs->BC_Write_Reg(cs, 1, jade_HDLC_IMR, 0x00);
val = cs->BC_Read_Reg(cs, 1, jade_HDLC_ISR); val = cs->BC_Read_Reg(cs, 1, jade_HDLC_ISR);
sprintf(tmp, "jade B ISTA %x", val); debugl1(cs, "jade B ISTA %x", val);
debugl1(cs, tmp);
val = cs->BC_Read_Reg(cs, 0, jade_HDLC_ISR); val = cs->BC_Read_Reg(cs, 0, jade_HDLC_ISR);
sprintf(tmp, "jade A ISTA %x", val); debugl1(cs, "jade A ISTA %x", val);
debugl1(cs, tmp);
val = cs->BC_Read_Reg(cs, 1, jade_HDLC_STAR); val = cs->BC_Read_Reg(cs, 1, jade_HDLC_STAR);
sprintf(tmp, "jade B STAR %x", val); debugl1(cs, "jade B STAR %x", val);
debugl1(cs, tmp);
val = cs->BC_Read_Reg(cs, 0, jade_HDLC_STAR); val = cs->BC_Read_Reg(cs, 0, jade_HDLC_STAR);
sprintf(tmp, "jade A STAR %x", val); debugl1(cs, "jade A STAR %x", val);
debugl1(cs, tmp);
/* Unmask ints */ /* Unmask ints */
cs->BC_Write_Reg(cs, 0, jade_HDLC_IMR, 0xF8); cs->BC_Write_Reg(cs, 0, jade_HDLC_IMR, 0xF8);
cs->BC_Write_Reg(cs, 1, jade_HDLC_IMR, 0xF8); cs->BC_Write_Reg(cs, 1, jade_HDLC_IMR, 0xF8);
......
...@@ -65,7 +65,7 @@ jade_empty_fifo(struct BCState *bcs, int count) ...@@ -65,7 +65,7 @@ jade_empty_fifo(struct BCState *bcs, int count)
t += sprintf(t, "jade_empty_fifo %c cnt %d", t += sprintf(t, "jade_empty_fifo %c cnt %d",
bcs->hw.hscx.hscx ? 'B' : 'A', count); bcs->hw.hscx.hscx ? 'B' : 'A', count);
QuickHex(t, ptr, count); QuickHex(t, ptr, count);
debugl1(cs, bcs->blog); debugl1(cs, "%s", bcs->blog);
} }
} }
...@@ -105,7 +105,7 @@ jade_fill_fifo(struct BCState *bcs) ...@@ -105,7 +105,7 @@ jade_fill_fifo(struct BCState *bcs)
t += sprintf(t, "jade_fill_fifo %c cnt %d", t += sprintf(t, "jade_fill_fifo %c cnt %d",
bcs->hw.hscx.hscx ? 'B' : 'A', count); bcs->hw.hscx.hscx ? 'B' : 'A', count);
QuickHex(t, ptr, count); QuickHex(t, ptr, count);
debugl1(cs, bcs->blog); debugl1(cs, "%s", bcs->blog);
} }
} }
......
...@@ -63,7 +63,7 @@ l3_1tr6_error(struct l3_process *pc, u_char *msg, struct sk_buff *skb) ...@@ -63,7 +63,7 @@ l3_1tr6_error(struct l3_process *pc, u_char *msg, struct sk_buff *skb)
{ {
dev_kfree_skb(skb); dev_kfree_skb(skb);
if (pc->st->l3.debug & L3_DEB_WARN) if (pc->st->l3.debug & L3_DEB_WARN)
l3_debug(pc->st, msg); l3_debug(pc->st, "%s", msg);
l3_1tr6_release_req(pc, 0, NULL); l3_1tr6_release_req(pc, 0, NULL);
} }
...@@ -161,7 +161,6 @@ l3_1tr6_setup(struct l3_process *pc, u_char pr, void *arg) ...@@ -161,7 +161,6 @@ l3_1tr6_setup(struct l3_process *pc, u_char pr, void *arg)
{ {
u_char *p; u_char *p;
int bcfound = 0; int bcfound = 0;
char tmp[80];
struct sk_buff *skb = arg; struct sk_buff *skb = arg;
/* Channel Identification */ /* Channel Identification */
...@@ -214,10 +213,9 @@ l3_1tr6_setup(struct l3_process *pc, u_char pr, void *arg) ...@@ -214,10 +213,9 @@ l3_1tr6_setup(struct l3_process *pc, u_char pr, void *arg)
/* Signal all services, linklevel takes care of Service-Indicator */ /* Signal all services, linklevel takes care of Service-Indicator */
if (bcfound) { if (bcfound) {
if ((pc->para.setup.si1 != 7) && (pc->st->l3.debug & L3_DEB_WARN)) { if ((pc->para.setup.si1 != 7) && (pc->st->l3.debug & L3_DEB_WARN)) {
sprintf(tmp, "non-digital call: %s -> %s", l3_debug(pc->st, "non-digital call: %s -> %s",
pc->para.setup.phone, pc->para.setup.phone,
pc->para.setup.eazmsn); pc->para.setup.eazmsn);
l3_debug(pc->st, tmp);
} }
newl3state(pc, 6); newl3state(pc, 6);
pc->st->l3.l3l4(pc->st, CC_SETUP | INDICATION, pc); pc->st->l3.l3l4(pc->st, CC_SETUP | INDICATION, pc);
...@@ -301,7 +299,7 @@ l3_1tr6_info(struct l3_process *pc, u_char pr, void *arg) ...@@ -301,7 +299,7 @@ l3_1tr6_info(struct l3_process *pc, u_char pr, void *arg)
{ {
u_char *p; u_char *p;
int i, tmpcharge = 0; int i, tmpcharge = 0;
char a_charge[8], tmp[32]; char a_charge[8];
struct sk_buff *skb = arg; struct sk_buff *skb = arg;
p = skb->data; p = skb->data;
...@@ -316,8 +314,8 @@ l3_1tr6_info(struct l3_process *pc, u_char pr, void *arg) ...@@ -316,8 +314,8 @@ l3_1tr6_info(struct l3_process *pc, u_char pr, void *arg)
pc->st->l3.l3l4(pc->st, CC_CHARGE | INDICATION, pc); pc->st->l3.l3l4(pc->st, CC_CHARGE | INDICATION, pc);
} }
if (pc->st->l3.debug & L3_DEB_CHARGE) { if (pc->st->l3.debug & L3_DEB_CHARGE) {
sprintf(tmp, "charging info %d", pc->para.chargeinfo); l3_debug(pc->st, "charging info %d",
l3_debug(pc->st, tmp); pc->para.chargeinfo);
} }
} else if (pc->st->l3.debug & L3_DEB_CHARGE) } else if (pc->st->l3.debug & L3_DEB_CHARGE)
l3_debug(pc->st, "charging info not found"); l3_debug(pc->st, "charging info not found");
...@@ -399,7 +397,7 @@ l3_1tr6_disc(struct l3_process *pc, u_char pr, void *arg) ...@@ -399,7 +397,7 @@ l3_1tr6_disc(struct l3_process *pc, u_char pr, void *arg)
struct sk_buff *skb = arg; struct sk_buff *skb = arg;
u_char *p; u_char *p;
int i, tmpcharge = 0; int i, tmpcharge = 0;
char a_charge[8], tmp[32]; char a_charge[8];
StopAllL3Timer(pc); StopAllL3Timer(pc);
p = skb->data; p = skb->data;
...@@ -414,8 +412,8 @@ l3_1tr6_disc(struct l3_process *pc, u_char pr, void *arg) ...@@ -414,8 +412,8 @@ l3_1tr6_disc(struct l3_process *pc, u_char pr, void *arg)
pc->st->l3.l3l4(pc->st, CC_CHARGE | INDICATION, pc); pc->st->l3.l3l4(pc->st, CC_CHARGE | INDICATION, pc);
} }
if (pc->st->l3.debug & L3_DEB_CHARGE) { if (pc->st->l3.debug & L3_DEB_CHARGE) {
sprintf(tmp, "charging info %d", pc->para.chargeinfo); l3_debug(pc->st, "charging info %d",
l3_debug(pc->st, tmp); pc->para.chargeinfo);
} }
} else if (pc->st->l3.debug & L3_DEB_CHARGE) } else if (pc->st->l3.debug & L3_DEB_CHARGE)
l3_debug(pc->st, "charging info not found"); l3_debug(pc->st, "charging info not found");
...@@ -746,7 +744,6 @@ up1tr6(struct PStack *st, int pr, void *arg) ...@@ -746,7 +744,6 @@ up1tr6(struct PStack *st, int pr, void *arg)
int i, mt, cr; int i, mt, cr;
struct l3_process *proc; struct l3_process *proc;
struct sk_buff *skb = arg; struct sk_buff *skb = arg;
char tmp[80];
switch (pr) { switch (pr) {
case (DL_DATA | INDICATION): case (DL_DATA | INDICATION):
...@@ -762,26 +759,23 @@ up1tr6(struct PStack *st, int pr, void *arg) ...@@ -762,26 +759,23 @@ up1tr6(struct PStack *st, int pr, void *arg)
} }
if (skb->len < 4) { if (skb->len < 4) {
if (st->l3.debug & L3_DEB_PROTERR) { if (st->l3.debug & L3_DEB_PROTERR) {
sprintf(tmp, "up1tr6 len only %d", skb->len); l3_debug(st, "up1tr6 len only %d", skb->len);
l3_debug(st, tmp);
} }
dev_kfree_skb(skb); dev_kfree_skb(skb);
return; return;
} }
if ((skb->data[0] & 0xfe) != PROTO_DIS_N0) { if ((skb->data[0] & 0xfe) != PROTO_DIS_N0) {
if (st->l3.debug & L3_DEB_PROTERR) { if (st->l3.debug & L3_DEB_PROTERR) {
sprintf(tmp, "up1tr6%sunexpected discriminator %x message len %d", l3_debug(st, "up1tr6%sunexpected discriminator %x message len %d",
(pr == (DL_DATA | INDICATION)) ? " " : "(broadcast) ", (pr == (DL_DATA | INDICATION)) ? " " : "(broadcast) ",
skb->data[0], skb->len); skb->data[0], skb->len);
l3_debug(st, tmp);
} }
dev_kfree_skb(skb); dev_kfree_skb(skb);
return; return;
} }
if (skb->data[1] != 1) { if (skb->data[1] != 1) {
if (st->l3.debug & L3_DEB_PROTERR) { if (st->l3.debug & L3_DEB_PROTERR) {
sprintf(tmp, "up1tr6 CR len not 1"); l3_debug(st, "up1tr6 CR len not 1");
l3_debug(st, tmp);
} }
dev_kfree_skb(skb); dev_kfree_skb(skb);
return; return;
...@@ -791,9 +785,8 @@ up1tr6(struct PStack *st, int pr, void *arg) ...@@ -791,9 +785,8 @@ up1tr6(struct PStack *st, int pr, void *arg)
if (skb->data[0] == PROTO_DIS_N0) { if (skb->data[0] == PROTO_DIS_N0) {
dev_kfree_skb(skb); dev_kfree_skb(skb);
if (st->l3.debug & L3_DEB_STATE) { if (st->l3.debug & L3_DEB_STATE) {
sprintf(tmp, "up1tr6%s N0 mt %x unhandled", l3_debug(st, "up1tr6%s N0 mt %x unhandled",
(pr == (DL_DATA | INDICATION)) ? " " : "(broadcast) ", mt); (pr == (DL_DATA | INDICATION)) ? " " : "(broadcast) ", mt);
l3_debug(st, tmp);
} }
} else if (skb->data[0] == PROTO_DIS_N1) { } else if (skb->data[0] == PROTO_DIS_N1) {
if (!(proc = getl3proc(st, cr))) { if (!(proc = getl3proc(st, cr))) {
...@@ -801,8 +794,7 @@ up1tr6(struct PStack *st, int pr, void *arg) ...@@ -801,8 +794,7 @@ up1tr6(struct PStack *st, int pr, void *arg)
if (cr < 128) { if (cr < 128) {
if (!(proc = new_l3_process(st, cr))) { if (!(proc = new_l3_process(st, cr))) {
if (st->l3.debug & L3_DEB_PROTERR) { if (st->l3.debug & L3_DEB_PROTERR) {
sprintf(tmp, "up1tr6 no roc mem"); l3_debug(st, "up1tr6 no roc mem");
l3_debug(st, tmp);
} }
dev_kfree_skb(skb); dev_kfree_skb(skb);
return; return;
...@@ -821,8 +813,7 @@ up1tr6(struct PStack *st, int pr, void *arg) ...@@ -821,8 +813,7 @@ up1tr6(struct PStack *st, int pr, void *arg)
} else { } else {
if (!(proc = new_l3_process(st, cr))) { if (!(proc = new_l3_process(st, cr))) {
if (st->l3.debug & L3_DEB_PROTERR) { if (st->l3.debug & L3_DEB_PROTERR) {
sprintf(tmp, "up1tr6 no roc mem"); l3_debug(st, "up1tr6 no roc mem");
l3_debug(st, tmp);
} }
dev_kfree_skb(skb); dev_kfree_skb(skb);
return; return;
...@@ -837,18 +828,16 @@ up1tr6(struct PStack *st, int pr, void *arg) ...@@ -837,18 +828,16 @@ up1tr6(struct PStack *st, int pr, void *arg)
if (i == ARRAY_SIZE(datastln1)) { if (i == ARRAY_SIZE(datastln1)) {
dev_kfree_skb(skb); dev_kfree_skb(skb);
if (st->l3.debug & L3_DEB_STATE) { if (st->l3.debug & L3_DEB_STATE) {
sprintf(tmp, "up1tr6%sstate %d mt %x unhandled", l3_debug(st, "up1tr6%sstate %d mt %x unhandled",
(pr == (DL_DATA | INDICATION)) ? " " : "(broadcast) ", (pr == (DL_DATA | INDICATION)) ? " " : "(broadcast) ",
proc->state, mt); proc->state, mt);
l3_debug(st, tmp);
} }
return; return;
} else { } else {
if (st->l3.debug & L3_DEB_STATE) { if (st->l3.debug & L3_DEB_STATE) {
sprintf(tmp, "up1tr6%sstate %d mt %x", l3_debug(st, "up1tr6%sstate %d mt %x",
(pr == (DL_DATA | INDICATION)) ? " " : "(broadcast) ", (pr == (DL_DATA | INDICATION)) ? " " : "(broadcast) ",
proc->state, mt); proc->state, mt);
l3_debug(st, tmp);
} }
datastln1[i].rout(proc, pr, skb); datastln1[i].rout(proc, pr, skb);
} }
...@@ -861,7 +850,6 @@ down1tr6(struct PStack *st, int pr, void *arg) ...@@ -861,7 +850,6 @@ down1tr6(struct PStack *st, int pr, void *arg)
int i, cr; int i, cr;
struct l3_process *proc; struct l3_process *proc;
struct Channel *chan; struct Channel *chan;
char tmp[80];
if ((DL_ESTABLISH | REQUEST) == pr) { if ((DL_ESTABLISH | REQUEST) == pr) {
l3_msg(st, pr, NULL); l3_msg(st, pr, NULL);
...@@ -888,15 +876,13 @@ down1tr6(struct PStack *st, int pr, void *arg) ...@@ -888,15 +876,13 @@ down1tr6(struct PStack *st, int pr, void *arg)
break; break;
if (i == ARRAY_SIZE(downstl)) { if (i == ARRAY_SIZE(downstl)) {
if (st->l3.debug & L3_DEB_STATE) { if (st->l3.debug & L3_DEB_STATE) {
sprintf(tmp, "down1tr6 state %d prim %d unhandled", l3_debug(st, "down1tr6 state %d prim %d unhandled",
proc->state, pr); proc->state, pr);
l3_debug(st, tmp);
} }
} else { } else {
if (st->l3.debug & L3_DEB_STATE) { if (st->l3.debug & L3_DEB_STATE) {
sprintf(tmp, "down1tr6 state %d prim %d", l3_debug(st, "down1tr6 state %d prim %d",
proc->state, pr); proc->state, pr);
l3_debug(st, tmp);
} }
downstl[i].rout(proc, pr, arg); downstl[i].rout(proc, pr, arg);
} }
......
...@@ -176,7 +176,7 @@ static void printframe(struct IsdnCardState *cs, u_char *buf, int count, char *s ...@@ -176,7 +176,7 @@ static void printframe(struct IsdnCardState *cs, u_char *buf, int count, char *s
else else
j = i; j = i;
QuickHex(t, p, j); QuickHex(t, p, j);
debugl1(cs, tmp); debugl1(cs, "%s", tmp);
p += j; p += j;
i -= j; i -= j;
t = tmp; t = tmp;
......
...@@ -1179,7 +1179,7 @@ LogFrame(struct IsdnCardState *cs, u_char *buf, int size) ...@@ -1179,7 +1179,7 @@ LogFrame(struct IsdnCardState *cs, u_char *buf, int size)
dp--; dp--;
*dp++ = '\n'; *dp++ = '\n';
*dp = 0; *dp = 0;
HiSax_putstatus(cs, NULL, cs->dlog); HiSax_putstatus(cs, NULL, "%s", cs->dlog);
} else } else
HiSax_putstatus(cs, "LogFrame: ", "warning Frame too big (%d)", size); HiSax_putstatus(cs, "LogFrame: ", "warning Frame too big (%d)", size);
} }
...@@ -1246,7 +1246,7 @@ dlogframe(struct IsdnCardState *cs, struct sk_buff *skb, int dir) ...@@ -1246,7 +1246,7 @@ dlogframe(struct IsdnCardState *cs, struct sk_buff *skb, int dir)
} }
if (finish) { if (finish) {
*dp = 0; *dp = 0;
HiSax_putstatus(cs, NULL, cs->dlog); HiSax_putstatus(cs, NULL, "%s", cs->dlog);
return; return;
} }
if ((0xfe & buf[0]) == PROTO_DIS_N0) { /* 1TR6 */ if ((0xfe & buf[0]) == PROTO_DIS_N0) { /* 1TR6 */
...@@ -1509,5 +1509,5 @@ dlogframe(struct IsdnCardState *cs, struct sk_buff *skb, int dir) ...@@ -1509,5 +1509,5 @@ dlogframe(struct IsdnCardState *cs, struct sk_buff *skb, int dir)
dp += sprintf(dp, "Unknown protocol %x!", buf[0]); dp += sprintf(dp, "Unknown protocol %x!", buf[0]);
} }
*dp = 0; *dp = 0;
HiSax_putstatus(cs, NULL, cs->dlog); HiSax_putstatus(cs, NULL, "%s", cs->dlog);
} }
...@@ -154,7 +154,7 @@ W6692_empty_fifo(struct IsdnCardState *cs, int count) ...@@ -154,7 +154,7 @@ W6692_empty_fifo(struct IsdnCardState *cs, int count)
t += sprintf(t, "W6692_empty_fifo cnt %d", count); t += sprintf(t, "W6692_empty_fifo cnt %d", count);
QuickHex(t, ptr, count); QuickHex(t, ptr, count);
debugl1(cs, cs->dlog); debugl1(cs, "%s", cs->dlog);
} }
} }
...@@ -196,7 +196,7 @@ W6692_fill_fifo(struct IsdnCardState *cs) ...@@ -196,7 +196,7 @@ W6692_fill_fifo(struct IsdnCardState *cs)
t += sprintf(t, "W6692_fill_fifo cnt %d", count); t += sprintf(t, "W6692_fill_fifo cnt %d", count);
QuickHex(t, ptr, count); QuickHex(t, ptr, count);
debugl1(cs, cs->dlog); debugl1(cs, "%s", cs->dlog);
} }
} }
...@@ -226,7 +226,7 @@ W6692B_empty_fifo(struct BCState *bcs, int count) ...@@ -226,7 +226,7 @@ W6692B_empty_fifo(struct BCState *bcs, int count)
t += sprintf(t, "W6692B_empty_fifo %c cnt %d", t += sprintf(t, "W6692B_empty_fifo %c cnt %d",
bcs->channel + '1', count); bcs->channel + '1', count);
QuickHex(t, ptr, count); QuickHex(t, ptr, count);
debugl1(cs, bcs->blog); debugl1(cs, "%s", bcs->blog);
} }
} }
...@@ -264,7 +264,7 @@ W6692B_fill_fifo(struct BCState *bcs) ...@@ -264,7 +264,7 @@ W6692B_fill_fifo(struct BCState *bcs)
t += sprintf(t, "W6692B_fill_fifo %c cnt %d", t += sprintf(t, "W6692B_fill_fifo %c cnt %d",
bcs->channel + '1', count); bcs->channel + '1', count);
QuickHex(t, ptr, count); QuickHex(t, ptr, count);
debugl1(cs, bcs->blog); debugl1(cs, "%s", bcs->blog);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment