From: Weihang Li <hidden> Date: 2021-06-16 10:04:44
Make some cleanups according to the coding style of kernel.
Changes since v1:
- Update commit description of #1 and #3.
- Avoid changing the indentation in #2.
- Change a group of if-else statement into switch from #4 and put it into
a single patch.
- Put '|' at the end of line in #5 and #7.
- Avoid deleting spaces in definition of 'settings' in #5.
- Drop #8 from the series which needs more discussion with David.
Weihang Li (1):
net: phy: replace if-else statements with switch
Wenpeng Liang (7):
net: phy: change format of some declarations
net: phy: correct format of block comments
net: phy: delete repeated words of comments
net: phy: fix space alignment issues
net: phy: fix formatting issues with braces
net: phy: print the function name by __func__ instead of an fixed
string
net: phy: remove unnecessary line continuation
drivers/net/phy/bcm87xx.c | 4 ++--
drivers/net/phy/davicom.c | 6 +++---
drivers/net/phy/dp83640.c | 5 +++--
drivers/net/phy/et1011c.c | 15 ++++++++-------
drivers/net/phy/fixed_phy.c | 4 ++--
drivers/net/phy/lxt.c | 4 ++--
drivers/net/phy/marvell.c | 13 +++++++++----
drivers/net/phy/mdio_bus.c | 1 +
drivers/net/phy/mdio_device.c | 4 ++--
drivers/net/phy/national.c | 6 ++++--
drivers/net/phy/phy-c45.c | 2 +-
drivers/net/phy/phy-core.c | 3 ++-
drivers/net/phy/phy.c | 3 +--
drivers/net/phy/phy_device.c | 9 ++++-----
drivers/net/phy/phylink.c | 14 ++++++++------
drivers/net/phy/qsemi.c | 1 +
drivers/net/phy/sfp-bus.c | 28 ++++++++++++++--------------
drivers/net/phy/sfp.c | 2 +-
drivers/net/phy/spi_ks8995.c | 10 +++++-----
drivers/net/phy/ste10Xp.c | 6 +++---
drivers/net/phy/vitesse.c | 3 ++-
21 files changed, 78 insertions(+), 65 deletions(-)
--
2.8.1
From: Weihang Li <hidden> Date: 2021-06-16 10:04:46
From: Wenpeng Liang <redacted>
There are some repeated words in some comments, they should be deleted.
Signed-off-by: Wenpeng Liang <redacted>
Signed-off-by: Weihang Li <redacted>
---
drivers/net/phy/phy-c45.c | 2 +-
drivers/net/phy/sfp.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
@@ -2153,7 +2153,7 @@ static void sfp_sm_main(struct sfp *sfp, unsigned int event)caseSFP_S_INIT:if(event==SFP_E_TIMEOUT&&sfp->state&SFP_F_TX_FAULT){-/* TX_FAULT is still asserted after t_init or+/* TX_FAULT is still asserted after t_init*ort_start_up,soassumethereisafault.*/sfp_sm_fault(sfp,SFP_S_INIT_TX_FAULT,
From: Weihang Li <hidden> Date: 2021-06-16 10:04:48
From: Wenpeng Liang <redacted>
Add a blank line after declarations, change the order of them and put the
assignments and declarations together.
Cc: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: Wenpeng Liang <redacted>
Signed-off-by: Weihang Li <redacted>
---
drivers/net/phy/bcm87xx.c | 4 ++--
drivers/net/phy/dp83640.c | 1 +
drivers/net/phy/et1011c.c | 7 ++++---
drivers/net/phy/mdio_bus.c | 1 +
drivers/net/phy/qsemi.c | 1 +
5 files changed, 9 insertions(+), 5 deletions(-)
@@ -175,6 +175,7 @@ EXPORT_SYMBOL(mdiobus_alloc_size);staticvoidmdiobus_release(structdevice*d){structmii_bus*bus=to_mii_bus(d);+BUG_ON(bus->state!=MDIOBUS_RELEASED&&/* for compatibility with error handling in drivers */bus->state!=MDIOBUS_ALLOCATED);
@@ -100,6 +100,7 @@ static int qs6612_ack_interrupt(struct phy_device *phydev)staticintqs6612_config_intr(structphy_device*phydev){interr;+if(phydev->interrupts==PHY_INTERRUPT_ENABLED){/* clear any interrupts before enabling them */err=qs6612_ack_interrupt(phydev);
From: Weihang Li <hidden> Date: 2021-06-16 10:04:53
From: Wenpeng Liang <redacted>
Fix following format issues:
1. open brace '{' following function definitions should go to the next
line.
2. braces {} are not necessary for single line statements.
3. else should follow close brace '}'.
Signed-off-by: Wenpeng Liang <redacted>
Signed-off-by: Weihang Li <redacted>
---
drivers/net/phy/fixed_phy.c | 4 ++--
drivers/net/phy/phy.c | 3 +--
drivers/net/phy/phy_device.c | 9 ++++-----
drivers/net/phy/phylink.c | 5 ++---
4 files changed, 9 insertions(+), 12 deletions(-)
@@ -161,8 +161,8 @@ static int fixed_phy_add_gpiod(unsigned int irq, int phy_addr,}intfixed_phy_add(unsignedintirq,intphy_addr,-structfixed_phy_status*status){-+structfixed_phy_status*status)+{returnfixed_phy_add_gpiod(irq,phy_addr,status,NULL);}EXPORT_SYMBOL_GPL(fixed_phy_add);
From: Weihang Li <hidden> Date: 2021-06-16 10:04:55
From: Wenpeng Liang <redacted>
Block comments should not use a trailing */ on a separate line and every
line of a block comment should start with an '*'.
Signed-off-by: Wenpeng Liang <redacted>
Signed-off-by: Weihang Li <redacted>
---
drivers/net/phy/lxt.c | 4 ++--
drivers/net/phy/national.c | 6 ++++--
drivers/net/phy/phy-core.c | 3 ++-
drivers/net/phy/phylink.c | 9 ++++++---
drivers/net/phy/vitesse.c | 3 ++-
5 files changed, 16 insertions(+), 9 deletions(-)
@@ -242,8 +242,8 @@ static int lxt973a2_read_status(struct phy_device *phydev)returnlpa;/* If both registers are equal, it is suspect but not-*impossible,henceanewtry-*/+*impossible,henceanewtry+*/}while(lpa==adv&&retry--);mii_lpa_to_linkmode_lpa_t(phydev->lp_advertising,lpa);
@@ -68,7 +68,8 @@ static int ns_ack_interrupt(struct phy_device *phydev)returnret;/* Clear the interrupt status bit by writing a “1”-*tothecorrespondingbitinINT_CLEAR(2:0arereserved)*/+*tothecorrespondingbitinINT_CLEAR(2:0arereserved)+*/ret=phy_write(phydev,DP83865_INT_CLEAR,ret&~0x7);returnret;
@@ -150,7 +151,8 @@ static int ns_config_init(struct phy_device *phydev){ns_giga_speed_fallback(phydev,ALL_FALLBACK_ON);/* In the latest MAC or switches design, the 10 Mbps loopback-isdesiredtobeturnedoff.*/+*isdesiredtobeturnedoff.+*/ns_10_base_t_hdx_loopack(phydev,hdx_loopback_off);returnns_ack_interrupt(phydev);}
@@ -76,7 +76,8 @@ EXPORT_SYMBOL_GPL(phy_duplex_to_str);/* A mapping of all SUPPORTED settings to speed/duplex. This table*mustbegroupedbyspeedandsortedindescendingmatchpriority-*-iow,descendingspeed.*/+*-iow,descendingspeed.+*/#define PHY_SETTING(s, d, b) { .speed = SPEED_ ## s, .duplex = DUPLEX_ ## d, \.bit=ETHTOOL_LINK_MODE_##b##_BIT}
@@ -182,7 +182,8 @@ static int phylink_parse_fixedlink(struct phylink *pl,pl->link_config.duplex=DUPLEX_FULL;/* We treat the "pause" and "asym-pause" terminology as-*definingthelinkpartner'sability.*/+*definingthelinkpartner'sability.+*/if(fwnode_property_read_bool(fixed_node,"pause"))__set_bit(ETHTOOL_LINK_MODE_Pause_BIT,pl->link_config.lp_advertising);
@@ -685,7 +686,8 @@ static void phylink_resolve(struct work_struct *w)phylink_mac_pcs_get_state(pl,&link_state);/* If we have a phy, the "up" state is the union of-*boththePHYandtheMAC*/+*boththePHYandtheMAC+*/if(pl->phydev)link_state.link&=pl->phy_state.link;
@@ -694,7 +696,8 @@ static void phylink_resolve(struct work_struct *w)link_state.interface=pl->phy_state.interface;/* If we have a PHY, we need to update with-*thePHYflowcontrolbits.*/+*thePHYflowcontrolbits.+*/link_state.pause=pl->phy_state.pause;mac_config=true;}
@@ -249,7 +249,8 @@ static int vsc73xx_config_aneg(struct phy_device *phydev)/* This adds a skew for both TX and RX clocks, so the skew should only be*appliedto"rgmii-id"interfaces.Itmaynotworkasexpected-*on"rgmii-txid","rgmii-rxid"or"rgmii"interfaces.*/+*on"rgmii-txid","rgmii-rxid"or"rgmii"interfaces.+*/staticintvsc8601_add_skew(structphy_device*phydev){intret;
From: Weihang Li <hidden> Date: 2021-06-16 10:04:59
From: Wenpeng Liang <redacted>
There are some space related issues, including spaces at the start of the
line, before tabs, after open parenthesis and before close parenthesis.
Signed-off-by: Wenpeng Liang <redacted>
Signed-off-by: Weihang Li <redacted>
---
drivers/net/phy/davicom.c | 6 +++---
drivers/net/phy/sfp-bus.c | 28 ++++++++++++++--------------
drivers/net/phy/spi_ks8995.c | 10 +++++-----
drivers/net/phy/ste10Xp.c | 6 +++---
4 files changed, 25 insertions(+), 25 deletions(-)
From: Weihang Li <hidden> Date: 2021-06-16 10:05:02
Switch statement is clearer than a group of 'if-else'.
Signed-off-by: Weihang Li <redacted>
---
drivers/net/phy/marvell.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
From: Weihang Li <hidden> Date: 2021-06-16 10:05:06
From: Wenpeng Liang <redacted>
Avoid unnecessary line continuations, and put '|' at the end of line.
Signed-off-by: Wenpeng Liang <redacted>
Signed-off-by: Weihang Li <redacted>
---
drivers/net/phy/dp83640.c | 4 ++--
drivers/net/phy/et1011c.c | 8 ++++----
2 files changed, 6 insertions(+), 6 deletions(-)
@@ -170,9 +170,9 @@ static ushort gpio_tab[GPIO_TABLE_SIZE] = {module_param(chosen_phy,int,0444);module_param_array(gpio_tab,ushort,NULL,0444);-MODULE_PARM_DESC(chosen_phy,\+MODULE_PARM_DESC(chosen_phy,"The address of the PHY to use for the ancillary clock features");-MODULE_PARM_DESC(gpio_tab,\+MODULE_PARM_DESC(gpio_tab,"Which GPIO line to use for which purpose: cal,perout,extts1,...,extts6");staticvoiddp83640_gpio_defaults(structptp_pin_desc*pd)
From: Andrew Lunn <andrew@lunn.ch> Date: 2021-06-16 15:56:21
On Wed, Jun 16, 2021 at 06:01:19PM +0800, Weihang Li wrote:
From: Wenpeng Liang <redacted>
Add a blank line after declarations, change the order of them and put the
assignments and declarations together.
Cc: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: Wenpeng Liang <redacted>
Signed-off-by: Weihang Li <redacted>
From: Andrew Lunn <andrew@lunn.ch> Date: 2021-06-16 15:57:04
On Wed, Jun 16, 2021 at 06:01:20PM +0800, Weihang Li wrote:
From: Wenpeng Liang <redacted>
Block comments should not use a trailing */ on a separate line and every
line of a block comment should start with an '*'.
Signed-off-by: Wenpeng Liang <redacted>
Signed-off-by: Weihang Li <redacted>
From: Andrew Lunn <andrew@lunn.ch> Date: 2021-06-16 15:57:11
On Wed, Jun 16, 2021 at 06:01:21PM +0800, Weihang Li wrote:
From: Wenpeng Liang <redacted>
There are some repeated words in some comments, they should be deleted.
Signed-off-by: Wenpeng Liang <redacted>
Signed-off-by: Weihang Li <redacted>
From: Andrew Lunn <andrew@lunn.ch> Date: 2021-06-16 16:07:39
On Wed, Jun 16, 2021 at 06:01:22PM +0800, Weihang Li wrote:
From: Wenpeng Liang <redacted>
There are some space related issues, including spaces at the start of the
line, before tabs, after open parenthesis and before close parenthesis.
Signed-off-by: Wenpeng Liang <redacted>
Signed-off-by: Weihang Li <redacted>
From: Andrew Lunn <andrew@lunn.ch> Date: 2021-06-16 16:08:21
On Wed, Jun 16, 2021 at 06:01:23PM +0800, Weihang Li wrote:
From: Wenpeng Liang <redacted>
Fix following format issues:
1. open brace '{' following function definitions should go to the next
line.
2. braces {} are not necessary for single line statements.
3. else should follow close brace '}'.
Signed-off-by: Wenpeng Liang <redacted>
Signed-off-by: Weihang Li <redacted>
From: Andrew Lunn <andrew@lunn.ch> Date: 2021-06-16 16:08:53
On Wed, Jun 16, 2021 at 06:01:24PM +0800, Weihang Li wrote:
From: Wenpeng Liang <redacted>
It's better to use __func__ than a fixed string to print a function's
name.
Signed-off-by: Wenpeng Liang <redacted>
Signed-off-by: Weihang Li <redacted>
From: Andrew Lunn <andrew@lunn.ch> Date: 2021-06-16 16:09:34
On Wed, Jun 16, 2021 at 06:01:25PM +0800, Weihang Li wrote:
From: Wenpeng Liang <redacted>
Avoid unnecessary line continuations, and put '|' at the end of line.
Signed-off-by: Wenpeng Liang <redacted>
Signed-off-by: Weihang Li <redacted>
Hello:
This series was applied to netdev/net-next.git (refs/heads/master):
On Wed, 16 Jun 2021 18:01:18 +0800 you wrote:
Make some cleanups according to the coding style of kernel.
Changes since v1:
- Update commit description of #1 and #3.
- Avoid changing the indentation in #2.
- Change a group of if-else statement into switch from #4 and put it into
a single patch.
- Put '|' at the end of line in #5 and #7.
- Avoid deleting spaces in definition of 'settings' in #5.
- Drop #8 from the series which needs more discussion with David.
[...]