Skip to content

Commit 020f01e

Browse files
JoePerchesdavem330
authored andcommitted
drivers/isdn/mISDN: Use printf extension %pV
Using %pV reduces the number of printk calls and eliminates any possible message interleaving from other printk calls. Signed-off-by: Joe Perches <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 3654654 commit 020f01e

File tree

3 files changed

+33
-12
lines changed

3 files changed

+33
-12
lines changed

drivers/isdn/mISDN/layer1.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,16 @@ static void
9999
l1m_debug(struct FsmInst *fi, char *fmt, ...)
100100
{
101101
struct layer1 *l1 = fi->userdata;
102+
struct va_format vaf;
102103
va_list va;
103104

104105
va_start(va, fmt);
105-
printk(KERN_DEBUG "%s: ", dev_name(&l1->dch->dev.dev));
106-
vprintk(fmt, va);
107-
printk("\n");
106+
107+
vaf.fmt = fmt;
108+
vaf.va = &va;
109+
110+
printk(KERN_DEBUG "%s: %pV\n", dev_name(&l1->dch->dev.dev), &vaf);
111+
108112
va_end(va);
109113
}
110114

drivers/isdn/mISDN/layer2.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,20 @@ static void
9595
l2m_debug(struct FsmInst *fi, char *fmt, ...)
9696
{
9797
struct layer2 *l2 = fi->userdata;
98+
struct va_format vaf;
9899
va_list va;
99100

100101
if (!(*debug & DEBUG_L2_FSM))
101102
return;
103+
102104
va_start(va, fmt);
103-
printk(KERN_DEBUG "l2 (sapi %d tei %d): ", l2->sapi, l2->tei);
104-
vprintk(fmt, va);
105-
printk("\n");
105+
106+
vaf.fmt = fmt;
107+
vaf.va = &va;
108+
109+
printk(KERN_DEBUG "l2 (sapi %d tei %d): %pV\n",
110+
l2->sapi, l2->tei, &vaf);
111+
106112
va_end(va);
107113
}
108114

drivers/isdn/mISDN/tei.c

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,19 @@ static void
7979
da_debug(struct FsmInst *fi, char *fmt, ...)
8080
{
8181
struct manager *mgr = fi->userdata;
82+
struct va_format vaf;
8283
va_list va;
8384

8485
if (!(*debug & DEBUG_L2_TEIFSM))
8586
return;
87+
8688
va_start(va, fmt);
87-
printk(KERN_DEBUG "mgr(%d): ", mgr->ch.st->dev->id);
88-
vprintk(fmt, va);
89-
printk("\n");
89+
90+
vaf.fmt = fmt;
91+
vaf.va = &va;
92+
93+
printk(KERN_DEBUG "mgr(%d): %pV\n", mgr->ch.st->dev->id, &vaf);
94+
9095
va_end(va);
9196
}
9297

@@ -223,14 +228,20 @@ static void
223228
tei_debug(struct FsmInst *fi, char *fmt, ...)
224229
{
225230
struct teimgr *tm = fi->userdata;
231+
struct va_format vaf;
226232
va_list va;
227233

228234
if (!(*debug & DEBUG_L2_TEIFSM))
229235
return;
236+
230237
va_start(va, fmt);
231-
printk(KERN_DEBUG "sapi(%d) tei(%d): ", tm->l2->sapi, tm->l2->tei);
232-
vprintk(fmt, va);
233-
printk("\n");
238+
239+
vaf.fmt = fmt;
240+
vaf.va = &va;
241+
242+
printk(KERN_DEBUG "sapi(%d) tei(%d): %pV\n",
243+
tm->l2->sapi, tm->l2->tei, &vaf);
244+
234245
va_end(va);
235246
}
236247

0 commit comments

Comments
 (0)