Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[firefly-linux-kernel-4.4.55.git] / drivers / net / ppp / ppp_synctty.c
index 55e466c511d5635adb2372d69908c680ac9affc1..090c834d7dbd2ebee45136a4c3266c9d06e7e375 100644 (file)
@@ -105,64 +105,15 @@ static const struct ppp_channel_ops sync_ops = {
 };
 
 /*
- * Utility procedures to print a buffer in hex/ascii
+ * Utility procedure to print a buffer in hex/ascii
  */
-static void
-ppp_print_hex (register __u8 * out, const __u8 * in, int count)
-{
-       register __u8 next_ch;
-       static const char hex[] = "0123456789ABCDEF";
-
-       while (count-- > 0) {
-               next_ch = *in++;
-               *out++ = hex[(next_ch >> 4) & 0x0F];
-               *out++ = hex[next_ch & 0x0F];
-               ++out;
-       }
-}
-
-static void
-ppp_print_char (register __u8 * out, const __u8 * in, int count)
-{
-       register __u8 next_ch;
-
-       while (count-- > 0) {
-               next_ch = *in++;
-
-               if (next_ch < 0x20 || next_ch > 0x7e)
-                       *out++ = '.';
-               else {
-                       *out++ = next_ch;
-                       if (next_ch == '%')   /* printk/syslogd has a bug !! */
-                               *out++ = '%';
-               }
-       }
-       *out = '\0';
-}
-
 static void
 ppp_print_buffer (const char *name, const __u8 *buf, int count)
 {
-       __u8 line[44];
-
        if (name != NULL)
                printk(KERN_DEBUG "ppp_synctty: %s, count = %d\n", name, count);
 
-       while (count > 8) {
-               memset (line, 32, 44);
-               ppp_print_hex (line, buf, 8);
-               ppp_print_char (&line[8 * 3], buf, 8);
-               printk(KERN_DEBUG "%s\n", line);
-               count -= 8;
-               buf += 8;
-       }
-
-       if (count > 0) {
-               memset (line, 32, 44);
-               ppp_print_hex (line, buf, count);
-               ppp_print_char (&line[8 * 3], buf, count);
-               printk(KERN_DEBUG "%s\n", line);
-       }
+       print_hex_dump_bytes("", DUMP_PREFIX_NONE, buf, count);
 }
 
 
@@ -588,7 +539,7 @@ ppp_sync_txmunge(struct syncppp *ap, struct sk_buff *skb)
                        skb_reserve(npkt,2);
                        skb_copy_from_linear_data(skb,
                                      skb_put(npkt, skb->len), skb->len);
-                       kfree_skb(skb);
+                       consume_skb(skb);
                        skb = npkt;
                }
                skb_push(skb,2);
@@ -656,7 +607,7 @@ ppp_sync_push(struct syncppp *ap)
                        if (sent < ap->tpkt->len) {
                                tty_stuffed = 1;
                        } else {
-                               kfree_skb(ap->tpkt);
+                               consume_skb(ap->tpkt);
                                ap->tpkt = NULL;
                                clear_bit(XMIT_FULL, &ap->xmit_flags);
                                done = 1;