Skip to contentSkip to conversation

drivers: net: wireless: rsi: return explicit error values

PATCH In review Enrico Weigelt, metux IT consult 2 participants 3 messages Jun 27, 2019 – Jul 24, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers: net: wireless: rsi: return explicit error values

From: Enrico Weigelt <[email protected]>

Explicitly return constants instead of variable (and rely on it to be explicitly initialized), if the value is supposed to be fixed anyways. Align it with the rest of the driver, which does it the same way.

---
 drivers/net/wireless/rsi/rsi_91x_sdio.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/wireless/rsi/rsi_91x_sdio.c +3 -3
index b42cd50..2a3577d 100644
@@ -844,11 +844,11 @@ static int rsi_init_sdio_interface(struct rsi_hw *adapter,
 				   struct sdio_func *pfunction)
 {
 	struct rsi_91x_sdiodev *rsi_91x_dev;
-	int status = -ENOMEM;
+	int status;
 
 	rsi_91x_dev = kzalloc(sizeof(*rsi_91x_dev), GFP_KERNEL);
 	if (!rsi_91x_dev)
-		return status;
+		return -ENOMEM;
 
 	adapter->rsi_dev = rsi_91x_dev;
 
@@ -890,7 +890,7 @@ static int rsi_init_sdio_interface(struct rsi_hw *adapter,
 #ifdef CONFIG_RSI_DEBUGFS
 	adapter->num_debugfs_entries = MAX_DEBUGFS_ENTRIES;
 #endif
-	return status;
+	return 0;
 fail:
 	sdio_disable_func(pfunction);
 	sdio_release_host(pfunction);
Signature · 1 line
1.9.1
#1 lore raw
Quoted 8 lines · metux IT consult

From: Enrico Weigelt <[email protected]>

Explicitly return constants instead of variable (and rely on it to be explicitly initialized), if the value is supposed to be fixed anyways. Align it with the rest of the driver, which does it the same way.

I'll fix the title prefix to only have "rsi:", no need to have the full directory path there.

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

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
#2 lore raw

Re: [PATCH] rsi: return explicit error values

In reply to Enrico Weigelt, metux IT consult
Quoted 8 lines · metux IT consult

From: Enrico Weigelt <[email protected]>

Explicitly return constants instead of variable (and rely on it to be explicitly initialized), if the value is supposed to be fixed anyways. Align it with the rest of the driver, which does it the same way.

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

231e83fdcd03 rsi: return explicit error values

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

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