linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] realtek: no need to check return value of debugfs_create functions
@ 2019-01-22 15:21 Greg Kroah-Hartman
  2019-01-22 15:44 ` Larry Finger
  2019-02-01 12:33 ` [PATCH] rtlwifi: " Kalle Valo
  0 siblings, 2 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2019-01-22 15:21 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, Ping-Ke Shih, Kalle Valo, 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: Ping-Ke Shih <pkshih@realtek.com>
Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: linux-wireless@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/wireless/realtek/rtlwifi/debug.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/debug.c b/drivers/net/wireless/realtek/rtlwifi/debug.c
index d70385be9976..8186650efc56 100644
--- a/drivers/net/wireless/realtek/rtlwifi/debug.c
+++ b/drivers/net/wireless/realtek/rtlwifi/debug.c
@@ -463,12 +463,9 @@ static const struct file_operations file_ops_common_write = {
 #define RTL_DEBUGFS_ADD_CORE(name, mode, fopname)			   \
 	do {								   \
 		rtl_debug_priv_ ##name.rtlpriv = rtlpriv;		   \
-		if (!debugfs_create_file(#name, mode,			   \
-					 parent, &rtl_debug_priv_ ##name,  \
-					 &file_ops_ ##fopname))		   \
-			pr_err("Unable to initialize debugfs:%s/%s\n",	   \
-			       rtlpriv->dbg.debugfs_name,		   \
-			       #name);					   \
+		debugfs_create_file(#name, mode, parent,		   \
+				    &rtl_debug_priv_ ##name,		   \
+				    &file_ops_ ##fopname);		   \
 	} while (0)
 
 #define RTL_DEBUGFS_ADD(name)						   \
@@ -486,11 +483,6 @@ void rtl_debug_add_one(struct ieee80211_hw *hw)
 
 	rtlpriv->dbg.debugfs_dir =
 		debugfs_create_dir(rtlpriv->dbg.debugfs_name, debugfs_topdir);
-	if (!rtlpriv->dbg.debugfs_dir) {
-		pr_err("Unable to init debugfs:/%s/%s\n", rtlpriv->cfg->name,
-		       rtlpriv->dbg.debugfs_name);
-		return;
-	}
 
 	parent = rtlpriv->dbg.debugfs_dir;
 
-- 
2.20.1


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

* Re: [PATCH] realtek: no need to check return value of debugfs_create functions
  2019-01-22 15:21 [PATCH] realtek: no need to check return value of debugfs_create functions Greg Kroah-Hartman
@ 2019-01-22 15:44 ` Larry Finger
  2019-01-22 15:48   ` Kalle Valo
  2019-02-01 12:33 ` [PATCH] rtlwifi: " Kalle Valo
  1 sibling, 1 reply; 4+ messages in thread
From: Larry Finger @ 2019-01-22 15:44 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-kernel; +Cc: Ping-Ke Shih, Kalle Valo, linux-wireless

On 1/22/19 9:21 AM, Greg Kroah-Hartman 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: Ping-Ke Shih <pkshih@realtek.com>
> Cc: Kalle Valo <kvalo@codeaurora.org>
> Cc: linux-wireless@vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Greg,

Please change the subject to read "rtlwifi: ...". Otherwise the patch is correct.

Acked-by: Larry Finger <Larry.Finger@lwfinger.net>

Thanks,

Larry

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

* Re: [PATCH] realtek: no need to check return value of debugfs_create functions
  2019-01-22 15:44 ` Larry Finger
@ 2019-01-22 15:48   ` Kalle Valo
  0 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2019-01-22 15:48 UTC (permalink / raw)
  To: Larry Finger
  Cc: Greg Kroah-Hartman, linux-kernel, Ping-Ke Shih, linux-wireless

Larry Finger <Larry.Finger@lwfinger.net> writes:

> On 1/22/19 9:21 AM, Greg Kroah-Hartman 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: Ping-Ke Shih <pkshih@realtek.com>
>> Cc: Kalle Valo <kvalo@codeaurora.org>
>> Cc: linux-wireless@vger.kernel.org
>> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>
> Greg,
>
> Please change the subject to read "rtlwifi: ...". Otherwise the patch is correct.

I can fix that during commit.

-- 
Kalle Valo

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

* Re: [PATCH] rtlwifi: no need to check return value of debugfs_create functions
  2019-01-22 15:21 [PATCH] realtek: no need to check return value of debugfs_create functions Greg Kroah-Hartman
  2019-01-22 15:44 ` Larry Finger
@ 2019-02-01 12:33 ` Kalle Valo
  1 sibling, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2019-02-01 12:33 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-kernel, Greg Kroah-Hartman, Ping-Ke Shih, 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: Ping-Ke Shih <pkshih@realtek.com>
> Cc: Kalle Valo <kvalo@codeaurora.org>
> Cc: linux-wireless@vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Acked-by: Larry Finger <Larry.Finger@lwfinger.net>

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

3059785bb76e rtlwifi: no need to check return value of debugfs_create functions

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

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


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

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

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-22 15:21 [PATCH] realtek: no need to check return value of debugfs_create functions Greg Kroah-Hartman
2019-01-22 15:44 ` Larry Finger
2019-01-22 15:48   ` Kalle Valo
2019-02-01 12:33 ` [PATCH] rtlwifi: " Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).