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>
This commit is contained in:
parent
57647e6fdf
commit
cc317ea3d9
1 changed files with 0 additions and 9 deletions
|
@ -49,9 +49,6 @@ DEFINE_SHOW_ATTRIBUTE(bond_debug_rlb_hash);
|
||||||
|
|
||||||
void bond_debug_register(struct bonding *bond)
|
void bond_debug_register(struct bonding *bond)
|
||||||
{
|
{
|
||||||
if (!bonding_debug_root)
|
|
||||||
return;
|
|
||||||
|
|
||||||
bond->debug_dir =
|
bond->debug_dir =
|
||||||
debugfs_create_dir(bond->dev->name, bonding_debug_root);
|
debugfs_create_dir(bond->dev->name, bonding_debug_root);
|
||||||
|
|
||||||
|
@ -61,9 +58,6 @@ void bond_debug_register(struct bonding *bond)
|
||||||
|
|
||||||
void bond_debug_unregister(struct bonding *bond)
|
void bond_debug_unregister(struct bonding *bond)
|
||||||
{
|
{
|
||||||
if (!bonding_debug_root)
|
|
||||||
return;
|
|
||||||
|
|
||||||
debugfs_remove_recursive(bond->debug_dir);
|
debugfs_remove_recursive(bond->debug_dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,9 +65,6 @@ void bond_debug_reregister(struct bonding *bond)
|
||||||
{
|
{
|
||||||
struct dentry *d;
|
struct dentry *d;
|
||||||
|
|
||||||
if (!bonding_debug_root)
|
|
||||||
return;
|
|
||||||
|
|
||||||
d = debugfs_rename(bonding_debug_root, bond->debug_dir,
|
d = debugfs_rename(bonding_debug_root, bond->debug_dir,
|
||||||
bonding_debug_root, bond->dev->name);
|
bonding_debug_root, bond->dev->name);
|
||||||
if (!IS_ERR(d)) {
|
if (!IS_ERR(d)) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue