diff options
author | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2008-08-03 18:06:15 +0000 |
---|---|---|
committer | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2008-08-03 18:06:15 +0000 |
commit | bc7451c076f9e6efa19ed362de942e52eaf2bb05 (patch) | |
tree | b59bff5c7fa87604a02566993c0915fd6f04f2f7 /drivers/dahdi/dahdi-base.c | |
parent | 92899e764d125c3259161ad91fa9e6f3d5ae1132 (diff) |
Do use printk-s without a priority when continuing previous printk.
Also remove a small duplication in dahdi-base.c, as I'm too lazy to
fix in two separate places.
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4688 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/dahdi-base.c')
-rw-r--r-- | drivers/dahdi/dahdi-base.c | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c index 1a2966b..0db218d 100644 --- a/drivers/dahdi/dahdi-base.c +++ b/drivers/dahdi/dahdi-base.c @@ -1614,6 +1614,20 @@ static struct dahdi_hdlc *dahdi_hdlc_alloc(void) return kzalloc(sizeof(struct dahdi_hdlc), GFP_KERNEL); } +static inline print_debug_writebuf(struct dahdi_chan* ss, struct sk_buff *skb, + int oldbuf) +{ +#ifdef CONFIG_DAHDI_DEBUG + int x; + + module_printk(KERN_NOTICE, "Buffered %d bytes to go out in buffer %d\n", ss->writen[oldbuf], oldbuf); + module_printk(KERN_DEBUG ""); + for (x=0;x<ss->writen[oldbuf];x++) + printk("%02x ", ss->writebuf[oldbuf][x]); + printk("\n"); +#endif +} + #ifdef NEW_HDLC_INTERFACE static int dahdi_xmit(struct sk_buff *skb, struct net_device *dev) { @@ -1674,12 +1688,7 @@ static int dahdi_xmit(hdlc_device *hdlc, struct sk_buff *skb) dev->trans_start = jiffies; stats->tx_packets++; stats->tx_bytes += ss->writen[oldbuf]; -#ifdef CONFIG_DAHDI_DEBUG - module_printk(KERN_NOTICE, "Buffered %d bytes to go out in buffer %d\n", ss->writen[oldbuf], oldbuf); - for (x=0;x<ss->writen[oldbuf];x++) - module_printk(KERN_DEBUG,"%02x ", ss->writebuf[oldbuf][x]); - module_printk(KERN_DEBUG "\n"); -#endif + print_debug_writebuf(ss, skb, outbug); retval = 0; /* Free the SKB */ dev_kfree_skb_any(skb); @@ -1775,12 +1784,7 @@ static int dahdi_ppp_xmit(struct ppp_channel *ppp, struct sk_buff *skb) some space for us */ ss->outwritebuf = oldbuf; } -#ifdef CONFIG_DAHDI_DEBUG - module_printk(KERN_NOTICE, "Buffered %d bytes (skblen = %d) to go out in buffer %d\n", ss->writen[oldbuf], skb->len, oldbuf); - for (x=0;x<ss->writen[oldbuf];x++) - module_printk(KERN_DEBUG, "%02x ", ss->writebuf[oldbuf][x]); - module_printk(KERN_DEBUG, "\n"); -#endif + print_debug_writebuf(ss, skb, outbug); retval = 1; } spin_unlock_irqrestore(&ss->lock, flags); @@ -1906,8 +1910,11 @@ static ssize_t dahdi_chan_read(struct file *file, char *usrbuf, size_t count, in myamnt = chan->readn[res]; module_printk(KERN_NOTICE, "dahdi_chan_read(unit: %d, inwritebuf: %d, outwritebuf: %d amnt: %d\n", unit, chan->inwritebuf, chan->outwritebuf, myamnt); - module_printk(KERN_DEBUG, "\t("); for (x = 0; x < myamnt; x++) module_printk((KERN_DEBUG, x ? " %02x" : "%02x"), (unsigned char)usrbuf[x]); - module_printk(KERN_DEBUG, ")\n"); + + module_printk(KERN_DEBUG, "\t("); + for (x = 0; x < myamnt; x++) + printk((x ? " %02x" : "%02x"), (unsigned char)usrbuf[x]); + printk(")\n"); } #endif /* end addition */ |