Skip to content

Commit afab2d2

Browse files
JoePerchesdavem330
authored andcommitted
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: Joe Perches <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 8a07eb0 commit afab2d2

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

net/8021q/vlan.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
* 2 of the License, or (at your option) any later version.
1919
*/
2020

21+
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
22+
2123
#include <linux/capability.h>
2224
#include <linux/module.h>
2325
#include <linux/netdevice.h>
@@ -149,13 +151,13 @@ int vlan_check_real_dev(struct net_device *real_dev, u16 vlan_id)
149151
const struct net_device_ops *ops = real_dev->netdev_ops;
150152

151153
if (real_dev->features & NETIF_F_VLAN_CHALLENGED) {
152-
pr_info("8021q: VLANs not supported on %s\n", name);
154+
pr_info("VLANs not supported on %s\n", name);
153155
return -EOPNOTSUPP;
154156
}
155157

156158
if ((real_dev->features & NETIF_F_HW_VLAN_FILTER) &&
157159
(!ops->ndo_vlan_rx_add_vid || !ops->ndo_vlan_rx_kill_vid)) {
158-
pr_info("8021q: Device %s has buggy VLAN hw accel\n", name);
160+
pr_info("Device %s has buggy VLAN hw accel\n", name);
159161
return -EOPNOTSUPP;
160162
}
161163

@@ -344,13 +346,12 @@ static void __vlan_device_event(struct net_device *dev, unsigned long event)
344346
case NETDEV_CHANGENAME:
345347
vlan_proc_rem_dev(dev);
346348
if (vlan_proc_add_dev(dev) < 0)
347-
pr_warning("8021q: failed to change proc name for %s\n",
348-
dev->name);
349+
pr_warn("failed to change proc name for %s\n",
350+
dev->name);
349351
break;
350352
case NETDEV_REGISTER:
351353
if (vlan_proc_add_dev(dev) < 0)
352-
pr_warning("8021q: failed to add proc entry for %s\n",
353-
dev->name);
354+
pr_warn("failed to add proc entry for %s\n", dev->name);
354355
break;
355356
case NETDEV_UNREGISTER:
356357
vlan_proc_rem_dev(dev);
@@ -374,7 +375,7 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event,
374375
if ((event == NETDEV_UP) &&
375376
(dev->features & NETIF_F_HW_VLAN_FILTER) &&
376377
dev->netdev_ops->ndo_vlan_rx_add_vid) {
377-
pr_info("8021q: adding VLAN 0 to HW filter on device %s\n",
378+
pr_info("adding VLAN 0 to HW filter on device %s\n",
378379
dev->name);
379380
dev->netdev_ops->ndo_vlan_rx_add_vid(dev, 0);
380381
}

net/8021q/vlan_dev.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
* 2 of the License, or (at your option) any later version.
2121
*/
2222

23+
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
24+
2325
#include <linux/module.h>
2426
#include <linux/slab.h>
2527
#include <linux/skbuff.h>
@@ -55,7 +57,7 @@ static int vlan_dev_rebuild_header(struct sk_buff *skb)
5557
return arp_find(veth->h_dest, skb);
5658
#endif
5759
default:
58-
pr_debug("%s: unable to resolve type %X addresses.\n",
60+
pr_debug("%s: unable to resolve type %X addresses\n",
5961
dev->name, ntohs(veth->h_vlan_encapsulated_proto));
6062

6163
memcpy(veth->h_source, dev->dev_addr, ETH_ALEN);

net/8021q/vlanproc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
* Jan 20, 1998 Ben Greear Initial Version
1818
*****************************************************************************/
1919

20+
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
21+
2022
#include <linux/module.h>
2123
#include <linux/errno.h>
2224
#include <linux/kernel.h>
@@ -155,7 +157,7 @@ int __net_init vlan_proc_init(struct net *net)
155157
return 0;
156158

157159
err:
158-
pr_err("%s: can't create entry in proc filesystem!\n", __func__);
160+
pr_err("can't create entry in proc filesystem!\n");
159161
vlan_proc_cleanup(net);
160162
return -ENOBUFS;
161163
}

0 commit comments

Comments
 (0)