Commit f8e34332 authored by Minjie Du's avatar Minjie Du Committed by Jakub Kicinski

net: mvpp2: debugfs: remove redundant parameter check in three functions

As per the comment above debugfs_create_dir(), it is not expected to
return an error, so an extra error check is not needed.
Drop the return check of debugfs_create_dir() in
mvpp2_dbgfs_c2_entry_init(), mvpp2_dbgfs_flow_tbl_entry_init()
and mvpp2_dbgfs_cls_init().
Signed-off-by: default avatarMinjie Du <duminjie@vivo.com>
Reviewed-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://lore.kernel.org/r/20230717025538.2848-1-duminjie@vivo.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 9843814f
...@@ -593,8 +593,6 @@ static int mvpp2_dbgfs_c2_entry_init(struct dentry *parent, ...@@ -593,8 +593,6 @@ static int mvpp2_dbgfs_c2_entry_init(struct dentry *parent,
sprintf(c2_entry_name, "%03d", id); sprintf(c2_entry_name, "%03d", id);
c2_entry_dir = debugfs_create_dir(c2_entry_name, parent); c2_entry_dir = debugfs_create_dir(c2_entry_name, parent);
if (!c2_entry_dir)
return -ENOMEM;
entry = &priv->dbgfs_entries->c2_entries[id]; entry = &priv->dbgfs_entries->c2_entries[id];
...@@ -626,8 +624,6 @@ static int mvpp2_dbgfs_flow_tbl_entry_init(struct dentry *parent, ...@@ -626,8 +624,6 @@ static int mvpp2_dbgfs_flow_tbl_entry_init(struct dentry *parent,
sprintf(flow_tbl_entry_name, "%03d", id); sprintf(flow_tbl_entry_name, "%03d", id);
flow_tbl_entry_dir = debugfs_create_dir(flow_tbl_entry_name, parent); flow_tbl_entry_dir = debugfs_create_dir(flow_tbl_entry_name, parent);
if (!flow_tbl_entry_dir)
return -ENOMEM;
entry = &priv->dbgfs_entries->flt_entries[id]; entry = &priv->dbgfs_entries->flt_entries[id];
...@@ -646,12 +642,8 @@ static int mvpp2_dbgfs_cls_init(struct dentry *parent, struct mvpp2 *priv) ...@@ -646,12 +642,8 @@ static int mvpp2_dbgfs_cls_init(struct dentry *parent, struct mvpp2 *priv)
int i, ret; int i, ret;
cls_dir = debugfs_create_dir("classifier", parent); cls_dir = debugfs_create_dir("classifier", parent);
if (!cls_dir)
return -ENOMEM;
c2_dir = debugfs_create_dir("c2", cls_dir); c2_dir = debugfs_create_dir("c2", cls_dir);
if (!c2_dir)
return -ENOMEM;
for (i = 0; i < MVPP22_CLS_C2_N_ENTRIES; i++) { for (i = 0; i < MVPP22_CLS_C2_N_ENTRIES; i++) {
ret = mvpp2_dbgfs_c2_entry_init(c2_dir, priv, i); ret = mvpp2_dbgfs_c2_entry_init(c2_dir, priv, i);
...@@ -660,8 +652,6 @@ static int mvpp2_dbgfs_cls_init(struct dentry *parent, struct mvpp2 *priv) ...@@ -660,8 +652,6 @@ static int mvpp2_dbgfs_cls_init(struct dentry *parent, struct mvpp2 *priv)
} }
flow_tbl_dir = debugfs_create_dir("flow_table", cls_dir); flow_tbl_dir = debugfs_create_dir("flow_table", cls_dir);
if (!flow_tbl_dir)
return -ENOMEM;
for (i = 0; i < MVPP2_CLS_FLOWS_TBL_SIZE; i++) { for (i = 0; i < MVPP2_CLS_FLOWS_TBL_SIZE; i++) {
ret = mvpp2_dbgfs_flow_tbl_entry_init(flow_tbl_dir, priv, i); ret = mvpp2_dbgfs_flow_tbl_entry_init(flow_tbl_dir, priv, i);
......
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