Skip to contentSkip to conversation

nfc: st-nci: remove unnecessary label

PATCH Applied samirweng1979 2 participants 2 messages Apr 13, 2021

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

PATCH 1/1 nfc: st-nci: remove unnecessary label

From: wengjianfeng <[email protected]>

in st_nci_spi_write function, first assign a value to a variable then goto exit label. return statement just follow the label and exit label just used once, so we should directly return and remove exit label.

---
 drivers/nfc/st-nci/spi.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/nfc/st-nci/spi.c +2 -5
index 8db323a..09df6ea 100644
@@ -95,17 +95,14 @@ static int st_nci_spi_write(void *phy_id, struct sk_buff *skb)
 	 */
 	if (!r) {
 		skb_rx = alloc_skb(skb->len, GFP_KERNEL);
-		if (!skb_rx) {
-			r = -ENOMEM;
-			goto exit;
-		}
+		if (!skb_rx)
+			return -ENOMEM;
 
 		skb_put(skb_rx, skb->len);
 		memcpy(skb_rx->data, buf, skb->len);
 		ndlc_recv(phy->ndlc, skb_rx);
 	}
 
-exit:
 	return r;
 }
 
Signature · 1 line
1.9.1
#1 lore raw
This patch was applied to netdev/net-next.git (refs/heads/master):

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

Quoted 9 lines · On Tue, 13 Apr 2021 17:45:30 +0800 you wrote:

From: wengjianfeng <[email protected]>

in st_nci_spi_write function, first assign a value to a variable then goto exit label. return statement just follow the label and exit label just used once, so we should directly return and remove exit label.

[...]

Here is the summary with links:
- nfc: st-nci: remove unnecessary label
https://git.kernel.org/netdev/net-next/c/eba43fac8dfa

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html