* [PATCH net-next 0/9] net: phy: fix checkpatch errors
@ 2013-12-18 5:38 Florian Fainelli
2013-12-18 5:38 ` [PATCH net-next 1/9] net: phy: cicada: fix checkpath errors Florian Fainelli
` (10 more replies)
0 siblings, 11 replies; 16+ messages in thread
From: Florian Fainelli @ 2013-12-18 5:38 UTC (permalink / raw)
To: davem; +Cc: netdev, Florian Fainelli
Hello David,
This patchset fixes trivial checkpatch errors, no functional change
introduced.
Thanks!
Florian Fainelli (9):
net: phy: cicada: fix checkpath errors
net: phy: davicom: fix checkpath errors
net: phy: dp83640: fix checkpath error
net: phy: icplus: fix checkpath error
net: phy: lxt: fix checkpath errors
net: phy: mdio_bus: fix checkpath error
net: phy: micrel: fix checkpath errors
net: phy: fix checkpatch errors
net: phy: spi_ks8995: fix checkpatch errors
drivers/net/phy/cicada.c | 4 +-
drivers/net/phy/davicom.c | 2 +-
drivers/net/phy/dp83640.c | 4 +-
drivers/net/phy/icplus.c | 2 +-
drivers/net/phy/lxt.c | 4 +-
drivers/net/phy/mdio_bus.c | 4 +-
drivers/net/phy/micrel.c | 4 +-
drivers/net/phy/phy.c | 264 +++++++++++++++++++++----------------------
drivers/net/phy/phy_device.c | 14 +--
drivers/net/phy/spi_ks8995.c | 4 +-
10 files changed, 153 insertions(+), 153 deletions(-)
--
1.8.3.2
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH net-next 1/9] net: phy: cicada: fix checkpath errors
2013-12-18 5:38 [PATCH net-next 0/9] net: phy: fix checkpatch errors Florian Fainelli
@ 2013-12-18 5:38 ` Florian Fainelli
2013-12-18 5:38 ` [PATCH net-next 2/9] net: phy: davicom: " Florian Fainelli
` (9 subsequent siblings)
10 siblings, 0 replies; 16+ messages in thread
From: Florian Fainelli @ 2013-12-18 5:38 UTC (permalink / raw)
To: davem; +Cc: netdev, Florian Fainelli
checkpath spotted a few stylistic errors fix them.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/phy/cicada.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/phy/cicada.c b/drivers/net/phy/cicada.c
index 313a037..b57ce0c 100644
--- a/drivers/net/phy/cicada.c
+++ b/drivers/net/phy/cicada.c
@@ -92,8 +92,8 @@ static int cis820x_config_intr(struct phy_device *phydev)
{
int err;
- if(phydev->interrupts == PHY_INTERRUPT_ENABLED)
- err = phy_write(phydev, MII_CIS8201_IMASK,
+ if (phydev->interrupts == PHY_INTERRUPT_ENABLED)
+ err = phy_write(phydev, MII_CIS8201_IMASK,
MII_CIS8201_IMASK_MASK);
else
err = phy_write(phydev, MII_CIS8201_IMASK, 0);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH net-next 2/9] net: phy: davicom: fix checkpath errors
2013-12-18 5:38 [PATCH net-next 0/9] net: phy: fix checkpatch errors Florian Fainelli
2013-12-18 5:38 ` [PATCH net-next 1/9] net: phy: cicada: fix checkpath errors Florian Fainelli
@ 2013-12-18 5:38 ` Florian Fainelli
2013-12-18 5:38 ` [PATCH net-next 3/9] net: phy: dp83640: fix checkpath error Florian Fainelli
` (8 subsequent siblings)
10 siblings, 0 replies; 16+ messages in thread
From: Florian Fainelli @ 2013-12-18 5:38 UTC (permalink / raw)
To: davem; +Cc: netdev, Florian Fainelli
checkpath spotted a few stylistic errors, fix them.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/phy/davicom.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/phy/davicom.c b/drivers/net/phy/davicom.c
index 383e833..d2c08f6 100644
--- a/drivers/net/phy/davicom.c
+++ b/drivers/net/phy/davicom.c
@@ -72,7 +72,7 @@ static int dm9161_config_intr(struct phy_device *phydev)
if (temp < 0)
return temp;
- if(PHY_INTERRUPT_ENABLED == phydev->interrupts )
+ if (PHY_INTERRUPT_ENABLED == phydev->interrupts)
temp &= ~(MII_DM9161_INTR_STOP);
else
temp |= MII_DM9161_INTR_STOP;
--
1.8.3.2
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH net-next 3/9] net: phy: dp83640: fix checkpath error
2013-12-18 5:38 [PATCH net-next 0/9] net: phy: fix checkpatch errors Florian Fainelli
2013-12-18 5:38 ` [PATCH net-next 1/9] net: phy: cicada: fix checkpath errors Florian Fainelli
2013-12-18 5:38 ` [PATCH net-next 2/9] net: phy: davicom: " Florian Fainelli
@ 2013-12-18 5:38 ` Florian Fainelli
2013-12-19 22:31 ` Joe Perches
2013-12-18 5:38 ` [PATCH net-next 4/9] net: phy: icplus: " Florian Fainelli
` (7 subsequent siblings)
10 siblings, 1 reply; 16+ messages in thread
From: Florian Fainelli @ 2013-12-18 5:38 UTC (permalink / raw)
To: davem; +Cc: netdev, Florian Fainelli
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/phy/dp83640.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/phy/dp83640.c b/drivers/net/phy/dp83640.c
index 7490b6c..547725f 100644
--- a/drivers/net/phy/dp83640.c
+++ b/drivers/net/phy/dp83640.c
@@ -851,8 +851,8 @@ static int match(struct sk_buff *skb, unsigned int type, struct rxts *rxts)
seqid = (u16 *)(data + offset + OFF_PTP_SEQUENCE_ID);
- return (rxts->msgtype == (*msgtype & 0xf) &&
- rxts->seqid == ntohs(*seqid));
+ return rxts->msgtype == (*msgtype & 0xf) &&
+ rxts->seqid == ntohs(*seqid);
}
static void dp83640_free_clocks(void)
--
1.8.3.2
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH net-next 4/9] net: phy: icplus: fix checkpath error
2013-12-18 5:38 [PATCH net-next 0/9] net: phy: fix checkpatch errors Florian Fainelli
` (2 preceding siblings ...)
2013-12-18 5:38 ` [PATCH net-next 3/9] net: phy: dp83640: fix checkpath error Florian Fainelli
@ 2013-12-18 5:38 ` Florian Fainelli
2013-12-18 5:38 ` [PATCH net-next 5/9] net: phy: lxt: fix checkpath errors Florian Fainelli
` (6 subsequent siblings)
10 siblings, 0 replies; 16+ messages in thread
From: Florian Fainelli @ 2013-12-18 5:38 UTC (permalink / raw)
To: davem; +Cc: netdev, Florian Fainelli
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/phy/icplus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/phy/icplus.c b/drivers/net/phy/icplus.c
index b5ddd50..97bf58b 100644
--- a/drivers/net/phy/icplus.c
+++ b/drivers/net/phy/icplus.c
@@ -48,7 +48,7 @@ MODULE_LICENSE("GPL");
static int ip175c_config_init(struct phy_device *phydev)
{
int err, i;
- static int full_reset_performed = 0;
+ static int full_reset_performed;
if (full_reset_performed == 0) {
--
1.8.3.2
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH net-next 5/9] net: phy: lxt: fix checkpath errors
2013-12-18 5:38 [PATCH net-next 0/9] net: phy: fix checkpatch errors Florian Fainelli
` (3 preceding siblings ...)
2013-12-18 5:38 ` [PATCH net-next 4/9] net: phy: icplus: " Florian Fainelli
@ 2013-12-18 5:38 ` Florian Fainelli
2013-12-18 5:38 ` [PATCH net-next 6/9] net: phy: mdio_bus: fix checkpath error Florian Fainelli
` (5 subsequent siblings)
10 siblings, 0 replies; 16+ messages in thread
From: Florian Fainelli @ 2013-12-18 5:38 UTC (permalink / raw)
To: davem; +Cc: netdev, Florian Fainelli
checkpath spotted a few errors in this file, fix them.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/phy/lxt.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/phy/lxt.c b/drivers/net/phy/lxt.c
index ff2e45e..9108f31 100644
--- a/drivers/net/phy/lxt.c
+++ b/drivers/net/phy/lxt.c
@@ -82,7 +82,7 @@ static int lxt970_config_intr(struct phy_device *phydev)
{
int err;
- if(phydev->interrupts == PHY_INTERRUPT_ENABLED)
+ if (phydev->interrupts == PHY_INTERRUPT_ENABLED)
err = phy_write(phydev, MII_LXT970_IER, MII_LXT970_IER_IEN);
else
err = phy_write(phydev, MII_LXT970_IER, 0);
@@ -114,7 +114,7 @@ static int lxt971_config_intr(struct phy_device *phydev)
{
int err;
- if(phydev->interrupts == PHY_INTERRUPT_ENABLED)
+ if (phydev->interrupts == PHY_INTERRUPT_ENABLED)
err = phy_write(phydev, MII_LXT971_IER, MII_LXT971_IER_IEN);
else
err = phy_write(phydev, MII_LXT971_IER, 0);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH net-next 6/9] net: phy: mdio_bus: fix checkpath error
2013-12-18 5:38 [PATCH net-next 0/9] net: phy: fix checkpatch errors Florian Fainelli
` (4 preceding siblings ...)
2013-12-18 5:38 ` [PATCH net-next 5/9] net: phy: lxt: fix checkpath errors Florian Fainelli
@ 2013-12-18 5:38 ` Florian Fainelli
2013-12-18 5:38 ` [PATCH net-next 7/9] net: phy: micrel: fix checkpath errors Florian Fainelli
` (4 subsequent siblings)
10 siblings, 0 replies; 16+ messages in thread
From: Florian Fainelli @ 2013-12-18 5:38 UTC (permalink / raw)
To: davem; +Cc: netdev, Florian Fainelli
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/phy/mdio_bus.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
index 5617876..33e1c86 100644
--- a/drivers/net/phy/mdio_bus.c
+++ b/drivers/net/phy/mdio_bus.c
@@ -316,8 +316,8 @@ static int mdio_bus_match(struct device *dev, struct device_driver *drv)
if (phydrv->match_phy_device)
return phydrv->match_phy_device(phydev);
- return ((phydrv->phy_id & phydrv->phy_id_mask) ==
- (phydev->phy_id & phydrv->phy_id_mask));
+ return (phydrv->phy_id & phydrv->phy_id_mask) ==
+ (phydev->phy_id & phydrv->phy_id_mask);
}
#ifdef CONFIG_PM
--
1.8.3.2
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH net-next 7/9] net: phy: micrel: fix checkpath errors
2013-12-18 5:38 [PATCH net-next 0/9] net: phy: fix checkpatch errors Florian Fainelli
` (5 preceding siblings ...)
2013-12-18 5:38 ` [PATCH net-next 6/9] net: phy: mdio_bus: fix checkpath error Florian Fainelli
@ 2013-12-18 5:38 ` Florian Fainelli
2013-12-18 5:38 ` [PATCH net-next 8/9] net: phy: fix checkpatch errors Florian Fainelli
` (3 subsequent siblings)
10 siblings, 0 replies; 16+ messages in thread
From: Florian Fainelli @ 2013-12-18 5:38 UTC (permalink / raw)
To: davem; +Cc: netdev, Florian Fainelli
checkpatch spotted a few spaces vs tabs errors, fix them.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/phy/micrel.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index 3ae28f4..2a470e5 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -81,14 +81,14 @@ static int ksz_config_flags(struct phy_device *phydev)
}
static int kszphy_extended_write(struct phy_device *phydev,
- u32 regnum, u16 val)
+ u32 regnum, u16 val)
{
phy_write(phydev, MII_KSZPHY_EXTREG, KSZPHY_EXTREG_WRITE | regnum);
return phy_write(phydev, MII_KSZPHY_EXTREG_WRITE, val);
}
static int kszphy_extended_read(struct phy_device *phydev,
- u32 regnum)
+ u32 regnum)
{
phy_write(phydev, MII_KSZPHY_EXTREG, regnum);
return phy_read(phydev, MII_KSZPHY_EXTREG_READ);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH net-next 8/9] net: phy: fix checkpatch errors
2013-12-18 5:38 [PATCH net-next 0/9] net: phy: fix checkpatch errors Florian Fainelli
` (6 preceding siblings ...)
2013-12-18 5:38 ` [PATCH net-next 7/9] net: phy: micrel: fix checkpath errors Florian Fainelli
@ 2013-12-18 5:38 ` Florian Fainelli
2013-12-18 6:07 ` Joe Perches
2013-12-19 20:48 ` Sergei Shtylyov
2013-12-18 5:38 ` [PATCH net-next 9/9] net: phy: spi_ks8995: " Florian Fainelli
` (2 subsequent siblings)
10 siblings, 2 replies; 16+ messages in thread
From: Florian Fainelli @ 2013-12-18 5:38 UTC (permalink / raw)
To: davem; +Cc: netdev, Florian Fainelli
checkpatch spotted a few checkpatch errors such as whitespace damages
and switch/case labels not being on the same column, fix them.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/phy/phy.c | 264 +++++++++++++++++++++----------------------
drivers/net/phy/phy_device.c | 14 +--
2 files changed, 139 insertions(+), 139 deletions(-)
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index dea609f..2090886 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -332,7 +332,7 @@ int phy_mii_ioctl(struct phy_device *phydev,
case SIOCSMIIREG:
if (mii_data->phy_id == phydev->addr) {
- switch(mii_data->reg_num) {
+ switch (mii_data->reg_num) {
case MII_BMCR:
if ((val & (BMCR_RESET|BMCR_ANENABLE)) == 0)
phydev->autoneg = AUTONEG_DISABLE;
@@ -714,16 +714,16 @@ void phy_start(struct phy_device *phydev)
mutex_lock(&phydev->lock);
switch (phydev->state) {
- case PHY_STARTING:
- phydev->state = PHY_PENDING;
- break;
- case PHY_READY:
- phydev->state = PHY_UP;
- break;
- case PHY_HALTED:
- phydev->state = PHY_RESUMING;
- default:
- break;
+ case PHY_STARTING:
+ phydev->state = PHY_PENDING;
+ break;
+ case PHY_READY:
+ phydev->state = PHY_UP;
+ break;
+ case PHY_HALTED:
+ phydev->state = PHY_RESUMING;
+ default:
+ break;
}
mutex_unlock(&phydev->lock);
}
@@ -747,153 +747,138 @@ void phy_state_machine(struct work_struct *work)
if (phydev->adjust_state)
phydev->adjust_state(phydev->attached_dev);
- switch(phydev->state) {
- case PHY_DOWN:
- case PHY_STARTING:
- case PHY_READY:
- case PHY_PENDING:
- break;
- case PHY_UP:
- needs_aneg = 1;
+ switch (phydev->state) {
+ case PHY_DOWN:
+ case PHY_STARTING:
+ case PHY_READY:
+ case PHY_PENDING:
+ break;
+ case PHY_UP:
+ needs_aneg = 1;
- phydev->link_timeout = PHY_AN_TIMEOUT;
+ phydev->link_timeout = PHY_AN_TIMEOUT;
+
+ break;
+ case PHY_AN:
+ err = phy_read_status(phydev);
+ if (err < 0)
break;
- case PHY_AN:
- err = phy_read_status(phydev);
- if (err < 0)
- break;
+ /* If the link is down, give up on
+ * negotiation for now */
+ if (!phydev->link) {
+ phydev->state = PHY_NOLINK;
+ netif_carrier_off(phydev->attached_dev);
+ phydev->adjust_link(phydev->attached_dev);
+ break;
+ }
- /* If the link is down, give up on
- * negotiation for now */
- if (!phydev->link) {
- phydev->state = PHY_NOLINK;
- netif_carrier_off(phydev->attached_dev);
- phydev->adjust_link(phydev->attached_dev);
- break;
- }
+ /* Check if negotiation is done. Break
+ * if there's an error */
+ err = phy_aneg_done(phydev);
+ if (err < 0)
+ break;
- /* Check if negotiation is done. Break
- * if there's an error */
- err = phy_aneg_done(phydev);
- if (err < 0)
- break;
+ /* If AN is done, we're running */
+ if (err > 0) {
+ phydev->state = PHY_RUNNING;
+ netif_carrier_on(phydev->attached_dev);
+ phydev->adjust_link(phydev->attached_dev);
- /* If AN is done, we're running */
- if (err > 0) {
- phydev->state = PHY_RUNNING;
- netif_carrier_on(phydev->attached_dev);
- phydev->adjust_link(phydev->attached_dev);
+ } else if (0 == phydev->link_timeout--) {
+ needs_aneg = 1;
+ /* If we have the magic_aneg bit,
+ * we try again */
+ if (phydev->drv->flags & PHY_HAS_MAGICANEG)
+ break;
+ }
+ break;
+ case PHY_NOLINK:
+ err = phy_read_status(phydev);
- } else if (0 == phydev->link_timeout--) {
- needs_aneg = 1;
- /* If we have the magic_aneg bit,
- * we try again */
- if (phydev->drv->flags & PHY_HAS_MAGICANEG)
- break;
- }
+ if (err)
break;
- case PHY_NOLINK:
- err = phy_read_status(phydev);
- if (err)
- break;
+ if (phydev->link) {
+ phydev->state = PHY_RUNNING;
+ netif_carrier_on(phydev->attached_dev);
+ phydev->adjust_link(phydev->attached_dev);
+ }
+ break;
+ case PHY_FORCING:
+ err = genphy_update_link(phydev);
- if (phydev->link) {
- phydev->state = PHY_RUNNING;
- netif_carrier_on(phydev->attached_dev);
- phydev->adjust_link(phydev->attached_dev);
- }
+ if (err)
break;
- case PHY_FORCING:
- err = genphy_update_link(phydev);
- if (err)
- break;
+ if (phydev->link) {
+ phydev->state = PHY_RUNNING;
+ netif_carrier_on(phydev->attached_dev);
+ } else {
+ if (0 == phydev->link_timeout--)
+ needs_aneg = 1;
+ }
- if (phydev->link) {
- phydev->state = PHY_RUNNING;
- netif_carrier_on(phydev->attached_dev);
- } else {
- if (0 == phydev->link_timeout--)
- needs_aneg = 1;
- }
+ phydev->adjust_link(phydev->attached_dev);
+ break;
+ case PHY_RUNNING:
+ /* Only register a CHANGE if we are
+ * polling or ignoring interrupts
+ */
+ if (!phy_interrupt_is_valid(phydev))
+ phydev->state = PHY_CHANGELINK;
+ break;
+ case PHY_CHANGELINK:
+ err = phy_read_status(phydev);
- phydev->adjust_link(phydev->attached_dev);
+ if (err)
break;
- case PHY_RUNNING:
- /* Only register a CHANGE if we are
- * polling or ignoring interrupts
- */
- if (!phy_interrupt_is_valid(phydev))
- phydev->state = PHY_CHANGELINK;
- break;
- case PHY_CHANGELINK:
- err = phy_read_status(phydev);
- if (err)
- break;
+ if (phydev->link) {
+ phydev->state = PHY_RUNNING;
+ netif_carrier_on(phydev->attached_dev);
+ } else {
+ phydev->state = PHY_NOLINK;
+ netif_carrier_off(phydev->attached_dev);
+ }
- if (phydev->link) {
- phydev->state = PHY_RUNNING;
- netif_carrier_on(phydev->attached_dev);
- } else {
- phydev->state = PHY_NOLINK;
- netif_carrier_off(phydev->attached_dev);
- }
+ phydev->adjust_link(phydev->attached_dev);
+ if (phy_interrupt_is_valid(phydev))
+ err = phy_config_interrupt(phydev,
+ PHY_INTERRUPT_ENABLED);
+ break;
+ case PHY_HALTED:
+ if (phydev->link) {
+ phydev->link = 0;
+ netif_carrier_off(phydev->attached_dev);
phydev->adjust_link(phydev->attached_dev);
+ do_suspend = 1;
+ }
+ break;
+ case PHY_RESUMING:
- if (phy_interrupt_is_valid(phydev))
- err = phy_config_interrupt(phydev,
- PHY_INTERRUPT_ENABLED);
- break;
- case PHY_HALTED:
- if (phydev->link) {
- phydev->link = 0;
- netif_carrier_off(phydev->attached_dev);
- phydev->adjust_link(phydev->attached_dev);
- do_suspend = 1;
- }
- break;
- case PHY_RESUMING:
+ err = phy_clear_interrupt(phydev);
- err = phy_clear_interrupt(phydev);
+ if (err)
+ break;
- if (err)
- break;
+ err = phy_config_interrupt(phydev,
+ PHY_INTERRUPT_ENABLED);
- err = phy_config_interrupt(phydev,
- PHY_INTERRUPT_ENABLED);
+ if (err)
+ break;
- if (err)
+ if (AUTONEG_ENABLE == phydev->autoneg) {
+ err = phy_aneg_done(phydev);
+ if (err < 0)
break;
- if (AUTONEG_ENABLE == phydev->autoneg) {
- err = phy_aneg_done(phydev);
- if (err < 0)
- break;
-
- /* err > 0 if AN is done.
- * Otherwise, it's 0, and we're
- * still waiting for AN */
- if (err > 0) {
- err = phy_read_status(phydev);
- if (err)
- break;
-
- if (phydev->link) {
- phydev->state = PHY_RUNNING;
- netif_carrier_on(phydev->attached_dev);
- } else
- phydev->state = PHY_NOLINK;
- phydev->adjust_link(phydev->attached_dev);
- } else {
- phydev->state = PHY_AN;
- phydev->link_timeout = PHY_AN_TIMEOUT;
- }
- } else {
+ /* err > 0 if AN is done.
+ * Otherwise, it's 0, and we're
+ * still waiting for AN */
+ if (err > 0) {
err = phy_read_status(phydev);
if (err)
break;
@@ -904,8 +889,23 @@ void phy_state_machine(struct work_struct *work)
} else
phydev->state = PHY_NOLINK;
phydev->adjust_link(phydev->attached_dev);
+ } else {
+ phydev->state = PHY_AN;
+ phydev->link_timeout = PHY_AN_TIMEOUT;
}
- break;
+ } else {
+ err = phy_read_status(phydev);
+ if (err)
+ break;
+
+ if (phydev->link) {
+ phydev->state = PHY_RUNNING;
+ netif_carrier_on(phydev->attached_dev);
+ } else
+ phydev->state = PHY_NOLINK;
+ phydev->adjust_link(phydev->attached_dev);
+ }
+ break;
}
mutex_unlock(&phydev->lock);
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 4eb5bba..d532424 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -162,7 +162,7 @@ struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id,
dev = kzalloc(sizeof(*dev), GFP_KERNEL);
if (NULL == dev)
- return (struct phy_device*) PTR_ERR((void*)-ENOMEM);
+ return (struct phy_device *)PTR_ERR((void *)-ENOMEM);
dev->dev.release = phy_device_release;
@@ -459,7 +459,7 @@ EXPORT_SYMBOL(phy_connect_direct);
* choose to call only the subset of functions which provide
* the desired functionality.
*/
-struct phy_device * phy_connect(struct net_device *dev, const char *bus_id,
+struct phy_device *phy_connect(struct net_device *dev, const char *bus_id,
void (*handler)(struct net_device *),
phy_interface_t interface)
{
@@ -494,7 +494,7 @@ void phy_disconnect(struct phy_device *phydev)
phy_stop_interrupts(phydev);
phy_stop_machine(phydev);
-
+
phydev->adjust_link = NULL;
phy_detach(phydev);
@@ -792,7 +792,7 @@ int genphy_setup_forced(struct phy_device *phydev)
if (DUPLEX_FULL == phydev->duplex)
ctl |= BMCR_FULLDPLX;
-
+
err = phy_write(phydev, MII_BMCR, ctl);
return err;
@@ -965,14 +965,14 @@ int genphy_read_status(struct phy_device *phydev)
phydev->duplex = DUPLEX_FULL;
} else if (lpa & (LPA_100FULL | LPA_100HALF)) {
phydev->speed = SPEED_100;
-
+
if (lpa & LPA_100FULL)
phydev->duplex = DUPLEX_FULL;
} else
if (lpa & LPA_10FULL)
phydev->duplex = DUPLEX_FULL;
- if (phydev->duplex == DUPLEX_FULL){
+ if (phydev->duplex == DUPLEX_FULL) {
phydev->pause = lpa & LPA_PAUSE_CAP ? 1 : 0;
phydev->asym_pause = lpa & LPA_PAUSE_ASYM ? 1 : 0;
}
@@ -1213,7 +1213,7 @@ static struct phy_driver genphy_driver = {
.read_status = genphy_read_status,
.suspend = genphy_suspend,
.resume = genphy_resume,
- .driver = {.owner= THIS_MODULE, },
+ .driver = { .owner = THIS_MODULE, },
};
static int __init phy_init(void)
--
1.8.3.2
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH net-next 9/9] net: phy: spi_ks8995: fix checkpatch errors
2013-12-18 5:38 [PATCH net-next 0/9] net: phy: fix checkpatch errors Florian Fainelli
` (7 preceding siblings ...)
2013-12-18 5:38 ` [PATCH net-next 8/9] net: phy: fix checkpatch errors Florian Fainelli
@ 2013-12-18 5:38 ` Florian Fainelli
2013-12-18 5:50 ` [PATCH net-next 0/9] net: phy: " David Miller
2013-12-19 22:27 ` Joe Perches
10 siblings, 0 replies; 16+ messages in thread
From: Florian Fainelli @ 2013-12-18 5:38 UTC (permalink / raw)
To: davem; +Cc: netdev, Florian Fainelli
checkpatch spotted two errors, fix them.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/phy/spi_ks8995.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/phy/spi_ks8995.c b/drivers/net/phy/spi_ks8995.c
index 98fb9f3..0ba4311 100644
--- a/drivers/net/phy/spi_ks8995.c
+++ b/drivers/net/phy/spi_ks8995.c
@@ -171,14 +171,14 @@ static int ks8995_write(struct ks8995_switch *ks, char *buf,
static inline int ks8995_read_reg(struct ks8995_switch *ks, u8 addr, u8 *buf)
{
- return (ks8995_read(ks, buf, addr, 1) != 1);
+ return ks8995_read(ks, buf, addr, 1) != 1;
}
static inline int ks8995_write_reg(struct ks8995_switch *ks, u8 addr, u8 val)
{
char buf = val;
- return (ks8995_write(ks, &buf, addr, 1) != 1);
+ return ks8995_write(ks, &buf, addr, 1) != 1;
}
/* ------------------------------------------------------------------------ */
--
1.8.3.2
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH net-next 0/9] net: phy: fix checkpatch errors
2013-12-18 5:38 [PATCH net-next 0/9] net: phy: fix checkpatch errors Florian Fainelli
` (8 preceding siblings ...)
2013-12-18 5:38 ` [PATCH net-next 9/9] net: phy: spi_ks8995: " Florian Fainelli
@ 2013-12-18 5:50 ` David Miller
2013-12-19 22:27 ` Joe Perches
10 siblings, 0 replies; 16+ messages in thread
From: David Miller @ 2013-12-18 5:50 UTC (permalink / raw)
To: f.fainelli; +Cc: netdev
From: Florian Fainelli <f.fainelli@gmail.com>
Date: Tue, 17 Dec 2013 21:38:04 -0800
> This patchset fixes trivial checkpatch errors, no functional change
> introduced.
Series applied.
It would help review in the future if you explicitly stated the
checkpatch errors you are fixing in your commit messages.
Thanks.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH net-next 8/9] net: phy: fix checkpatch errors
2013-12-18 5:38 ` [PATCH net-next 8/9] net: phy: fix checkpatch errors Florian Fainelli
@ 2013-12-18 6:07 ` Joe Perches
2013-12-19 20:48 ` Sergei Shtylyov
1 sibling, 0 replies; 16+ messages in thread
From: Joe Perches @ 2013-12-18 6:07 UTC (permalink / raw)
To: Florian Fainelli; +Cc: davem, netdev
On Tue, 2013-12-17 at 21:38 -0800, Florian Fainelli wrote:
> checkpatch spotted a few checkpatch errors such as whitespace damages
> and switch/case labels not being on the same column, fix them.
trivia:
> diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
[]
> @@ -714,16 +714,16 @@ void phy_start(struct phy_device *phydev)
> mutex_lock(&phydev->lock);
>
> switch (phydev->state) {
> - case PHY_STARTING:
> - phydev->state = PHY_PENDING;
> - break;
> - case PHY_READY:
> - phydev->state = PHY_UP;
> - break;
> - case PHY_HALTED:
> - phydev->state = PHY_RESUMING;
> - default:
> - break;
> + case PHY_STARTING:
> + phydev->state = PHY_PENDING;
> + break;
> + case PHY_READY:
> + phydev->state = PHY_UP;
> + break;
> + case PHY_HALTED:
> + phydev->state = PHY_RESUMING;
This should have a break here and not
rely on the fallthrough.
> + default:
> + break;
> }
> mutex_unlock(&phydev->lock);
> }
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH net-next 8/9] net: phy: fix checkpatch errors
2013-12-18 5:38 ` [PATCH net-next 8/9] net: phy: fix checkpatch errors Florian Fainelli
2013-12-18 6:07 ` Joe Perches
@ 2013-12-19 20:48 ` Sergei Shtylyov
1 sibling, 0 replies; 16+ messages in thread
From: Sergei Shtylyov @ 2013-12-19 20:48 UTC (permalink / raw)
To: Florian Fainelli, davem; +Cc: netdev
Hello.
On 12/18/2013 08:38 AM, Florian Fainelli wrote:
> checkpatch spotted a few checkpatch errors such as whitespace damages
> and switch/case labels not being on the same column, fix them.
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
It's good that I spotted this. Actually, I have started doing this myself
but haven't finished yet... :-)
WBR, Sergei
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH net-next 0/9] net: phy: fix checkpatch errors
2013-12-18 5:38 [PATCH net-next 0/9] net: phy: fix checkpatch errors Florian Fainelli
` (9 preceding siblings ...)
2013-12-18 5:50 ` [PATCH net-next 0/9] net: phy: " David Miller
@ 2013-12-19 22:27 ` Joe Perches
10 siblings, 0 replies; 16+ messages in thread
From: Joe Perches @ 2013-12-19 22:27 UTC (permalink / raw)
To: Florian Fainelli; +Cc: davem, netdev
On Tue, 2013-12-17 at 21:38 -0800, Florian Fainelli wrote:
> Hello David,
>
> This patchset fixes trivial checkpatch errors, no functional change
> introduced.
>
> Thanks!
>
> Florian Fainelli (9):
> net: phy: cicada: fix checkpath errors
I suggest you use a different subject than "checkpatch errors".
and use subjects like "Use more conventional kernel style whitespace"
or "Add space between if and ("
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH net-next 3/9] net: phy: dp83640: fix checkpath error
2013-12-18 5:38 ` [PATCH net-next 3/9] net: phy: dp83640: fix checkpath error Florian Fainelli
@ 2013-12-19 22:31 ` Joe Perches
2013-12-20 9:46 ` David Laight
0 siblings, 1 reply; 16+ messages in thread
From: Joe Perches @ 2013-12-19 22:31 UTC (permalink / raw)
To: Florian Fainelli; +Cc: davem, netdev
On Tue, 2013-12-17 at 21:38 -0800, Florian Fainelli wrote:
> diff --git a/drivers/net/phy/dp83640.c b/drivers/net/phy/dp83640.c
[]
> @@ -851,8 +851,8 @@ static int match(struct sk_buff *skb, unsigned int type, struct rxts *rxts)
>
> seqid = (u16 *)(data + offset + OFF_PTP_SEQUENCE_ID);
>
> - return (rxts->msgtype == (*msgtype & 0xf) &&
> - rxts->seqid == ntohs(*seqid));
> + return rxts->msgtype == (*msgtype & 0xf) &&
> + rxts->seqid == ntohs(*seqid);
I think this isn't an improvement.
Maybe:
return rxts->msgtype == (*msgtype & 0xf) &&
rxts->seqid == ntohs(*seqid);
or
return (rxts->msgtype == (*msgtype & 0xf)) &&
(rxts->seqid == ntohs(*seqid));
^ permalink raw reply [flat|nested] 16+ messages in thread
* RE: [PATCH net-next 3/9] net: phy: dp83640: fix checkpath error
2013-12-19 22:31 ` Joe Perches
@ 2013-12-20 9:46 ` David Laight
0 siblings, 0 replies; 16+ messages in thread
From: David Laight @ 2013-12-20 9:46 UTC (permalink / raw)
To: Joe Perches, Florian Fainelli; +Cc: davem, netdev
> From: Joe Perches
> Sent: 19 December 2013 22:31
> On Tue, 2013-12-17 at 21:38 -0800, Florian Fainelli wrote:
> > diff --git a/drivers/net/phy/dp83640.c b/drivers/net/phy/dp83640.c
> []
> > @@ -851,8 +851,8 @@ static int match(struct sk_buff *skb, unsigned int type, struct rxts *rxts)
> >
> > seqid = (u16 *)(data + offset + OFF_PTP_SEQUENCE_ID);
> >
> > - return (rxts->msgtype == (*msgtype & 0xf) &&
> > - rxts->seqid == ntohs(*seqid));
> > + return rxts->msgtype == (*msgtype & 0xf) &&
> > + rxts->seqid == ntohs(*seqid);
>
> I think this isn't an improvement.
>
> Maybe:
> return rxts->msgtype == (*msgtype & 0xf) &&
> rxts->seqid == ntohs(*seqid);
> or
> return (rxts->msgtype == (*msgtype & 0xf)) &&
> (rxts->seqid == ntohs(*seqid));
Or even (modulo stupid errors):
return !((rxts->msgtype ^ (*msgtype & 0xf))
| (rxts->seqid ^ ntohs(*seqid)));
which saves a branch if the conditional is usually true.
David
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2013-12-20 9:48 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-18 5:38 [PATCH net-next 0/9] net: phy: fix checkpatch errors Florian Fainelli
2013-12-18 5:38 ` [PATCH net-next 1/9] net: phy: cicada: fix checkpath errors Florian Fainelli
2013-12-18 5:38 ` [PATCH net-next 2/9] net: phy: davicom: " Florian Fainelli
2013-12-18 5:38 ` [PATCH net-next 3/9] net: phy: dp83640: fix checkpath error Florian Fainelli
2013-12-19 22:31 ` Joe Perches
2013-12-20 9:46 ` David Laight
2013-12-18 5:38 ` [PATCH net-next 4/9] net: phy: icplus: " Florian Fainelli
2013-12-18 5:38 ` [PATCH net-next 5/9] net: phy: lxt: fix checkpath errors Florian Fainelli
2013-12-18 5:38 ` [PATCH net-next 6/9] net: phy: mdio_bus: fix checkpath error Florian Fainelli
2013-12-18 5:38 ` [PATCH net-next 7/9] net: phy: micrel: fix checkpath errors Florian Fainelli
2013-12-18 5:38 ` [PATCH net-next 8/9] net: phy: fix checkpatch errors Florian Fainelli
2013-12-18 6:07 ` Joe Perches
2013-12-19 20:48 ` Sergei Shtylyov
2013-12-18 5:38 ` [PATCH net-next 9/9] net: phy: spi_ks8995: " Florian Fainelli
2013-12-18 5:50 ` [PATCH net-next 0/9] net: phy: " David Miller
2013-12-19 22:27 ` Joe Perches
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).