Skip to contentSkip to conversation

ntb: ntb_pingpong: no need to check the return value of debugfs calls

PATCH New Greg Kroah-Hartman 1 participant 1 message Oct 11, 2019 NTB driver core

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ntb: ntb_pingpong: no need to check the return value of debugfs calls

There is no need to check the return value of debugfs_create_atomic_t as nothing happens with the error. Also, the code will never return NULL, so this check has never caught anything :)

Fix this by removing the check entirely.

---
 drivers/ntb/test/ntb_pingpong.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/ntb/test/ntb_pingpong.c +1 -4
index 65865e460ab8..04dd46647db3 100644
@@ -354,13 +354,10 @@ static void pp_clear_ctx(struct pp_ctx *pp)
 static void pp_setup_dbgfs(struct pp_ctx *pp)
 {
 	struct pci_dev *pdev = pp->ntb->pdev;
-	void *ret;
 
 	pp->dbgfs_dir = debugfs_create_dir(pci_name(pdev), pp_dbgfs_topdir);
 
-	ret = debugfs_create_atomic_t("count", 0600, pp->dbgfs_dir, &pp->count);
-	if (!ret)
-		dev_warn(&pp->ntb->dev, "DebugFS unsupported\n");
+	debugfs_create_atomic_t("count", 0600, pp->dbgfs_dir, &pp->count);
 }
 
 static void pp_clear_dbgfs(struct pp_ctx *pp)
Signature · 1 line
2.23.0