All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ti: wl12xx: no need to check return value of debugfs_create functions
@ 2019-01-22 15:21 Greg Kroah-Hartman
  2019-01-22 23:09 ` Tony Lindgren
  2019-02-01 12:31 ` [PATCH] " Kalle Valo
  0 siblings, 2 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2019-01-22 15:21 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, Kalle Valo, Tony Lindgren, linux-wireless

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: Kalle Valo <kvalo@codeaurora.org>
Cc: Tony Lindgren <tony@atomide.com>
Cc: linux-wireless@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/wireless/ti/wl12xx/debugfs.c | 20 +-------------------
 1 file changed, 1 insertion(+), 19 deletions(-)

diff --git a/drivers/net/wireless/ti/wl12xx/debugfs.c b/drivers/net/wireless/ti/wl12xx/debugfs.c
index 0521cbf858cf..6c3c04eca8fd 100644
--- a/drivers/net/wireless/ti/wl12xx/debugfs.c
+++ b/drivers/net/wireless/ti/wl12xx/debugfs.c
@@ -125,20 +125,10 @@ WL12XX_DEBUGFS_FWSTATS_FILE(rxpipe, tx_xfr_host_int_trig_rx_data, "%u");
 int wl12xx_debugfs_add_files(struct wl1271 *wl,
 			     struct dentry *rootdir)
 {
-	int ret = 0;
-	struct dentry *entry, *stats, *moddir;
+	struct dentry *stats, *moddir;
 
 	moddir = debugfs_create_dir(KBUILD_MODNAME, rootdir);
-	if (!moddir || IS_ERR(moddir)) {
-		entry = moddir;
-		goto err;
-	}
-
 	stats = debugfs_create_dir("fw_stats", moddir);
-	if (!stats || IS_ERR(stats)) {
-		entry = stats;
-		goto err;
-	}
 
 	DEBUGFS_FWSTATS_ADD(tx, internal_desc_overflow);
 
@@ -232,12 +222,4 @@ int wl12xx_debugfs_add_files(struct wl1271 *wl,
 	DEBUGFS_FWSTATS_ADD(rxpipe, tx_xfr_host_int_trig_rx_data);
 
 	return 0;
-
-err:
-	if (IS_ERR(entry))
-		ret = PTR_ERR(entry);
-	else
-		ret = -ENOMEM;
-
-	return ret;
 }
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ti: wl12xx: no need to check return value of debugfs_create functions
  2019-01-22 15:21 [PATCH] ti: wl12xx: no need to check return value of debugfs_create functions Greg Kroah-Hartman
@ 2019-01-22 23:09 ` Tony Lindgren
  2019-02-01 12:31 ` [PATCH] " Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Tony Lindgren @ 2019-01-22 23:09 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, Kalle Valo, linux-wireless

* Greg Kroah-Hartman <gregkh@linuxfoundation.org> [190122 15:23]:
> 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.

Acked-by: Tony Lindgren <tony@atomide.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] wl12xx: no need to check return value of debugfs_create functions
  2019-01-22 15:21 [PATCH] ti: wl12xx: no need to check return value of debugfs_create functions Greg Kroah-Hartman
  2019-01-22 23:09 ` Tony Lindgren
@ 2019-02-01 12:31 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2019-02-01 12:31 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-kernel, Greg Kroah-Hartman, Tony Lindgren, linux-wireless

Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:

> 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: Kalle Valo <kvalo@codeaurora.org>
> Cc: Tony Lindgren <tony@atomide.com>
> Cc: linux-wireless@vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Acked-by: Tony Lindgren <tony@atomide.com>

Patch applied to wireless-drivers-next.git, thanks.

23f389660301 wl12xx: no need to check return value of debugfs_create functions

-- 
https://patchwork.kernel.org/patch/10775789/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-02-01 12:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-22 15:21 [PATCH] ti: wl12xx: no need to check return value of debugfs_create functions Greg Kroah-Hartman
2019-01-22 23:09 ` Tony Lindgren
2019-02-01 12:31 ` [PATCH] " Kalle Valo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.