Skip to contentSkip to conversation

net: c101: clean up some code style issues

PATCH Applied Peng Li 2 participants 5 messages Jun 19, 2021 – Jun 21, 2021

Subsystems (3)
lore
Share & tools
lore

Peng Li

author
#0 lore raw

cover net: c101: clean up some code style issues

This patchset clean up some code style issues.

Peng Li (3):
net: c101: add blank line after declarations
net: c101: replace comparison to NULL with "!card"
net: c101: remove redundant spaces

 drivers/net/wan/c101.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
Signature · 1 line
2.8.1
author
#1 lore raw

PATCH 1/3 net: c101: add blank line after declarations

This patch fixes the checkpatch error about missing a blank line after declarations.

---
 drivers/net/wan/c101.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/wan/c101.c +1 -0
index 7e431e5..94b852f 100644
@@ -416,6 +416,7 @@ static void __exit c101_cleanup(void)
 
 	while (card) {
 		card_t *ptr = card;
+
 		card = card->next_card;
 		unregister_hdlc_device(port_to_dev(ptr));
 		c101_destroy_card(ptr);
Signature · 1 line
2.8.1
author
#2 lore raw

PATCH 2/3 net: c101: replace comparison to NULL with "!card"

In reply to Peng Li

According to the chackpatch.pl, comparison to NULL could be written "!card".

---
 drivers/net/wan/c101.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wan/c101.c +2 -2
index 94b852f..f33192e 100644
@@ -307,7 +307,7 @@ static int __init c101_run(unsigned long irq, unsigned long winbase)
 	}
 
 	card = kzalloc(sizeof(card_t), GFP_KERNEL);
-	if (card == NULL)
+	if (!card)
 		return -ENOBUFS;
 
 	card->dev = alloc_hdlcdev(card);
@@ -381,7 +381,7 @@ static int __init c101_run(unsigned long irq, unsigned long winbase)
 
 static int __init c101_init(void)
 {
-	if (hw == NULL) {
+	if (!hw) {
 #ifdef MODULE
 		pr_info("no card initialized\n");
 #endif
Signature · 1 line
2.8.1
author
#3 lore raw

PATCH 3/3 net: c101: remove redundant spaces

In reply to Peng Li

According to the chackpatch.pl, no space before tabs.

---
 drivers/net/wan/c101.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wan/c101.c +1 -1
index f33192e..059c2f7 100644
@@ -92,7 +92,7 @@ static card_t **new_card = &first_card;
 #define phy_node(port)		   (0)
 #define winsize(card)		   (C101_WINDOW_SIZE)
 #define win0base(card)		   ((card)->win0base)
-#define winbase(card)      	   ((card)->win0base + 0x2000)
+#define winbase(card)		   ((card)->win0base + 0x2000)
 #define get_port(card, port)	   (card)
 static void sca_msci_intr(port_t *port);
 
Signature · 1 line
2.8.1
#4 lore raw
In reply to Peng Li
This series was applied to netdev/net-next.git (refs/heads/master):

Hello:

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

Quoted 8 lines · On Sat, 19 Jun 2021 15:28:35 +0800 you wrote:

This patchset clean up some code style issues.

Peng Li (3):
net: c101: add blank line after declarations
net: c101: replace comparison to NULL with "!card"
net: c101: remove redundant spaces

[...]

Here is the summary with links:
- [net-next,1/3] net: c101: add blank line after declarations

    https://git.kernel.org/netdev/net-next/c/4f7d2247f839
  - [net-next,2/3] net: c101: replace comparison to NULL with "!card"
    https://git.kernel.org/netdev/net-next/c/7774318b9e5e
  - [net-next,3/3] net: c101: remove redundant spaces
    https://git.kernel.org/netdev/net-next/c/41505d3f0f51

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