Skip to content

Commit e6882aa

Browse files
gregkhdavem330
authored andcommitted
mvpp2: no need to check return value of debugfs_create functions
When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Cc: "David S. Miller" <[email protected]> Cc: Maxime Chevallier <[email protected]> Cc: Nick Desaulniers <[email protected]> Cc: Nathan Huckleberry <[email protected]> Cc: [email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 2f62f8e commit e6882aa

File tree

1 file changed

+1
-18
lines changed

1 file changed

+1
-18
lines changed

drivers/net/ethernet/marvell/mvpp2/mvpp2_debugfs.c

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -452,8 +452,6 @@ static int mvpp2_dbgfs_flow_port_init(struct dentry *parent,
452452
struct dentry *port_dir;
453453

454454
port_dir = debugfs_create_dir(port->dev->name, parent);
455-
if (IS_ERR(port_dir))
456-
return PTR_ERR(port_dir);
457455

458456
port_entry = &port->priv->dbgfs_entries->port_flow_entries[port->id];
459457

@@ -480,8 +478,6 @@ static int mvpp2_dbgfs_flow_entry_init(struct dentry *parent,
480478
sprintf(flow_entry_name, "%02d", flow);
481479

482480
flow_entry_dir = debugfs_create_dir(flow_entry_name, parent);
483-
if (!flow_entry_dir)
484-
return -ENOMEM;
485481

486482
entry = &priv->dbgfs_entries->flow_entries[flow];
487483

@@ -514,8 +510,6 @@ static int mvpp2_dbgfs_flow_init(struct dentry *parent, struct mvpp2 *priv)
514510
int i, ret;
515511

516512
flow_dir = debugfs_create_dir("flows", parent);
517-
if (!flow_dir)
518-
return -ENOMEM;
519513

520514
for (i = 0; i < MVPP2_N_PRS_FLOWS; i++) {
521515
ret = mvpp2_dbgfs_flow_entry_init(flow_dir, priv, i);
@@ -539,8 +533,6 @@ static int mvpp2_dbgfs_prs_entry_init(struct dentry *parent,
539533
sprintf(prs_entry_name, "%03d", tid);
540534

541535
prs_entry_dir = debugfs_create_dir(prs_entry_name, parent);
542-
if (!prs_entry_dir)
543-
return -ENOMEM;
544536

545537
entry = &priv->dbgfs_entries->prs_entries[tid];
546538

@@ -578,8 +570,6 @@ static int mvpp2_dbgfs_prs_init(struct dentry *parent, struct mvpp2 *priv)
578570
int i, ret;
579571

580572
prs_dir = debugfs_create_dir("parser", parent);
581-
if (!prs_dir)
582-
return -ENOMEM;
583573

584574
for (i = 0; i < MVPP2_PRS_TCAM_SRAM_SIZE; i++) {
585575
ret = mvpp2_dbgfs_prs_entry_init(prs_dir, priv, i);
@@ -688,8 +678,6 @@ static int mvpp2_dbgfs_port_init(struct dentry *parent,
688678
struct dentry *port_dir;
689679

690680
port_dir = debugfs_create_dir(port->dev->name, parent);
691-
if (IS_ERR(port_dir))
692-
return PTR_ERR(port_dir);
693681

694682
debugfs_create_file("parser_entries", 0444, port_dir, port,
695683
&mvpp2_dbgfs_port_parser_fops);
@@ -716,15 +704,10 @@ void mvpp2_dbgfs_init(struct mvpp2 *priv, const char *name)
716704
int ret, i;
717705

718706
mvpp2_root = debugfs_lookup(MVPP2_DRIVER_NAME, NULL);
719-
if (!mvpp2_root) {
707+
if (!mvpp2_root)
720708
mvpp2_root = debugfs_create_dir(MVPP2_DRIVER_NAME, NULL);
721-
if (IS_ERR(mvpp2_root))
722-
return;
723-
}
724709

725710
mvpp2_dir = debugfs_create_dir(name, mvpp2_root);
726-
if (IS_ERR(mvpp2_dir))
727-
return;
728711

729712
priv->dbgfs_dir = mvpp2_dir;
730713
priv->dbgfs_entries = kzalloc(sizeof(*priv->dbgfs_entries), GFP_KERNEL);

0 commit comments

Comments
 (0)