* [PATCH net-next 0/5] net: wan: clean up some code style issues
@ 2021-05-18 12:29 Guangbin Huang
2021-05-18 12:29 ` [PATCH net-next 1/5] net: wan: remove redundant blank lines Guangbin Huang
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: Guangbin Huang @ 2021-05-18 12:29 UTC (permalink / raw)
To: davem, kuba, xie.he.0141, ms, willemb
Cc: netdev, linux-kernel, lipeng321, tanhuazhong, huangguangbin2
This patchset clean up some code style issues.
Peng Li (5):
net: wan: remove redundant blank lines
net: wan: add some required spaces
net: wan: remove redundant braces {}
net: wan: remove redundant space
net: wan: fix variable definition style
drivers/net/wan/c101.c | 39 +++++++++++----------------------------
drivers/net/wan/fsl_ucc_hdlc.c | 3 +--
2 files changed, 12 insertions(+), 30 deletions(-)
--
2.8.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH net-next 1/5] net: wan: remove redundant blank lines
2021-05-18 12:29 [PATCH net-next 0/5] net: wan: clean up some code style issues Guangbin Huang
@ 2021-05-18 12:29 ` Guangbin Huang
2021-05-18 12:29 ` [PATCH net-next 2/5] net: wan: add some required spaces Guangbin Huang
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Guangbin Huang @ 2021-05-18 12:29 UTC (permalink / raw)
To: davem, kuba, xie.he.0141, ms, willemb
Cc: netdev, linux-kernel, lipeng321, tanhuazhong, huangguangbin2
From: Peng Li <lipeng321@huawei.com>
This patch removes some redundant blank lines.
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
---
drivers/net/wan/c101.c | 17 -----------------
1 file changed, 17 deletions(-)
diff --git a/drivers/net/wan/c101.c b/drivers/net/wan/c101.c
index c354a5143e99..215f2fbfc3ae 100644
--- a/drivers/net/wan/c101.c
+++ b/drivers/net/wan/c101.c
@@ -28,7 +28,6 @@
#include "hd64570.h"
-
static const char* version = "Moxa C101 driver version: 1.15";
static const char* devname = "C101";
@@ -51,7 +50,6 @@ static const char* devname = "C101";
static char *hw; /* pointer to hw=xxx command line string */
-
typedef struct card_s {
struct net_device *dev;
spinlock_t lock; /* TX lock */
@@ -79,7 +77,6 @@ typedef card_t port_t;
static card_t *first_card;
static card_t **new_card = &first_card;
-
#define sca_in(reg, card) readb((card)->win0base + C101_SCA + (reg))
#define sca_out(value, reg, card) writeb(value, (card)->win0base + C101_SCA + (reg))
#define sca_inw(reg, card) readw((card)->win0base + C101_SCA + (reg))
@@ -99,7 +96,6 @@ static card_t **new_card = &first_card;
#define get_port(card, port) (card)
static void sca_msci_intr(port_t *port);
-
static inline u8 sca_get_page(card_t *card)
{
return card->page;
@@ -111,10 +107,8 @@ static inline void openwin(card_t *card, u8 page)
writeb(page, card->win0base + C101_PAGE);
}
-
#include "hd64570.c"
-
static inline void set_carrier(port_t *port)
{
if (!(sca_in(MSCI1_OFFSET + ST3, port) & ST3_DCD))
@@ -123,7 +117,6 @@ static inline void set_carrier(port_t *port)
netif_carrier_off(port_to_dev(port));
}
-
static void sca_msci_intr(port_t *port)
{
u8 stat = sca_in(MSCI0_OFFSET + ST1, port); /* read MSCI ST1 status */
@@ -145,7 +138,6 @@ static void sca_msci_intr(port_t *port)
set_carrier(port);
}
-
static void c101_set_iface(port_t *port)
{
u8 rxs = port->rxs & CLK_BRG_MASK;
@@ -179,7 +171,6 @@ static void c101_set_iface(port_t *port)
sca_set_port(port);
}
-
static int c101_open(struct net_device *dev)
{
port_t *port = dev_to_port(dev);
@@ -206,7 +197,6 @@ static int c101_open(struct net_device *dev)
return 0;
}
-
static int c101_close(struct net_device *dev)
{
port_t *port = dev_to_port(dev);
@@ -218,7 +208,6 @@ static int c101_close(struct net_device *dev)
return 0;
}
-
static int c101_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
const size_t size = sizeof(sync_serial_settings);
@@ -276,8 +265,6 @@ static int c101_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
}
}
-
-
static void c101_destroy_card(card_t *card)
{
readb(card->win0base + C101_PAGE); /* Resets SCA? */
@@ -392,8 +379,6 @@ static int __init c101_run(unsigned long irq, unsigned long winbase)
return 0;
}
-
-
static int __init c101_init(void)
{
if (hw == NULL) {
@@ -425,7 +410,6 @@ static int __init c101_init(void)
return first_card ? 0 : -EINVAL;
}
-
static void __exit c101_cleanup(void)
{
card_t *card = first_card;
@@ -438,7 +422,6 @@ static void __exit c101_cleanup(void)
}
}
-
module_init(c101_init);
module_exit(c101_cleanup);
--
2.8.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH net-next 2/5] net: wan: add some required spaces
2021-05-18 12:29 [PATCH net-next 0/5] net: wan: clean up some code style issues Guangbin Huang
2021-05-18 12:29 ` [PATCH net-next 1/5] net: wan: remove redundant blank lines Guangbin Huang
@ 2021-05-18 12:29 ` Guangbin Huang
2021-05-18 12:29 ` [PATCH net-next 3/5] net: wan: remove redundant braces {} Guangbin Huang
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Guangbin Huang @ 2021-05-18 12:29 UTC (permalink / raw)
To: davem, kuba, xie.he.0141, ms, willemb
Cc: netdev, linux-kernel, lipeng321, tanhuazhong, huangguangbin2
From: Peng Li <lipeng321@huawei.com>
Add space required before the open parenthesis '(',
and add spaces required around that '<', '>' and '!='.
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
---
drivers/net/wan/c101.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/net/wan/c101.c b/drivers/net/wan/c101.c
index 215f2fbfc3ae..5a04f18db32a 100644
--- a/drivers/net/wan/c101.c
+++ b/drivers/net/wan/c101.c
@@ -70,7 +70,7 @@ typedef struct card_s {
u8 page;
struct card_s *next_card;
-}card_t;
+} card_t;
typedef card_t port_t;
@@ -85,7 +85,7 @@ static card_t **new_card = &first_card;
#define sca_outw(value, reg, card) do { \
writeb(value & 0xFF, (card)->win0base + C101_SCA + (reg)); \
writeb((value >> 8 ) & 0xFF, (card)->win0base + C101_SCA + (reg + 1));\
-} while(0)
+} while (0)
#define port_to_card(port) (port)
#define log_node(port) (0)
@@ -143,7 +143,7 @@ static void c101_set_iface(port_t *port)
u8 rxs = port->rxs & CLK_BRG_MASK;
u8 txs = port->txs & CLK_BRG_MASK;
- switch(port->settings.clock_type) {
+ switch (port->settings.clock_type) {
case CLOCK_INT:
rxs |= CLK_BRG_RX; /* TX clock */
txs |= CLK_RXCLK_TX; /* BRG output */
@@ -229,7 +229,7 @@ static int c101_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
if (cmd != SIOCWANDEV)
return hdlc_ioctl(dev, ifr, cmd);
- switch(ifr->ifr_settings.type) {
+ switch (ifr->ifr_settings.type) {
case IF_GET_IFACE:
ifr->ifr_settings.type = IF_IFACE_SYNC_SERIAL;
if (ifr->ifr_settings.size < size) {
@@ -241,7 +241,7 @@ static int c101_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
return 0;
case IF_IFACE_SYNC_SERIAL:
- if(!capable(CAP_NET_ADMIN))
+ if (!capable(CAP_NET_ADMIN))
return -EPERM;
if (copy_from_user(&new_line, line, size))
@@ -296,12 +296,12 @@ static int __init c101_run(unsigned long irq, unsigned long winbase)
card_t *card;
int result;
- if (irq<3 || irq>15 || irq == 6) /* FIXME */ {
+ if (irq < 3 || irq > 15 || irq == 6) /* FIXME */ {
pr_err("invalid IRQ value\n");
return -ENODEV;
}
- if (winbase < 0xC0000 || winbase > 0xDFFFF || (winbase & 0x3FFF) !=0) {
+ if (winbase < 0xC0000 || winbase > 0xDFFFF || (winbase & 0x3FFF) != 0) {
pr_err("invalid RAM value\n");
return -ENODEV;
}
@@ -404,7 +404,7 @@ static int __init c101_init(void)
if (*hw == '\x0')
return first_card ? 0 : -EINVAL;
- }while(*hw++ == ':');
+ } while (*hw++ == ':');
pr_err("invalid hardware parameters\n");
return first_card ? 0 : -EINVAL;
--
2.8.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH net-next 3/5] net: wan: remove redundant braces {}
2021-05-18 12:29 [PATCH net-next 0/5] net: wan: clean up some code style issues Guangbin Huang
2021-05-18 12:29 ` [PATCH net-next 1/5] net: wan: remove redundant blank lines Guangbin Huang
2021-05-18 12:29 ` [PATCH net-next 2/5] net: wan: add some required spaces Guangbin Huang
@ 2021-05-18 12:29 ` Guangbin Huang
2021-05-18 12:29 ` [PATCH net-next 4/5] net: wan: remove redundant space Guangbin Huang
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Guangbin Huang @ 2021-05-18 12:29 UTC (permalink / raw)
To: davem, kuba, xie.he.0141, ms, willemb
Cc: netdev, linux-kernel, lipeng321, tanhuazhong, huangguangbin2
From: Peng Li <lipeng321@huawei.com>
Braces {} are not necessary for single statement blocks,
this patch removes redundant braces {}.
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
---
drivers/net/wan/fsl_ucc_hdlc.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/wan/fsl_ucc_hdlc.c b/drivers/net/wan/fsl_ucc_hdlc.c
index 7eac6a3e1cde..39f05fabbfa4 100644
--- a/drivers/net/wan/fsl_ucc_hdlc.c
+++ b/drivers/net/wan/fsl_ucc_hdlc.c
@@ -1171,9 +1171,8 @@ static int ucc_hdlc_probe(struct platform_device *pdev)
ut_info->uf_info.irq = irq_of_parse_and_map(np, 0);
uhdlc_priv = kzalloc(sizeof(*uhdlc_priv), GFP_KERNEL);
- if (!uhdlc_priv) {
+ if (!uhdlc_priv)
return -ENOMEM;
- }
dev_set_drvdata(&pdev->dev, uhdlc_priv);
uhdlc_priv->dev = &pdev->dev;
--
2.8.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH net-next 4/5] net: wan: remove redundant space
2021-05-18 12:29 [PATCH net-next 0/5] net: wan: clean up some code style issues Guangbin Huang
` (2 preceding siblings ...)
2021-05-18 12:29 ` [PATCH net-next 3/5] net: wan: remove redundant braces {} Guangbin Huang
@ 2021-05-18 12:29 ` Guangbin Huang
2021-05-18 12:29 ` [PATCH net-next 5/5] net: wan: fix variable definition style Guangbin Huang
2021-05-18 20:50 ` [PATCH net-next 0/5] net: wan: clean up some code style issues patchwork-bot+netdevbpf
5 siblings, 0 replies; 7+ messages in thread
From: Guangbin Huang @ 2021-05-18 12:29 UTC (permalink / raw)
To: davem, kuba, xie.he.0141, ms, willemb
Cc: netdev, linux-kernel, lipeng321, tanhuazhong, huangguangbin2
From: Peng Li <lipeng321@huawei.com>
Space prohibited before that close parenthesis ')',
so removes the redundant space.
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
---
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 5a04f18db32a..e2ca559e6553 100644
--- a/drivers/net/wan/c101.c
+++ b/drivers/net/wan/c101.c
@@ -84,7 +84,7 @@ static card_t **new_card = &first_card;
/* EDA address register must be set in EDAL, EDAH order - 8 bit ISA bus */
#define sca_outw(value, reg, card) do { \
writeb(value & 0xFF, (card)->win0base + C101_SCA + (reg)); \
- writeb((value >> 8 ) & 0xFF, (card)->win0base + C101_SCA + (reg + 1));\
+ writeb((value >> 8) & 0xFF, (card)->win0base + C101_SCA + (reg + 1));\
} while (0)
#define port_to_card(port) (port)
--
2.8.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH net-next 5/5] net: wan: fix variable definition style
2021-05-18 12:29 [PATCH net-next 0/5] net: wan: clean up some code style issues Guangbin Huang
` (3 preceding siblings ...)
2021-05-18 12:29 ` [PATCH net-next 4/5] net: wan: remove redundant space Guangbin Huang
@ 2021-05-18 12:29 ` Guangbin Huang
2021-05-18 20:50 ` [PATCH net-next 0/5] net: wan: clean up some code style issues patchwork-bot+netdevbpf
5 siblings, 0 replies; 7+ messages in thread
From: Guangbin Huang @ 2021-05-18 12:29 UTC (permalink / raw)
To: davem, kuba, xie.he.0141, ms, willemb
Cc: netdev, linux-kernel, lipeng321, tanhuazhong, huangguangbin2
From: Peng Li <lipeng321@huawei.com>
Fix the checkpatch error: "foo* bar" should be "foo *bar".
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
---
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 e2ca559e6553..7e431e5b6e85 100644
--- a/drivers/net/wan/c101.c
+++ b/drivers/net/wan/c101.c
@@ -28,8 +28,8 @@
#include "hd64570.h"
-static const char* version = "Moxa C101 driver version: 1.15";
-static const char* devname = "C101";
+static const char *version = "Moxa C101 driver version: 1.15";
+static const char *devname = "C101";
#undef DEBUG_PKT
#define DEBUG_RINGS
--
2.8.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH net-next 0/5] net: wan: clean up some code style issues
2021-05-18 12:29 [PATCH net-next 0/5] net: wan: clean up some code style issues Guangbin Huang
` (4 preceding siblings ...)
2021-05-18 12:29 ` [PATCH net-next 5/5] net: wan: fix variable definition style Guangbin Huang
@ 2021-05-18 20:50 ` patchwork-bot+netdevbpf
5 siblings, 0 replies; 7+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-05-18 20:50 UTC (permalink / raw)
To: Guangbin Huang
Cc: davem, kuba, xie.he.0141, ms, willemb, netdev, linux-kernel,
lipeng321, tanhuazhong
Hello:
This series was applied to netdev/net-next.git (refs/heads/master):
On Tue, 18 May 2021 20:29:49 +0800 you wrote:
> This patchset clean up some code style issues.
>
> Peng Li (5):
> net: wan: remove redundant blank lines
> net: wan: add some required spaces
> net: wan: remove redundant braces {}
> net: wan: remove redundant space
> net: wan: fix variable definition style
>
> [...]
Here is the summary with links:
- [net-next,1/5] net: wan: remove redundant blank lines
https://git.kernel.org/netdev/net-next/c/78524c01edb2
- [net-next,2/5] net: wan: add some required spaces
https://git.kernel.org/netdev/net-next/c/23c235412411
- [net-next,3/5] net: wan: remove redundant braces {}
https://git.kernel.org/netdev/net-next/c/a4e591477611
- [net-next,4/5] net: wan: remove redundant space
https://git.kernel.org/netdev/net-next/c/da8e6fddbae3
- [net-next,5/5] net: wan: fix variable definition style
https://git.kernel.org/netdev/net-next/c/a3f3e831dc2a
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2021-05-18 20:50 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-18 12:29 [PATCH net-next 0/5] net: wan: clean up some code style issues Guangbin Huang
2021-05-18 12:29 ` [PATCH net-next 1/5] net: wan: remove redundant blank lines Guangbin Huang
2021-05-18 12:29 ` [PATCH net-next 2/5] net: wan: add some required spaces Guangbin Huang
2021-05-18 12:29 ` [PATCH net-next 3/5] net: wan: remove redundant braces {} Guangbin Huang
2021-05-18 12:29 ` [PATCH net-next 4/5] net: wan: remove redundant space Guangbin Huang
2021-05-18 12:29 ` [PATCH net-next 5/5] net: wan: fix variable definition style Guangbin Huang
2021-05-18 20:50 ` [PATCH net-next 0/5] net: wan: clean up some code style issues patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).