* [PATCH net-next 0/7] net: ll_temac: Cleanup for clearing static warnings
@ 2022-09-17 10:38 Haoyue Xu
2022-09-17 10:38 ` [PATCH net-next 1/7] net: ll_temac: fix the format of block comments Haoyue Xu
` (8 more replies)
0 siblings, 9 replies; 10+ messages in thread
From: Haoyue Xu @ 2022-09-17 10:38 UTC (permalink / raw)
To: davem, kuba, netdev, linux-kernel, michal.simek
Cc: huangdaode, liyangyang20, xuhaoyue1, huangjunxian6, linuxarm,
liangwenpeng
Most static warnings are detected by Checkpatch.pl, mainly about:
(1) #1: About the comments.
(2) #2: About function name in a string.
(3) #3: About the open parenthesis.
(4) #4: About the else branch.
(6) #6: About trailing statements.
(7) #5,#7: About blank lines and spaces.
Haoyue Xu (1):
net: ll_temac: Cleanup for function name in a string
huangjunxian (6):
net: ll_temac: fix the format of block comments
net: ll_temac: axienet: align with open parenthesis
net: ll_temac: delete unnecessary else branch
net: ll_temac: fix the missing spaces around '='
net: ll_temac: move trailing statements to next line
net: ll_temac: axienet: delete unnecessary blank lines and spaces
drivers/net/ethernet/xilinx/ll_temac.h | 181 +++++++++---------
drivers/net/ethernet/xilinx/ll_temac_main.c | 65 ++++---
drivers/net/ethernet/xilinx/ll_temac_mdio.c | 6 +-
drivers/net/ethernet/xilinx/xilinx_axienet.h | 2 +-
.../net/ethernet/xilinx/xilinx_axienet_main.c | 6 +-
.../net/ethernet/xilinx/xilinx_axienet_mdio.c | 2 +-
6 files changed, 139 insertions(+), 123 deletions(-)
--
2.30.0
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH net-next 1/7] net: ll_temac: fix the format of block comments
2022-09-17 10:38 [PATCH net-next 0/7] net: ll_temac: Cleanup for clearing static warnings Haoyue Xu
@ 2022-09-17 10:38 ` Haoyue Xu
2022-09-17 10:38 ` [PATCH net-next 2/7] net: ll_temac: Cleanup for function name in a string Haoyue Xu
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Haoyue Xu @ 2022-09-17 10:38 UTC (permalink / raw)
To: davem, kuba, netdev, linux-kernel, michal.simek
Cc: huangdaode, liyangyang20, xuhaoyue1, huangjunxian6, linuxarm,
liangwenpeng
From: huangjunxian <huangjunxian6@hisilicon.com>
Cleaning some static warnings of block comments.
Signed-off-by: huangjunxian <huangjunxian6@hisilicon.com>
Signed-off-by: Haoyue Xu <xuhaoyue1@hisilicon.com>
---
drivers/net/ethernet/xilinx/ll_temac.h | 181 ++++++++++----------
drivers/net/ethernet/xilinx/ll_temac_main.c | 6 +-
drivers/net/ethernet/xilinx/ll_temac_mdio.c | 6 +-
3 files changed, 103 insertions(+), 90 deletions(-)
diff --git a/drivers/net/ethernet/xilinx/ll_temac.h b/drivers/net/ethernet/xilinx/ll_temac.h
index c6395c406418..6668d1b760d8 100644
--- a/drivers/net/ethernet/xilinx/ll_temac.h
+++ b/drivers/net/ethernet/xilinx/ll_temac.h
@@ -21,36 +21,45 @@
/* Configuration options */
/* Accept all incoming packets.
- * This option defaults to disabled (cleared) */
+ * This option defaults to disabled (cleared)
+ */
#define XTE_OPTION_PROMISC (1 << 0)
/* Jumbo frame support for Tx & Rx.
- * This option defaults to disabled (cleared) */
+ * This option defaults to disabled (cleared)
+ */
#define XTE_OPTION_JUMBO (1 << 1)
/* VLAN Rx & Tx frame support.
- * This option defaults to disabled (cleared) */
+ * This option defaults to disabled (cleared)
+ */
#define XTE_OPTION_VLAN (1 << 2)
/* Enable recognition of flow control frames on Rx
- * This option defaults to enabled (set) */
+ * This option defaults to enabled (set)
+ */
#define XTE_OPTION_FLOW_CONTROL (1 << 4)
/* Strip FCS and PAD from incoming frames.
* Note: PAD from VLAN frames is not stripped.
- * This option defaults to disabled (set) */
+ * This option defaults to disabled (set)
+ */
#define XTE_OPTION_FCS_STRIP (1 << 5)
/* Generate FCS field and add PAD automatically for outgoing frames.
- * This option defaults to enabled (set) */
+ * This option defaults to enabled (set)
+ */
#define XTE_OPTION_FCS_INSERT (1 << 6)
/* Enable Length/Type error checking for incoming frames. When this option is
-set, the MAC will filter frames that have a mismatched type/length field
-and if XTE_OPTION_REPORT_RXERR is set, the user is notified when these
-types of frames are encountered. When this option is cleared, the MAC will
-allow these types of frames to be received.
-This option defaults to enabled (set) */
+ * set, the MAC will filter frames that have a mismatched type/length field
+ * and if XTE_OPTION_REPORT_RXERR is set, the user is notified when these
+ * types of frames are encountered. When this option is cleared, the MAC will
+ * allow these types of frames to be received.
+ * This option defaults to enabled (set)
+ */
#define XTE_OPTION_LENTYPE_ERR (1 << 7)
/* Enable the transmitter.
- * This option defaults to enabled (set) */
+ * This option defaults to enabled (set)
+ */
#define XTE_OPTION_TXEN (1 << 11)
/* Enable the receiver
-* This option defaults to enabled (set) */
+ * This option defaults to enabled (set)
+ */
#define XTE_OPTION_RXEN (1 << 12)
/* Default options set when device is initialized or reset */
@@ -68,18 +77,18 @@ This option defaults to enabled (set) */
#define TX_TAILDESC_PTR 0x04 /* rw */
#define TX_CHNL_CTRL 0x05 /* rw */
/*
- 0:7 24:31 IRQTimeout
- 8:15 16:23 IRQCount
- 16:20 11:15 Reserved
- 21 10 0
- 22 9 UseIntOnEnd
- 23 8 LdIRQCnt
- 24 7 IRQEn
- 25:28 3:6 Reserved
- 29 2 IrqErrEn
- 30 1 IrqDlyEn
- 31 0 IrqCoalEn
-*/
+ * 0:7 24:31 IRQTimeout
+ * 8:15 16:23 IRQCount
+ * 16:20 11:15 Reserved
+ * 21 10 0
+ * 22 9 UseIntOnEnd
+ * 23 8 LdIRQCnt
+ * 24 7 IRQEn
+ * 25:28 3:6 Reserved
+ * 29 2 IrqErrEn
+ * 30 1 IrqDlyEn
+ * 31 0 IrqCoalEn
+ */
#define CHNL_CTRL_IRQ_IOE (1 << 9)
#define CHNL_CTRL_IRQ_EN (1 << 7)
#define CHNL_CTRL_IRQ_ERR_EN (1 << 2)
@@ -87,35 +96,35 @@ This option defaults to enabled (set) */
#define CHNL_CTRL_IRQ_COAL_EN (1 << 0)
#define TX_IRQ_REG 0x06 /* rw */
/*
- 0:7 24:31 DltTmrValue
- 8:15 16:23 ClscCntrValue
- 16:17 14:15 Reserved
- 18:21 10:13 ClscCnt
- 22:23 8:9 DlyCnt
- 24:28 3::7 Reserved
- 29 2 ErrIrq
- 30 1 DlyIrq
- 31 0 CoalIrq
+ * 0:7 24:31 DltTmrValue
+ * 8:15 16:23 ClscCntrValue
+ * 16:17 14:15 Reserved
+ * 18:21 10:13 ClscCnt
+ * 22:23 8:9 DlyCnt
+ * 24:28 3::7 Reserved
+ * 29 2 ErrIrq
+ * 30 1 DlyIrq
+ * 31 0 CoalIrq
*/
#define TX_CHNL_STS 0x07 /* r */
/*
- 0:9 22:31 Reserved
- 10 21 TailPErr
- 11 20 CmpErr
- 12 19 AddrErr
- 13 18 NxtPErr
- 14 17 CurPErr
- 15 16 BsyWr
- 16:23 8:15 Reserved
- 24 7 Error
- 25 6 IOE
- 26 5 SOE
- 27 4 Cmplt
- 28 3 SOP
- 29 2 EOP
- 30 1 EngBusy
- 31 0 Reserved
-*/
+ * 0:9 22:31 Reserved
+ * 10 21 TailPErr
+ * 11 20 CmpErr
+ * 12 19 AddrErr
+ * 13 18 NxtPErr
+ * 14 17 CurPErr
+ * 15 16 BsyWr
+ * 16:23 8:15 Reserved
+ * 24 7 Error
+ * 25 6 IOE
+ * 26 5 SOE
+ * 27 4 Cmplt
+ * 28 3 SOP
+ * 29 2 EOP
+ * 30 1 EngBusy
+ * 31 0 Reserved
+ */
#define RX_NXTDESC_PTR 0x08 /* r */
#define RX_CURBUF_ADDR 0x09 /* r */
@@ -124,17 +133,17 @@ This option defaults to enabled (set) */
#define RX_TAILDESC_PTR 0x0c /* rw */
#define RX_CHNL_CTRL 0x0d /* rw */
/*
- 0:7 24:31 IRQTimeout
- 8:15 16:23 IRQCount
- 16:20 11:15 Reserved
- 21 10 0
- 22 9 UseIntOnEnd
- 23 8 LdIRQCnt
- 24 7 IRQEn
- 25:28 3:6 Reserved
- 29 2 IrqErrEn
- 30 1 IrqDlyEn
- 31 0 IrqCoalEn
+ * 0:7 24:31 IRQTimeout
+ * 8:15 16:23 IRQCount
+ * 16:20 11:15 Reserved
+ * 21 10 0
+ * 22 9 UseIntOnEnd
+ * 23 8 LdIRQCnt
+ * 24 7 IRQEn
+ * 25:28 3:6 Reserved
+ * 29 2 IrqErrEn
+ * 30 1 IrqDlyEn
+ * 31 0 IrqCoalEn
*/
#define RX_IRQ_REG 0x0e /* rw */
#define IRQ_COAL (1 << 0)
@@ -142,13 +151,13 @@ This option defaults to enabled (set) */
#define IRQ_ERR (1 << 2)
#define IRQ_DMAERR (1 << 7) /* this is not documented ??? */
/*
- 0:7 24:31 DltTmrValue
- 8:15 16:23 ClscCntrValue
- 16:17 14:15 Reserved
- 18:21 10:13 ClscCnt
- 22:23 8:9 DlyCnt
- 24:28 3::7 Reserved
-*/
+ * 0:7 24:31 DltTmrValue
+ * 8:15 16:23 ClscCntrValue
+ * 16:17 14:15 Reserved
+ * 18:21 10:13 ClscCnt
+ * 22:23 8:9 DlyCnt
+ * 24:28 3::7 Reserved
+ */
#define RX_CHNL_STS 0x0f /* r */
#define CHNL_STS_ENGBUSY (1 << 1)
#define CHNL_STS_EOP (1 << 2)
@@ -165,23 +174,23 @@ This option defaults to enabled (set) */
#define CHNL_STS_CMPERR (1 << 20)
#define CHNL_STS_TAILERR (1 << 21)
/*
- 0:9 22:31 Reserved
- 10 21 TailPErr
- 11 20 CmpErr
- 12 19 AddrErr
- 13 18 NxtPErr
- 14 17 CurPErr
- 15 16 BsyWr
- 16:23 8:15 Reserved
- 24 7 Error
- 25 6 IOE
- 26 5 SOE
- 27 4 Cmplt
- 28 3 SOP
- 29 2 EOP
- 30 1 EngBusy
- 31 0 Reserved
-*/
+ * 0:9 22:31 Reserved
+ * 10 21 TailPErr
+ * 11 20 CmpErr
+ * 12 19 AddrErr
+ * 13 18 NxtPErr
+ * 14 17 CurPErr
+ * 15 16 BsyWr
+ * 16:23 8:15 Reserved
+ * 24 7 Error
+ * 25 6 IOE
+ * 26 5 SOE
+ * 27 4 Cmplt
+ * 28 3 SOP
+ * 29 2 EOP
+ * 30 1 EngBusy
+ * 31 0 Reserved
+ */
#define DMA_CONTROL_REG 0x10 /* rw */
#define DMA_CONTROL_RST (1 << 0)
diff --git a/drivers/net/ethernet/xilinx/ll_temac_main.c b/drivers/net/ethernet/xilinx/ll_temac_main.c
index 3f6b9dfca095..1dfbd85b848d 100644
--- a/drivers/net/ethernet/xilinx/ll_temac_main.c
+++ b/drivers/net/ethernet/xilinx/ll_temac_main.c
@@ -430,7 +430,8 @@ static void temac_do_set_mac_address(struct net_device *ndev)
(ndev->dev_addr[2] << 16) |
(ndev->dev_addr[3] << 24));
/* There are reserved bits in EUAW1
- * so don't affect them Set MAC bits [47:32] in EUAW1 */
+ * so don't affect them Set MAC bits [47:32] in EUAW1
+ */
temac_indirect_out32_locked(lp, XTE_UAW1_OFFSET,
(ndev->dev_addr[4] & 0x000000ff) |
(ndev->dev_addr[5] << 8));
@@ -691,7 +692,8 @@ static void temac_device_reset(struct net_device *ndev)
spin_unlock_irqrestore(lp->indirect_lock, flags);
/* Sync default options with HW
- * but leave receiver and transmitter disabled. */
+ * but leave receiver and transmitter disabled.
+ */
temac_setoptions(ndev,
lp->options & ~(XTE_OPTION_TXEN | XTE_OPTION_RXEN));
diff --git a/drivers/net/ethernet/xilinx/ll_temac_mdio.c b/drivers/net/ethernet/xilinx/ll_temac_mdio.c
index 6fd2dea4e60f..2371c072b53f 100644
--- a/drivers/net/ethernet/xilinx/ll_temac_mdio.c
+++ b/drivers/net/ethernet/xilinx/ll_temac_mdio.c
@@ -29,7 +29,8 @@ static int temac_mdio_read(struct mii_bus *bus, int phy_id, int reg)
/* Write the PHY address to the MIIM Access Initiator register.
* When the transfer completes, the PHY register value will appear
- * in the LSW0 register */
+ * in the LSW0 register
+ */
spin_lock_irqsave(lp->indirect_lock, flags);
temac_iow(lp, XTE_LSW0_OFFSET, (phy_id << 5) | reg);
rc = temac_indirect_in32_locked(lp, XTE_MIIMAI_OFFSET);
@@ -88,7 +89,8 @@ int temac_mdio_setup(struct temac_local *lp, struct platform_device *pdev)
}
/* Enable the MDIO bus by asserting the enable bit and writing
- * in the clock config */
+ * in the clock config
+ */
temac_indirect_out32(lp, XTE_MC_OFFSET, 1 << 6 | clk_div);
bus = devm_mdiobus_alloc(&pdev->dev);
--
2.30.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH net-next 2/7] net: ll_temac: Cleanup for function name in a string
2022-09-17 10:38 [PATCH net-next 0/7] net: ll_temac: Cleanup for clearing static warnings Haoyue Xu
2022-09-17 10:38 ` [PATCH net-next 1/7] net: ll_temac: fix the format of block comments Haoyue Xu
@ 2022-09-17 10:38 ` Haoyue Xu
2022-09-17 10:38 ` [PATCH net-next 3/7] net: ll_temac: axienet: align with open parenthesis Haoyue Xu
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Haoyue Xu @ 2022-09-17 10:38 UTC (permalink / raw)
To: davem, kuba, netdev, linux-kernel, michal.simek
Cc: huangdaode, liyangyang20, xuhaoyue1, huangjunxian6, linuxarm,
liangwenpeng
As Checkpatch.pl warns, prefer using '"%s...", __func__'
to using 'temac_device_reset', this function's name, in a string.
Signed-off-by: Haoyue Xu <xuhaoyue1@hisilicon.com>
---
drivers/net/ethernet/xilinx/ll_temac_main.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/xilinx/ll_temac_main.c b/drivers/net/ethernet/xilinx/ll_temac_main.c
index 1dfbd85b848d..26fbe60e2cf4 100644
--- a/drivers/net/ethernet/xilinx/ll_temac_main.c
+++ b/drivers/net/ethernet/xilinx/ll_temac_main.c
@@ -642,7 +642,7 @@ static void temac_device_reset(struct net_device *ndev)
udelay(1);
if (--timeout == 0) {
dev_err(&ndev->dev,
- "temac_device_reset RX reset timeout!!\n");
+ "%s RX reset timeout!!\n", __func__);
break;
}
}
@@ -654,7 +654,7 @@ static void temac_device_reset(struct net_device *ndev)
udelay(1);
if (--timeout == 0) {
dev_err(&ndev->dev,
- "temac_device_reset TX reset timeout!!\n");
+ "%s TX reset timeout!!\n", __func__);
break;
}
}
@@ -673,7 +673,7 @@ static void temac_device_reset(struct net_device *ndev)
udelay(1);
if (--timeout == 0) {
dev_err(&ndev->dev,
- "temac_device_reset DMA reset timeout!!\n");
+ "%s DMA reset timeout!!\n", __func__);
break;
}
}
@@ -681,7 +681,8 @@ static void temac_device_reset(struct net_device *ndev)
if (temac_dma_bd_init(ndev)) {
dev_err(&ndev->dev,
- "temac_device_reset descriptor allocation failed\n");
+ "%s descriptor allocation failed\n", __func__);
+
}
spin_lock_irqsave(lp->indirect_lock, flags);
--
2.30.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH net-next 3/7] net: ll_temac: axienet: align with open parenthesis
2022-09-17 10:38 [PATCH net-next 0/7] net: ll_temac: Cleanup for clearing static warnings Haoyue Xu
2022-09-17 10:38 ` [PATCH net-next 1/7] net: ll_temac: fix the format of block comments Haoyue Xu
2022-09-17 10:38 ` [PATCH net-next 2/7] net: ll_temac: Cleanup for function name in a string Haoyue Xu
@ 2022-09-17 10:38 ` Haoyue Xu
2022-09-17 10:38 ` [PATCH net-next 4/7] net: ll_temac: delete unnecessary else branch Haoyue Xu
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Haoyue Xu @ 2022-09-17 10:38 UTC (permalink / raw)
To: davem, kuba, netdev, linux-kernel, michal.simek
Cc: huangdaode, liyangyang20, xuhaoyue1, huangjunxian6, linuxarm,
liangwenpeng
From: huangjunxian <huangjunxian6@hisilicon.com>
Cleaning some static warnings of open parenthesis.
Signed-off-by: huangjunxian <huangjunxian6@hisilicon.com>
Signed-off-by: Haoyue Xu <xuhaoyue1@hisilicon.com>
---
drivers/net/ethernet/xilinx/ll_temac_main.c | 7 +++----
drivers/net/ethernet/xilinx/xilinx_axienet.h | 2 +-
drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 2 +-
3 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/xilinx/ll_temac_main.c b/drivers/net/ethernet/xilinx/ll_temac_main.c
index 26fbe60e2cf4..562b461224e7 100644
--- a/drivers/net/ethernet/xilinx/ll_temac_main.c
+++ b/drivers/net/ethernet/xilinx/ll_temac_main.c
@@ -261,7 +261,7 @@ static void temac_dma_dcr_out(struct temac_local *lp, int reg, u32 value)
* I/O functions
*/
static int temac_dcr_setup(struct temac_local *lp, struct platform_device *op,
- struct device_node *np)
+ struct device_node *np)
{
unsigned int dcrs;
@@ -286,7 +286,7 @@ static int temac_dcr_setup(struct temac_local *lp, struct platform_device *op,
* such as with MicroBlaze and x86
*/
static int temac_dcr_setup(struct temac_local *lp, struct platform_device *op,
- struct device_node *np)
+ struct device_node *np)
{
return -1;
}
@@ -309,7 +309,7 @@ static void temac_dma_bd_release(struct net_device *ndev)
break;
else {
dma_unmap_single(ndev->dev.parent, lp->rx_bd_v[i].phys,
- XTE_MAX_JUMBO_FRAME_SIZE, DMA_FROM_DEVICE);
+ XTE_MAX_JUMBO_FRAME_SIZE, DMA_FROM_DEVICE);
dev_kfree_skb(lp->rx_skb[i]);
}
}
@@ -682,7 +682,6 @@ static void temac_device_reset(struct net_device *ndev)
if (temac_dma_bd_init(ndev)) {
dev_err(&ndev->dev,
"%s descriptor allocation failed\n", __func__);
-
}
spin_lock_irqsave(lp->indirect_lock, flags);
diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet.h b/drivers/net/ethernet/xilinx/xilinx_axienet.h
index 8ff4333de2ad..6370c447ac5c 100644
--- a/drivers/net/ethernet/xilinx/xilinx_axienet.h
+++ b/drivers/net/ethernet/xilinx/xilinx_axienet.h
@@ -603,7 +603,7 @@ static inline void axienet_dma_out_addr(struct axienet_local *lp, off_t reg,
#else /* CONFIG_64BIT */
static inline void axienet_dma_out_addr(struct axienet_local *lp, off_t reg,
- dma_addr_t addr)
+ dma_addr_t addr)
{
axienet_dma_out32(lp, reg, lower_32_bits(addr));
}
diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
index 9fde5941a469..15d1c8158f31 100644
--- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
+++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
@@ -597,7 +597,7 @@ static int axienet_device_reset(struct net_device *ndev)
lp->options &= (~XAE_OPTION_JUMBO);
if ((ndev->mtu > XAE_MTU) &&
- (ndev->mtu <= XAE_JUMBO_MTU)) {
+ (ndev->mtu <= XAE_JUMBO_MTU)) {
lp->max_frm_size = ndev->mtu + VLAN_ETH_HLEN +
XAE_TRL_SIZE;
--
2.30.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH net-next 4/7] net: ll_temac: delete unnecessary else branch
2022-09-17 10:38 [PATCH net-next 0/7] net: ll_temac: Cleanup for clearing static warnings Haoyue Xu
` (2 preceding siblings ...)
2022-09-17 10:38 ` [PATCH net-next 3/7] net: ll_temac: axienet: align with open parenthesis Haoyue Xu
@ 2022-09-17 10:38 ` Haoyue Xu
2022-09-17 10:38 ` [PATCH net-next 5/7] net: ll_temac: fix the missing spaces around '=' Haoyue Xu
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Haoyue Xu @ 2022-09-17 10:38 UTC (permalink / raw)
To: davem, kuba, netdev, linux-kernel, michal.simek
Cc: huangdaode, liyangyang20, xuhaoyue1, huangjunxian6, linuxarm,
liangwenpeng
From: huangjunxian <huangjunxian6@hisilicon.com>
Cleaning some static warnings of unnecessary else branch.
Signed-off-by: huangjunxian <huangjunxian6@hisilicon.com>
Signed-off-by: Haoyue Xu <xuhaoyue1@hisilicon.com>
---
drivers/net/ethernet/xilinx/ll_temac_main.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/xilinx/ll_temac_main.c b/drivers/net/ethernet/xilinx/ll_temac_main.c
index 562b461224e7..15d7b7ed0830 100644
--- a/drivers/net/ethernet/xilinx/ll_temac_main.c
+++ b/drivers/net/ethernet/xilinx/ll_temac_main.c
@@ -117,8 +117,8 @@ int temac_indirect_busywait(struct temac_local *lp)
spin_until_cond(hard_acs_rdy_or_timeout(lp, timeout));
if (WARN_ON(!hard_acs_rdy(lp)))
return -ETIMEDOUT;
- else
- return 0;
+
+ return 0;
}
/*
@@ -307,11 +307,9 @@ static void temac_dma_bd_release(struct net_device *ndev)
for (i = 0; i < lp->rx_bd_num; i++) {
if (!lp->rx_skb[i])
break;
- else {
- dma_unmap_single(ndev->dev.parent, lp->rx_bd_v[i].phys,
- XTE_MAX_JUMBO_FRAME_SIZE, DMA_FROM_DEVICE);
- dev_kfree_skb(lp->rx_skb[i]);
- }
+ dma_unmap_single(ndev->dev.parent, lp->rx_bd_v[i].phys,
+ XTE_MAX_JUMBO_FRAME_SIZE, DMA_FROM_DEVICE);
+ dev_kfree_skb(lp->rx_skb[i]);
}
if (lp->rx_bd_v)
dma_free_coherent(ndev->dev.parent,
--
2.30.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH net-next 5/7] net: ll_temac: fix the missing spaces around '='
2022-09-17 10:38 [PATCH net-next 0/7] net: ll_temac: Cleanup for clearing static warnings Haoyue Xu
` (3 preceding siblings ...)
2022-09-17 10:38 ` [PATCH net-next 4/7] net: ll_temac: delete unnecessary else branch Haoyue Xu
@ 2022-09-17 10:38 ` Haoyue Xu
2022-09-17 10:38 ` [PATCH net-next 6/7] net: ll_temac: move trailing statements to next line Haoyue Xu
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Haoyue Xu @ 2022-09-17 10:38 UTC (permalink / raw)
To: davem, kuba, netdev, linux-kernel, michal.simek
Cc: huangdaode, liyangyang20, xuhaoyue1, huangjunxian6, linuxarm,
liangwenpeng
From: huangjunxian <huangjunxian6@hisilicon.com>
Cleaning some static warnings of missing spaces around '='.
Signed-off-by: huangjunxian <huangjunxian6@hisilicon.com>
Signed-off-by: Haoyue Xu <xuhaoyue1@hisilicon.com>
---
drivers/net/ethernet/xilinx/ll_temac_main.c | 22 ++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/net/ethernet/xilinx/ll_temac_main.c b/drivers/net/ethernet/xilinx/ll_temac_main.c
index 15d7b7ed0830..256cb294f0b7 100644
--- a/drivers/net/ethernet/xilinx/ll_temac_main.c
+++ b/drivers/net/ethernet/xilinx/ll_temac_main.c
@@ -529,66 +529,66 @@ static struct temac_option {
{
.opt = XTE_OPTION_JUMBO,
.reg = XTE_RXC1_OFFSET,
- .m_or =XTE_RXC1_RXJMBO_MASK,
+ .m_or = XTE_RXC1_RXJMBO_MASK,
},
/* Turn on VLAN packet support for both Rx and Tx */
{
.opt = XTE_OPTION_VLAN,
.reg = XTE_TXC_OFFSET,
- .m_or =XTE_TXC_TXVLAN_MASK,
+ .m_or = XTE_TXC_TXVLAN_MASK,
},
{
.opt = XTE_OPTION_VLAN,
.reg = XTE_RXC1_OFFSET,
- .m_or =XTE_RXC1_RXVLAN_MASK,
+ .m_or = XTE_RXC1_RXVLAN_MASK,
},
/* Turn on FCS stripping on receive packets */
{
.opt = XTE_OPTION_FCS_STRIP,
.reg = XTE_RXC1_OFFSET,
- .m_or =XTE_RXC1_RXFCS_MASK,
+ .m_or = XTE_RXC1_RXFCS_MASK,
},
/* Turn on FCS insertion on transmit packets */
{
.opt = XTE_OPTION_FCS_INSERT,
.reg = XTE_TXC_OFFSET,
- .m_or =XTE_TXC_TXFCS_MASK,
+ .m_or = XTE_TXC_TXFCS_MASK,
},
/* Turn on length/type field checking on receive packets */
{
.opt = XTE_OPTION_LENTYPE_ERR,
.reg = XTE_RXC1_OFFSET,
- .m_or =XTE_RXC1_RXLT_MASK,
+ .m_or = XTE_RXC1_RXLT_MASK,
},
/* Turn on flow control */
{
.opt = XTE_OPTION_FLOW_CONTROL,
.reg = XTE_FCC_OFFSET,
- .m_or =XTE_FCC_RXFLO_MASK,
+ .m_or = XTE_FCC_RXFLO_MASK,
},
/* Turn on flow control */
{
.opt = XTE_OPTION_FLOW_CONTROL,
.reg = XTE_FCC_OFFSET,
- .m_or =XTE_FCC_TXFLO_MASK,
+ .m_or = XTE_FCC_TXFLO_MASK,
},
/* Turn on promiscuous frame filtering (all frames are received ) */
{
.opt = XTE_OPTION_PROMISC,
.reg = XTE_AFM_OFFSET,
- .m_or =XTE_AFM_EPPRM_MASK,
+ .m_or = XTE_AFM_EPPRM_MASK,
},
/* Enable transmitter if not already enabled */
{
.opt = XTE_OPTION_TXEN,
.reg = XTE_TXC_OFFSET,
- .m_or =XTE_TXC_TXEN_MASK,
+ .m_or = XTE_TXC_TXEN_MASK,
},
/* Enable receiver? */
{
.opt = XTE_OPTION_RXEN,
.reg = XTE_RXC1_OFFSET,
- .m_or =XTE_RXC1_RXEN_MASK,
+ .m_or = XTE_RXC1_RXEN_MASK,
},
{}
};
--
2.30.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH net-next 6/7] net: ll_temac: move trailing statements to next line
2022-09-17 10:38 [PATCH net-next 0/7] net: ll_temac: Cleanup for clearing static warnings Haoyue Xu
` (4 preceding siblings ...)
2022-09-17 10:38 ` [PATCH net-next 5/7] net: ll_temac: fix the missing spaces around '=' Haoyue Xu
@ 2022-09-17 10:38 ` Haoyue Xu
2022-09-17 10:38 ` [PATCH net-next 7/7] net: ll_temac: axienet: delete unnecessary blank lines and spaces Haoyue Xu
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Haoyue Xu @ 2022-09-17 10:38 UTC (permalink / raw)
To: davem, kuba, netdev, linux-kernel, michal.simek
Cc: huangdaode, liyangyang20, xuhaoyue1, huangjunxian6, linuxarm,
liangwenpeng
From: huangjunxian <huangjunxian6@hisilicon.com>
Cleaning some static warnings of trailing statements.
Signed-off-by: huangjunxian <huangjunxian6@hisilicon.com>
Signed-off-by: Haoyue Xu <xuhaoyue1@hisilicon.com>
---
drivers/net/ethernet/xilinx/ll_temac_main.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/xilinx/ll_temac_main.c b/drivers/net/ethernet/xilinx/ll_temac_main.c
index 256cb294f0b7..244070f0cd2a 100644
--- a/drivers/net/ethernet/xilinx/ll_temac_main.c
+++ b/drivers/net/ethernet/xilinx/ll_temac_main.c
@@ -723,9 +723,15 @@ static void temac_adjust_link(struct net_device *ndev)
mii_speed &= ~XTE_EMCFG_LINKSPD_MASK;
switch (phy->speed) {
- case SPEED_1000: mii_speed |= XTE_EMCFG_LINKSPD_1000; break;
- case SPEED_100: mii_speed |= XTE_EMCFG_LINKSPD_100; break;
- case SPEED_10: mii_speed |= XTE_EMCFG_LINKSPD_10; break;
+ case SPEED_1000:
+ mii_speed |= XTE_EMCFG_LINKSPD_1000;
+ break;
+ case SPEED_100:
+ mii_speed |= XTE_EMCFG_LINKSPD_100;
+ break;
+ case SPEED_10:
+ mii_speed |= XTE_EMCFG_LINKSPD_10;
+ break;
}
/* Write new speed setting out to TEMAC */
--
2.30.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH net-next 7/7] net: ll_temac: axienet: delete unnecessary blank lines and spaces
2022-09-17 10:38 [PATCH net-next 0/7] net: ll_temac: Cleanup for clearing static warnings Haoyue Xu
` (5 preceding siblings ...)
2022-09-17 10:38 ` [PATCH net-next 6/7] net: ll_temac: move trailing statements to next line Haoyue Xu
@ 2022-09-17 10:38 ` Haoyue Xu
2022-09-20 5:30 ` [PATCH net-next 0/7] net: ll_temac: Cleanup for clearing static warnings Harini Katakam
2022-09-22 1:40 ` patchwork-bot+netdevbpf
8 siblings, 0 replies; 10+ messages in thread
From: Haoyue Xu @ 2022-09-17 10:38 UTC (permalink / raw)
To: davem, kuba, netdev, linux-kernel, michal.simek
Cc: huangdaode, liyangyang20, xuhaoyue1, huangjunxian6, linuxarm,
liangwenpeng
From: huangjunxian <huangjunxian6@hisilicon.com>
Cleaning some static warnings of indent.
Signed-off-by: huangjunxian <huangjunxian6@hisilicon.com>
Signed-off-by: Haoyue Xu <xuhaoyue1@hisilicon.com>
---
drivers/net/ethernet/xilinx/ll_temac_main.c | 1 -
drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 4 ++--
drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c | 2 +-
3 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/xilinx/ll_temac_main.c b/drivers/net/ethernet/xilinx/ll_temac_main.c
index 244070f0cd2a..a74e8872a71e 100644
--- a/drivers/net/ethernet/xilinx/ll_temac_main.c
+++ b/drivers/net/ethernet/xilinx/ll_temac_main.c
@@ -1013,7 +1013,6 @@ static void ll_temac_recv(struct net_device *ndev)
if (((lp->temac_features & TEMAC_FEATURE_RX_CSUM) != 0) &&
(skb->protocol == htons(ETH_P_IP)) &&
(skb->len > 64)) {
-
/* Convert from device endianness (be32) to cpu
* endianness, and if necessary swap the bytes
* (back) for proper IP checksum byte order
diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
index 15d1c8158f31..40581f40716a 100644
--- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
+++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
@@ -645,7 +645,7 @@ static int axienet_device_reset(struct net_device *ndev)
* @nr_bds: Max number of descriptors to clean up
* @force: Whether to clean descriptors even if not complete
* @sizep: Pointer to a u32 filled with the total sum of all bytes
- * in all cleaned-up descriptors. Ignored if NULL.
+ * in all cleaned-up descriptors. Ignored if NULL.
* @budget: NAPI budget (use 0 when not called from NAPI poll)
*
* Would either be called after a successful transmit operation, or after
@@ -1375,7 +1375,7 @@ static int axienet_ethtools_get_regs_len(struct net_device *ndev)
static void axienet_ethtools_get_regs(struct net_device *ndev,
struct ethtool_regs *regs, void *ret)
{
- u32 *data = (u32 *) ret;
+ u32 *data = (u32 *)ret;
size_t len = sizeof(u32) * AXIENET_REGS_N;
struct axienet_local *lp = netdev_priv(ndev);
diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c b/drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c
index 2772a79cd3ed..0b3b6935c558 100644
--- a/drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c
+++ b/drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c
@@ -126,7 +126,7 @@ static int axienet_mdio_write(struct mii_bus *bus, int phy_id, int reg,
return ret;
}
- axienet_iow(lp, XAE_MDIO_MWD_OFFSET, (u32) val);
+ axienet_iow(lp, XAE_MDIO_MWD_OFFSET, (u32)val);
axienet_iow(lp, XAE_MDIO_MCR_OFFSET,
(((phy_id << XAE_MDIO_MCR_PHYAD_SHIFT) &
XAE_MDIO_MCR_PHYAD_MASK) |
--
2.30.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH net-next 0/7] net: ll_temac: Cleanup for clearing static warnings
2022-09-17 10:38 [PATCH net-next 0/7] net: ll_temac: Cleanup for clearing static warnings Haoyue Xu
` (6 preceding siblings ...)
2022-09-17 10:38 ` [PATCH net-next 7/7] net: ll_temac: axienet: delete unnecessary blank lines and spaces Haoyue Xu
@ 2022-09-20 5:30 ` Harini Katakam
2022-09-22 1:40 ` patchwork-bot+netdevbpf
8 siblings, 0 replies; 10+ messages in thread
From: Harini Katakam @ 2022-09-20 5:30 UTC (permalink / raw)
To: Haoyue Xu
Cc: davem, kuba, netdev, linux-kernel, michal.simek, huangdaode,
liyangyang20, huangjunxian6, linuxarm, liangwenpeng
On Sat, Sep 17, 2022 at 4:10 PM Haoyue Xu <xuhaoyue1@hisilicon.com> wrote:
>
> Most static warnings are detected by Checkpatch.pl, mainly about:
> (1) #1: About the comments.
> (2) #2: About function name in a string.
> (3) #3: About the open parenthesis.
> (4) #4: About the else branch.
> (6) #6: About trailing statements.
> (7) #5,#7: About blank lines and spaces.
Thank you. For the series:
Reviewed-by: Harini Katakam <harini.katakam@amd.com>
Regards,
Harini
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH net-next 0/7] net: ll_temac: Cleanup for clearing static warnings
2022-09-17 10:38 [PATCH net-next 0/7] net: ll_temac: Cleanup for clearing static warnings Haoyue Xu
` (7 preceding siblings ...)
2022-09-20 5:30 ` [PATCH net-next 0/7] net: ll_temac: Cleanup for clearing static warnings Harini Katakam
@ 2022-09-22 1:40 ` patchwork-bot+netdevbpf
8 siblings, 0 replies; 10+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-09-22 1:40 UTC (permalink / raw)
To: Haoyue Xu
Cc: davem, kuba, netdev, linux-kernel, michal.simek, huangdaode,
liyangyang20, huangjunxian6, linuxarm, liangwenpeng
Hello:
This series was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:
On Sat, 17 Sep 2022 18:38:36 +0800 you wrote:
> Most static warnings are detected by Checkpatch.pl, mainly about:
> (1) #1: About the comments.
> (2) #2: About function name in a string.
> (3) #3: About the open parenthesis.
> (4) #4: About the else branch.
> (6) #6: About trailing statements.
> (7) #5,#7: About blank lines and spaces.
>
> [...]
Here is the summary with links:
- [net-next,1/7] net: ll_temac: fix the format of block comments
https://git.kernel.org/netdev/net-next/c/75124116520b
- [net-next,2/7] net: ll_temac: Cleanup for function name in a string
https://git.kernel.org/netdev/net-next/c/653de988eb58
- [net-next,3/7] net: ll_temac: axienet: align with open parenthesis
https://git.kernel.org/netdev/net-next/c/42f5d4d0e0d9
- [net-next,4/7] net: ll_temac: delete unnecessary else branch
https://git.kernel.org/netdev/net-next/c/7dfd0dcc5e72
- [net-next,5/7] net: ll_temac: fix the missing spaces around '='
https://git.kernel.org/netdev/net-next/c/a9f1ef7034b8
- [net-next,6/7] net: ll_temac: move trailing statements to next line
https://git.kernel.org/netdev/net-next/c/a0a850976801
- [net-next,7/7] net: ll_temac: axienet: delete unnecessary blank lines and spaces
https://git.kernel.org/netdev/net-next/c/7fe85bb3af4e
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] 10+ messages in thread
end of thread, other threads:[~2022-09-22 1:40 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-17 10:38 [PATCH net-next 0/7] net: ll_temac: Cleanup for clearing static warnings Haoyue Xu
2022-09-17 10:38 ` [PATCH net-next 1/7] net: ll_temac: fix the format of block comments Haoyue Xu
2022-09-17 10:38 ` [PATCH net-next 2/7] net: ll_temac: Cleanup for function name in a string Haoyue Xu
2022-09-17 10:38 ` [PATCH net-next 3/7] net: ll_temac: axienet: align with open parenthesis Haoyue Xu
2022-09-17 10:38 ` [PATCH net-next 4/7] net: ll_temac: delete unnecessary else branch Haoyue Xu
2022-09-17 10:38 ` [PATCH net-next 5/7] net: ll_temac: fix the missing spaces around '=' Haoyue Xu
2022-09-17 10:38 ` [PATCH net-next 6/7] net: ll_temac: move trailing statements to next line Haoyue Xu
2022-09-17 10:38 ` [PATCH net-next 7/7] net: ll_temac: axienet: delete unnecessary blank lines and spaces Haoyue Xu
2022-09-20 5:30 ` [PATCH net-next 0/7] net: ll_temac: Cleanup for clearing static warnings Harini Katakam
2022-09-22 1:40 ` patchwork-bot+netdevbpf
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.