aboutsummaryrefslogtreecommitdiffstats
path: root/net/l2tp/l2tp_eth.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2012-05-16 05:55:56 -0400
committerDavid S. Miller <davem@davemloft.net>2012-05-17 04:34:38 -0400
commita4ca44fa578c7c7fd123b7fba3c2c98d4ba4e53d (patch)
tree58be0839a0c08ee8eaff4fac160dfb70b6982a70 /net/l2tp/l2tp_eth.c
parent028940342a906db8da014a7603a0deddc2c323dd (diff)
net: l2tp: Standardize logging styles
Use more current logging styles. Add pr_fmt to prefix output appropriately. Convert printks to pr_<level>. Convert PRINTK macros to new l2tp_<level> macros. Neaten some <foo>_refcount debugging macros. Use print_hex_dump_bytes instead of hand-coded loops. Coalesce formats and align arguments. Some KERN_DEBUG output is not now emitted unless dynamic_debugging is enabled. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: James Chapman <jchapman@katalix.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/l2tp/l2tp_eth.c')
-rw-r--r--net/l2tp/l2tp_eth.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/net/l2tp/l2tp_eth.c b/net/l2tp/l2tp_eth.c
index 63fe5f353f04..443591d629ca 100644
--- a/net/l2tp/l2tp_eth.c
+++ b/net/l2tp/l2tp_eth.c
@@ -9,6 +9,8 @@
9 * 2 of the License, or (at your option) any later version. 9 * 2 of the License, or (at your option) any later version.
10 */ 10 */
11 11
12#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
13
12#include <linux/module.h> 14#include <linux/module.h>
13#include <linux/skbuff.h> 15#include <linux/skbuff.h>
14#include <linux/socket.h> 16#include <linux/socket.h>
@@ -115,21 +117,14 @@ static void l2tp_eth_dev_recv(struct l2tp_session *session, struct sk_buff *skb,
115 117
116 if (session->debug & L2TP_MSG_DATA) { 118 if (session->debug & L2TP_MSG_DATA) {
117 unsigned int length; 119 unsigned int length;
118 int offset;
119 u8 *ptr = skb->data; 120 u8 *ptr = skb->data;
120 121
121 length = min(32u, skb->len); 122 length = min(32u, skb->len);
122 if (!pskb_may_pull(skb, length)) 123 if (!pskb_may_pull(skb, length))
123 goto error; 124 goto error;
124 125
125 printk(KERN_DEBUG "%s: eth recv: ", session->name); 126 pr_debug("%s: eth recv\n", session->name);
126 127 print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, ptr, length);
127 offset = 0;
128 do {
129 printk(" %02X", ptr[offset]);
130 } while (++offset < length);
131
132 printk("\n");
133 } 128 }
134 129
135 if (!pskb_may_pull(skb, sizeof(ETH_HLEN))) 130 if (!pskb_may_pull(skb, sizeof(ETH_HLEN)))
@@ -308,7 +303,7 @@ static int __init l2tp_eth_init(void)
308 if (err) 303 if (err)
309 goto out_unreg; 304 goto out_unreg;
310 305
311 printk(KERN_INFO "L2TP ethernet pseudowire support (L2TPv3)\n"); 306 pr_info("L2TP ethernet pseudowire support (L2TPv3)\n");
312 307
313 return 0; 308 return 0;
314 309