Skip to contentSkip to conversation

mwifiex: no need to check return value of debugfs_create functions

PATCH In review Greg Kroah-Hartman 2 participants 2 messages Jan 22, 2019 – Feb 1, 2019 Marvell mwifiex wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mwifiex: 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 Amitkumar Karwar <[email protected]>
Cc Nishant Sarmukadam <[email protected]>
Cc Ganapathi Bhat <[email protected]>
Cc Xinming Hu <[email protected]>
Cc Kalle Valo <[email protected]>
---
 drivers/net/wireless/marvell/mwifiex/debugfs.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/net/wireless/marvell/mwifiex/debugfs.c +2 -3
index cbe4493b3266..8ab114cf3467 100644
@@ -922,9 +922,8 @@ mwifiex_reset_write(struct file *file,
 }
 
 #define MWIFIEX_DFS_ADD_FILE(name) do {                                 \
-	if (!debugfs_create_file(#name, 0644, priv->dfs_dev_dir,        \
-			priv, &mwifiex_dfs_##name##_fops))              \
-		return;                                                 \
+	debugfs_create_file(#name, 0644, priv->dfs_dev_dir, priv,       \
+			    &mwifiex_dfs_##name##_fops);                \
 } while (0);
 
 #define MWIFIEX_DFS_FILE_OPS(name)                                      \
Signature · 1 line
2.20.1
#1 lore raw
Quoted 11 lines · Greg Kroah-Hartman

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 Amitkumar Karwar <[email protected]>
Cc Nishant Sarmukadam <[email protected]>
Cc Ganapathi Bhat <[email protected]>
Cc Xinming Hu <[email protected]>
Cc Kalle Valo <[email protected]>

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

a0b449dc4c67 mwifiex: no need to check return value of debugfs_create functions

Signature · 3 lines
https://patchwork.kernel.org/patch/10775747/

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