ntb: ntb_pingpong: no need to check the return value of debugfs calls
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Oct 2019 13:19:19 +0000 (15:19 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Oct 2019 13:07:22 +0000 (06:07 -0700)
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.

Cc: Jon Mason <jdmason@kudzu.us>
Cc: Dave Jiang <dave.jiang@intel.com>
Cc: Allen Hubbe <allenbh@gmail.com>
Cc: linux-ntb@googlegroups.com
Cc: linux-kernel@vger.kernel.org
Link: https://lore.kernel.org/r/20191011131919.GA1174815@kroah.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/ntb/test/ntb_pingpong.c

index 65865e460ab87eb4847db95a3600007c88cf19a4..04dd46647db361c35a2a01c41a480a5165b231b2 100644 (file)
@@ -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)