Commit afab2d29 authored by Joe Perches's avatar Joe Perches Committed by David S. Miller

net: 8021q: Add pr_fmt

Use the current logging style.

Add #define pr_fmt and remove embedded prefix from formats.

Not converting the current pr_<level> uses to netdev_<level>
because all the output here is nicely prefaced with "8021q: ".

Remove __func__ use from proc registration failure message.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8a07eb0a
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
* 2 of the License, or (at your option) any later version. * 2 of the License, or (at your option) any later version.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/capability.h> #include <linux/capability.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
...@@ -149,13 +151,13 @@ int vlan_check_real_dev(struct net_device *real_dev, u16 vlan_id) ...@@ -149,13 +151,13 @@ int vlan_check_real_dev(struct net_device *real_dev, u16 vlan_id)
const struct net_device_ops *ops = real_dev->netdev_ops; const struct net_device_ops *ops = real_dev->netdev_ops;
if (real_dev->features & NETIF_F_VLAN_CHALLENGED) { if (real_dev->features & NETIF_F_VLAN_CHALLENGED) {
pr_info("8021q: VLANs not supported on %s\n", name); pr_info("VLANs not supported on %s\n", name);
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
if ((real_dev->features & NETIF_F_HW_VLAN_FILTER) && if ((real_dev->features & NETIF_F_HW_VLAN_FILTER) &&
(!ops->ndo_vlan_rx_add_vid || !ops->ndo_vlan_rx_kill_vid)) { (!ops->ndo_vlan_rx_add_vid || !ops->ndo_vlan_rx_kill_vid)) {
pr_info("8021q: Device %s has buggy VLAN hw accel\n", name); pr_info("Device %s has buggy VLAN hw accel\n", name);
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
...@@ -344,13 +346,12 @@ static void __vlan_device_event(struct net_device *dev, unsigned long event) ...@@ -344,13 +346,12 @@ static void __vlan_device_event(struct net_device *dev, unsigned long event)
case NETDEV_CHANGENAME: case NETDEV_CHANGENAME:
vlan_proc_rem_dev(dev); vlan_proc_rem_dev(dev);
if (vlan_proc_add_dev(dev) < 0) if (vlan_proc_add_dev(dev) < 0)
pr_warning("8021q: failed to change proc name for %s\n", pr_warn("failed to change proc name for %s\n",
dev->name); dev->name);
break; break;
case NETDEV_REGISTER: case NETDEV_REGISTER:
if (vlan_proc_add_dev(dev) < 0) if (vlan_proc_add_dev(dev) < 0)
pr_warning("8021q: failed to add proc entry for %s\n", pr_warn("failed to add proc entry for %s\n", dev->name);
dev->name);
break; break;
case NETDEV_UNREGISTER: case NETDEV_UNREGISTER:
vlan_proc_rem_dev(dev); vlan_proc_rem_dev(dev);
...@@ -374,7 +375,7 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event, ...@@ -374,7 +375,7 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event,
if ((event == NETDEV_UP) && if ((event == NETDEV_UP) &&
(dev->features & NETIF_F_HW_VLAN_FILTER) && (dev->features & NETIF_F_HW_VLAN_FILTER) &&
dev->netdev_ops->ndo_vlan_rx_add_vid) { dev->netdev_ops->ndo_vlan_rx_add_vid) {
pr_info("8021q: adding VLAN 0 to HW filter on device %s\n", pr_info("adding VLAN 0 to HW filter on device %s\n",
dev->name); dev->name);
dev->netdev_ops->ndo_vlan_rx_add_vid(dev, 0); dev->netdev_ops->ndo_vlan_rx_add_vid(dev, 0);
} }
......
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
* 2 of the License, or (at your option) any later version. * 2 of the License, or (at your option) any later version.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h> #include <linux/module.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/skbuff.h> #include <linux/skbuff.h>
...@@ -55,7 +57,7 @@ static int vlan_dev_rebuild_header(struct sk_buff *skb) ...@@ -55,7 +57,7 @@ static int vlan_dev_rebuild_header(struct sk_buff *skb)
return arp_find(veth->h_dest, skb); return arp_find(veth->h_dest, skb);
#endif #endif
default: default:
pr_debug("%s: unable to resolve type %X addresses.\n", pr_debug("%s: unable to resolve type %X addresses\n",
dev->name, ntohs(veth->h_vlan_encapsulated_proto)); dev->name, ntohs(veth->h_vlan_encapsulated_proto));
memcpy(veth->h_source, dev->dev_addr, ETH_ALEN); memcpy(veth->h_source, dev->dev_addr, ETH_ALEN);
......
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
* Jan 20, 1998 Ben Greear Initial Version * Jan 20, 1998 Ben Greear Initial Version
*****************************************************************************/ *****************************************************************************/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h> #include <linux/module.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/kernel.h> #include <linux/kernel.h>
...@@ -155,7 +157,7 @@ int __net_init vlan_proc_init(struct net *net) ...@@ -155,7 +157,7 @@ int __net_init vlan_proc_init(struct net *net)
return 0; return 0;
err: err:
pr_err("%s: can't create entry in proc filesystem!\n", __func__); pr_err("can't create entry in proc filesystem!\n");
vlan_proc_cleanup(net); vlan_proc_cleanup(net);
return -ENOBUFS; return -ENOBUFS;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment