[VLAN]: Clean up debugging and printks
- use pr_* functions and common prefix for non-device related messages - remove VLAN_ printk levels - kill lots of useless debugging statements - remove a few unnecessary printks like for double VID registration (already returns -EEXIST) and kill of a number of unnecessary checks in vlan_proc_{add,rem}_dev() that are already performed by the caller Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
a5250a3695
commit
40f98e1af4
@@ -179,13 +179,6 @@ int vlan_proc_add_dev (struct net_device *vlandev)
|
||||
{
|
||||
struct vlan_dev_info *dev_info = VLAN_DEV_INFO(vlandev);
|
||||
|
||||
if (!(vlandev->priv_flags & IFF_802_1Q_VLAN)) {
|
||||
printk(KERN_ERR
|
||||
"ERROR: vlan_proc_add, device -:%s:- is NOT a VLAN\n",
|
||||
vlandev->name);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
dev_info->dent = create_proc_entry(vlandev->name,
|
||||
S_IFREG|S_IRUSR|S_IWUSR,
|
||||
proc_vlan_dir);
|
||||
@@ -194,11 +187,6 @@ int vlan_proc_add_dev (struct net_device *vlandev)
|
||||
|
||||
dev_info->dent->proc_fops = &vlandev_fops;
|
||||
dev_info->dent->data = vlandev;
|
||||
|
||||
#ifdef VLAN_DEBUG
|
||||
printk(KERN_ERR "vlan_proc_add, device -:%s:- being added.\n",
|
||||
vlandev->name);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -207,28 +195,11 @@ int vlan_proc_add_dev (struct net_device *vlandev)
|
||||
*/
|
||||
int vlan_proc_rem_dev(struct net_device *vlandev)
|
||||
{
|
||||
if (!vlandev) {
|
||||
printk(VLAN_ERR "%s: invalid argument: %p\n",
|
||||
__FUNCTION__, vlandev);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!(vlandev->priv_flags & IFF_802_1Q_VLAN)) {
|
||||
printk(VLAN_DBG "%s: invalid argument, device: %s is not a VLAN device, priv_flags: 0x%4hX.\n",
|
||||
__FUNCTION__, vlandev->name, vlandev->priv_flags);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
#ifdef VLAN_DEBUG
|
||||
printk(VLAN_DBG "%s: dev: %p\n", __FUNCTION__, vlandev);
|
||||
#endif
|
||||
|
||||
/** NOTE: This will consume the memory pointed to by dent, it seems. */
|
||||
if (VLAN_DEV_INFO(vlandev)->dent) {
|
||||
remove_proc_entry(VLAN_DEV_INFO(vlandev)->dent->name, proc_vlan_dir);
|
||||
VLAN_DEV_INFO(vlandev)->dent = NULL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user