Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Joe Perches and committed by
David S. Miller
020f01eb 3654654f

+33 -12
+7 -3
drivers/isdn/mISDN/layer1.c
··· 99 99 l1m_debug(struct FsmInst *fi, char *fmt, ...) 100 100 { 101 101 struct layer1 *l1 = fi->userdata; 102 + struct va_format vaf; 102 103 va_list va; 103 104 104 105 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 + 108 112 va_end(va); 109 113 } 110 114
+9 -3
drivers/isdn/mISDN/layer2.c
··· 95 95 l2m_debug(struct FsmInst *fi, char *fmt, ...) 96 96 { 97 97 struct layer2 *l2 = fi->userdata; 98 + struct va_format vaf; 98 99 va_list va; 99 100 100 101 if (!(*debug & DEBUG_L2_FSM)) 101 102 return; 103 + 102 104 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 + 106 112 va_end(va); 107 113 } 108 114
+17 -6
drivers/isdn/mISDN/tei.c
··· 79 79 da_debug(struct FsmInst *fi, char *fmt, ...) 80 80 { 81 81 struct manager *mgr = fi->userdata; 82 + struct va_format vaf; 82 83 va_list va; 83 84 84 85 if (!(*debug & DEBUG_L2_TEIFSM)) 85 86 return; 87 + 86 88 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 + 90 95 va_end(va); 91 96 } 92 97 ··· 228 223 tei_debug(struct FsmInst *fi, char *fmt, ...) 229 224 { 230 225 struct teimgr *tm = fi->userdata; 226 + struct va_format vaf; 231 227 va_list va; 232 228 233 229 if (!(*debug & DEBUG_L2_TEIFSM)) 234 230 return; 231 + 235 232 va_start(va, fmt); 236 - printk(KERN_DEBUG "sapi(%d) tei(%d): ", tm->l2->sapi, tm->l2->tei); 237 - vprintk(fmt, va); 238 - printk("\n"); 233 + 234 + vaf.fmt = fmt; 235 + vaf.va = &va; 236 + 237 + printk(KERN_DEBUG "sapi(%d) tei(%d): %pV\n", 238 + tm->l2->sapi, tm->l2->tei, &vaf); 239 + 239 240 va_end(va); 240 241 } 241 242