2022-09-07 06:54:33

by xuhaoyue (A)

[permalink] [raw]
Subject: [PATCH net-next 0/3] net: amd: Cleanup for clearing static warnings

Most static warnings are detected by tools, mainly about:

(1) #1: About the if stament.
(2) #2: About the spelling.
(2) #3: About the indent.

Guofeng Yue (3):
net: amd: Unified the comparison between pointers and NULL to the same
writing
net: amd: Correct spelling errors
net: amd: Switch and case should be at the same indent

drivers/net/ethernet/amd/a2065.c | 2 +-
drivers/net/ethernet/amd/amd8111e.c | 45 +++++++++++++--------------
drivers/net/ethernet/amd/amd8111e.h | 2 +-
drivers/net/ethernet/amd/ariadne.c | 4 +--
drivers/net/ethernet/amd/atarilance.c | 10 +++---
drivers/net/ethernet/amd/au1000_eth.c | 6 ++--
drivers/net/ethernet/amd/lance.c | 4 +--
drivers/net/ethernet/amd/nmclan_cs.c | 18 +++++------
drivers/net/ethernet/amd/pcnet32.c | 12 +++----
drivers/net/ethernet/amd/sun3lance.c | 4 +--
drivers/net/ethernet/amd/sunlance.c | 4 +--
11 files changed, 55 insertions(+), 56 deletions(-)

--
2.30.0


2022-09-07 06:55:03

by xuhaoyue (A)

[permalink] [raw]
Subject: [PATCH net-next 3/3] net: amd: Switch and case should be at the same indent

From: Guofeng Yue <[email protected]>

Cleaning some static warnings of indent.

Signed-off-by: Guofeng Yue <[email protected]>
Signed-off-by: Haoyue Xu <[email protected]>
---
drivers/net/ethernet/amd/amd8111e.c | 35 +++++++++++++--------------
drivers/net/ethernet/amd/atarilance.c | 6 ++---
drivers/net/ethernet/amd/nmclan_cs.c | 14 +++++------
3 files changed, 27 insertions(+), 28 deletions(-)

diff --git a/drivers/net/ethernet/amd/amd8111e.c b/drivers/net/ethernet/amd/amd8111e.c
index 7b4d9bbb079c..ea6cfc2095e1 100644
--- a/drivers/net/ethernet/amd/amd8111e.c
+++ b/drivers/net/ethernet/amd/amd8111e.c
@@ -185,24 +185,23 @@ static void amd8111e_set_ext_phy(struct net_device *dev)
advert = amd8111e_mdio_read(dev, lp->ext_phy_addr, MII_ADVERTISE);
tmp = advert & ~(ADVERTISE_ALL | ADVERTISE_100BASE4);
switch (lp->ext_phy_option) {
-
- default:
- case SPEED_AUTONEG: /* advertise all values */
- tmp |= (ADVERTISE_10HALF | ADVERTISE_10FULL |
- ADVERTISE_100HALF | ADVERTISE_100FULL);
- break;
- case SPEED10_HALF:
- tmp |= ADVERTISE_10HALF;
- break;
- case SPEED10_FULL:
- tmp |= ADVERTISE_10FULL;
- break;
- case SPEED100_HALF:
- tmp |= ADVERTISE_100HALF;
- break;
- case SPEED100_FULL:
- tmp |= ADVERTISE_100FULL;
- break;
+ default:
+ case SPEED_AUTONEG: /* advertise all values */
+ tmp |= (ADVERTISE_10HALF | ADVERTISE_10FULL |
+ ADVERTISE_100HALF | ADVERTISE_100FULL);
+ break;
+ case SPEED10_HALF:
+ tmp |= ADVERTISE_10HALF;
+ break;
+ case SPEED10_FULL:
+ tmp |= ADVERTISE_10FULL;
+ break;
+ case SPEED100_HALF:
+ tmp |= ADVERTISE_100HALF;
+ break;
+ case SPEED100_FULL:
+ tmp |= ADVERTISE_100FULL;
+ break;
}

if(advert != tmp)
diff --git a/drivers/net/ethernet/amd/atarilance.c b/drivers/net/ethernet/amd/atarilance.c
index e5c6d99957cd..3222c48ce6ae 100644
--- a/drivers/net/ethernet/amd/atarilance.c
+++ b/drivers/net/ethernet/amd/atarilance.c
@@ -581,15 +581,15 @@ static unsigned long __init lance_probe1( struct net_device *dev,

/* Get the ethernet address */
switch( lp->cardtype ) {
- case OLD_RIEBL:
+ case OLD_RIEBL:
/* No ethernet address! (Set some default address) */
eth_hw_addr_set(dev, OldRieblDefHwaddr);
break;
- case NEW_RIEBL:
+ case NEW_RIEBL:
lp->memcpy_f(addr, RIEBL_HWADDR_ADDR, ETH_ALEN);
eth_hw_addr_set(dev, addr);
break;
- case PAM_CARD:
+ case PAM_CARD:
i = IO->eeprom;
for( i = 0; i < 6; ++i )
addr[i] =
diff --git a/drivers/net/ethernet/amd/nmclan_cs.c b/drivers/net/ethernet/amd/nmclan_cs.c
index 684b412c77fd..823a329a921f 100644
--- a/drivers/net/ethernet/amd/nmclan_cs.c
+++ b/drivers/net/ethernet/amd/nmclan_cs.c
@@ -485,10 +485,10 @@ static int mace_read(mace_private *lp, unsigned int ioaddr, int reg)
unsigned long flags;

switch (reg >> 4) {
- case 0: /* register 0-15 */
+ case 0: /* register 0-15 */
data = inb(ioaddr + AM2150_MACE_BASE + reg);
break;
- case 1: /* register 16-31 */
+ case 1: /* register 16-31 */
spin_lock_irqsave(&lp->bank_lock, flags);
MACEBANK(1);
data = inb(ioaddr + AM2150_MACE_BASE + (reg & 0x0F));
@@ -512,10 +512,10 @@ static void mace_write(mace_private *lp, unsigned int ioaddr, int reg,
unsigned long flags;

switch (reg >> 4) {
- case 0: /* register 0-15 */
+ case 0: /* register 0-15 */
outb(data & 0xFF, ioaddr + AM2150_MACE_BASE + reg);
break;
- case 1: /* register 16-31 */
+ case 1: /* register 16-31 */
spin_lock_irqsave(&lp->bank_lock, flags);
MACEBANK(1);
outb(data & 0xFF, ioaddr + AM2150_MACE_BASE + (reg & 0x0F));
@@ -567,13 +567,13 @@ static int mace_init(mace_private *lp, unsigned int ioaddr,
* Or just set ASEL in PHYCC below!
*/
switch (if_port) {
- case 1:
+ case 1:
mace_write(lp, ioaddr, MACE_PLSCC, 0x02);
break;
- case 2:
+ case 2:
mace_write(lp, ioaddr, MACE_PLSCC, 0x00);
break;
- default:
+ default:
mace_write(lp, ioaddr, MACE_PHYCC, /* ASEL */ 4);
/* ASEL Auto Select. When set, the PORTSEL[1-0] bits are overridden,
and the MACE device will automatically select the operating media
--
2.30.0

2022-09-07 06:57:08

by xuhaoyue (A)

[permalink] [raw]
Subject: [PATCH net-next 2/3] net: amd: Correct spelling errors

From: Guofeng Yue <[email protected]>

Find some spelling errors:

interupts --> interrupts
lenth --> length
stoped --> stopped
contoller --> controller

Signed-off-by: Guofeng Yue <[email protected]>
Signed-off-by: Haoyue Xu <[email protected]>
---
drivers/net/ethernet/amd/amd8111e.c | 6 +++---
drivers/net/ethernet/amd/amd8111e.h | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/amd/amd8111e.c b/drivers/net/ethernet/amd/amd8111e.c
index aaa527dc1b6f..7b4d9bbb079c 100644
--- a/drivers/net/ethernet/amd/amd8111e.c
+++ b/drivers/net/ethernet/amd/amd8111e.c
@@ -43,7 +43,7 @@ Revision History:
3.0.4 12/09/2003
1. Added set_mac_address routine for bonding driver support.
2. Tested the driver for bonding support
- 3. Bug fix: Fixed mismach in actual receive buffer lenth and lenth
+ 3. Bug fix: Fixed mismach in actual receive buffer length and length
indicated to the h/w.
4. Modified amd8111e_rx() routine to receive all the received packets
in the first interrupt.
@@ -1109,7 +1109,7 @@ static irqreturn_t amd8111e_interrupt(int irq, void *dev_id)
/* Check if Receive Interrupt has occurred. */
if (intr0 & RINT0) {
if (napi_schedule_prep(&lp->napi)) {
- /* Disable receive interupts */
+ /* Disable receive interrupts */
writel(RINTEN0, mmio + INTEN0);
/* Schedule a polling routine */
__napi_schedule(&lp->napi);
@@ -1554,7 +1554,7 @@ static int amd8111e_enable_magicpkt(struct amd8111e_priv *lp)
static int amd8111e_enable_link_change(struct amd8111e_priv *lp)
{

- /* Adapter is already stoped/suspended/interrupt-disabled */
+ /* Adapter is already stopped/suspended/interrupt-disabled */
writel(VAL0 | LCMODE_SW, lp->mmio + CMD7);

/* To eliminate PCI posting bug */
diff --git a/drivers/net/ethernet/amd/amd8111e.h b/drivers/net/ethernet/amd/amd8111e.h
index 37da79da5f5e..9d570adb295b 100644
--- a/drivers/net/ethernet/amd/amd8111e.h
+++ b/drivers/net/ethernet/amd/amd8111e.h
@@ -600,7 +600,7 @@ typedef enum {
#define CSTATE 1
#define SSTATE 2

-/* Assume contoller gets data 10 times the maximum processing time */
+/* Assume controller gets data 10 times the maximum processing time */
#define REPEAT_CNT 10

/* amd8111e descriptor flag definitions */
--
2.30.0

2022-09-16 10:22:04

by patchwork-bot+netdevbpf

[permalink] [raw]
Subject: Re: [PATCH net-next 0/3] net: amd: Cleanup for clearing static warnings

Hello:

This series was applied to netdev/net-next.git (master)
by David S. Miller <[email protected]>:

On Wed, 7 Sep 2022 14:28:09 +0800 you wrote:
> Most static warnings are detected by tools, mainly about:
>
> (1) #1: About the if stament.
> (2) #2: About the spelling.
> (2) #3: About the indent.
>
> Guofeng Yue (3):
> net: amd: Unified the comparison between pointers and NULL to the same
> writing
> net: amd: Correct spelling errors
> net: amd: Switch and case should be at the same indent
>
> [...]

Here is the summary with links:
- [net-next,1/3] net: amd: Unified the comparison between pointers and NULL to the same writing
https://git.kernel.org/netdev/net-next/c/b0b815a356aa
- [net-next,2/3] net: amd: Correct spelling errors
https://git.kernel.org/netdev/net-next/c/7c13f4426b0e
- [net-next,3/3] net: amd: Switch and case should be at the same indent
https://git.kernel.org/netdev/net-next/c/78923e8ae427

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