[PATCH net-next 0/3] net: c101: clean up some code style issues

STALE1873d

5 messages, 2 authors, 2021-06-21 · open the first message on its own page

[PATCH net-next 0/3] net: c101: clean up some code style issues

From: Peng Li <hidden>
Date: 2021-06-19 07:32:08

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(-)

-- 
2.8.1

[PATCH net-next 2/3] net: c101: replace comparison to NULL with "!card"

From: Peng Li <hidden>
Date: 2021-06-19 07:31:58

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

Signed-off-by: Peng Li <redacted>
---
 drivers/net/wan/c101.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wan/c101.c b/drivers/net/wan/c101.c
index 94b852f..f33192e 100644
--- a/drivers/net/wan/c101.c
+++ b/drivers/net/wan/c101.c
@@ -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
-- 
2.8.1

[PATCH net-next 1/3] net: c101: add blank line after declarations

From: Peng Li <hidden>
Date: 2021-06-19 07:32:04

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

Signed-off-by: Peng Li <redacted>
---
 drivers/net/wan/c101.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/drivers/net/wan/c101.c b/drivers/net/wan/c101.c
index 7e431e5..94b852f 100644
--- a/drivers/net/wan/c101.c
+++ b/drivers/net/wan/c101.c
@@ -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);
-- 
2.8.1

[PATCH net-next 3/3] net: c101: remove redundant spaces

From: Peng Li <hidden>
Date: 2021-06-19 07:32:07

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

Signed-off-by: Peng Li <redacted>
---
 drivers/net/wan/c101.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wan/c101.c b/drivers/net/wan/c101.c
index f33192e..059c2f7 100644
--- a/drivers/net/wan/c101.c
+++ b/drivers/net/wan/c101.c
@@ -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);
 
-- 
2.8.1

Re: [PATCH net-next 0/3] net: c101: clean up some code style issues

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-06-21 19:50:13

Hello:

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

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

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help