Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

bonding: remove redundant NULL check in debugfs function

Because debugfs_create_dir returns ERR_PTR, so bonding_debug_root will
never be NULL. Remove redundant NULL check for bonding_debug_root in
debugfs function. The later debugfs_create_dir/debugfs_remove_recursive
/debugfs_remove_recursive functions will check the dentry with IS_ERR().

Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Zhengchao Shao and committed by
David S. Miller
cc317ea3 57647e6f

-9
-9
drivers/net/bonding/bond_debugfs.c
··· 49 49 50 50 void bond_debug_register(struct bonding *bond) 51 51 { 52 - if (!bonding_debug_root) 53 - return; 54 - 55 52 bond->debug_dir = 56 53 debugfs_create_dir(bond->dev->name, bonding_debug_root); 57 54 ··· 58 61 59 62 void bond_debug_unregister(struct bonding *bond) 60 63 { 61 - if (!bonding_debug_root) 62 - return; 63 - 64 64 debugfs_remove_recursive(bond->debug_dir); 65 65 } 66 66 67 67 void bond_debug_reregister(struct bonding *bond) 68 68 { 69 69 struct dentry *d; 70 - 71 - if (!bonding_debug_root) 72 - return; 73 70 74 71 d = debugfs_rename(bonding_debug_root, bond->debug_dir, 75 72 bonding_debug_root, bond->dev->name);