* [PATCH V2] net: 3com: 3c59x: remove set but not used variable 'mii_reg1'
@ 2020-01-06 12:53 yu kuai
2020-01-06 13:13 ` Michal Kubecek
2020-01-08 20:40 ` David Miller
0 siblings, 2 replies; 9+ messages in thread
From: yu kuai @ 2020-01-06 12:53 UTC (permalink / raw)
To: klassert, davem, hkallweit1, jakub.kicinski, hslester96, mst,
yang.wei9, willy, netdev
Cc: yukuai3, yi.zhang, zhengbin13
Fixes gcc '-Wunused-but-set-variable' warning:
drivers/net/ethernet/3com/3c59x.c: In function ‘vortex_up’:
drivers/net/ethernet/3com/3c59x.c:1551:9: warning: variable
‘mii_reg1’ set but not used [-Wunused-but-set-variable]
It is never used, and so can be removed.
Signed-off-by: yu kuai <yukuai3@huawei.com>
---
changes in V2
-The read might have side effects, don't remove it.
drivers/net/ethernet/3com/3c59x.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/3com/3c59x.c b/drivers/net/ethernet/3com/3c59x.c
index fc046797c0ea..6e537e5dc208 100644
--- a/drivers/net/ethernet/3com/3c59x.c
+++ b/drivers/net/ethernet/3com/3c59x.c
@@ -1548,7 +1548,7 @@ vortex_up(struct net_device *dev)
struct vortex_private *vp = netdev_priv(dev);
void __iomem *ioaddr = vp->ioaddr;
unsigned int config;
- int i, mii_reg1, mii_reg5, err = 0;
+ int i, mii_reg5, err = 0;
if (VORTEX_PCI(vp)) {
pci_set_power_state(VORTEX_PCI(vp), PCI_D0); /* Go active */
@@ -1605,7 +1605,6 @@ vortex_up(struct net_device *dev)
window_write32(vp, config, 3, Wn3_Config);
if (dev->if_port == XCVR_MII || dev->if_port == XCVR_NWAY) {
- mii_reg1 = mdio_read(dev, vp->phys[0], MII_BMSR);
mdio_read(dev, vp->phys[0], MII_LPA);
vp->partner_flow_ctrl = ((mii_reg5 & 0x0400) != 0);
vp->mii.full_duplex = vp->full_duplex;
--
2.17.2
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH V2] net: 3com: 3c59x: remove set but not used variable 'mii_reg1'
2020-01-06 12:53 [PATCH V2] net: 3com: 3c59x: remove set but not used variable 'mii_reg1' yu kuai
@ 2020-01-06 13:13 ` Michal Kubecek
2020-01-06 14:20 ` yukuai (C)
2020-01-08 20:40 ` David Miller
1 sibling, 1 reply; 9+ messages in thread
From: Michal Kubecek @ 2020-01-06 13:13 UTC (permalink / raw)
To: netdev
Cc: yu kuai, klassert, davem, hkallweit1, jakub.kicinski, hslester96,
mst, yang.wei9, willy, yi.zhang, zhengbin13
On Mon, Jan 06, 2020 at 08:53:37PM +0800, yu kuai wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
>
> drivers/net/ethernet/3com/3c59x.c: In function ‘vortex_up’:
> drivers/net/ethernet/3com/3c59x.c:1551:9: warning: variable
> ‘mii_reg1’ set but not used [-Wunused-but-set-variable]
>
> It is never used, and so can be removed.
>
> Signed-off-by: yu kuai <yukuai3@huawei.com>
> ---
> changes in V2
> -The read might have side effects, don't remove it.
[...]
> @@ -1605,7 +1605,6 @@ vortex_up(struct net_device *dev)
> window_write32(vp, config, 3, Wn3_Config);
>
> if (dev->if_port == XCVR_MII || dev->if_port == XCVR_NWAY) {
> - mii_reg1 = mdio_read(dev, vp->phys[0], MII_BMSR);
> mdio_read(dev, vp->phys[0], MII_LPA);
> vp->partner_flow_ctrl = ((mii_reg5 & 0x0400) != 0);
> vp->mii.full_duplex = vp->full_duplex;
Here you removed the read, as you did in previous version of the patch.
Michal Kubecek
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH V2] net: 3com: 3c59x: remove set but not used variable 'mii_reg1'
2020-01-06 13:13 ` Michal Kubecek
@ 2020-01-06 14:20 ` yukuai (C)
0 siblings, 0 replies; 9+ messages in thread
From: yukuai (C) @ 2020-01-06 14:20 UTC (permalink / raw)
To: Michal Kubecek, netdev
Cc: klassert, davem, hkallweit1, jakub.kicinski, hslester96, mst,
yang.wei9, willy, yi.zhang, zhengbin13
On 2020/1/6 21:13, Michal Kubecek wrote:
>> @@ -1605,7 +1605,6 @@ vortex_up(struct net_device *dev)
>> window_write32(vp, config, 3, Wn3_Config);
>>
>> if (dev->if_port == XCVR_MII || dev->if_port == XCVR_NWAY) {
>> - mii_reg1 = mdio_read(dev, vp->phys[0], MII_BMSR);
>> mdio_read(dev, vp->phys[0], MII_LPA);
>> vp->partner_flow_ctrl = ((mii_reg5 & 0x0400) != 0);
>> vp->mii.full_duplex = vp->full_duplex;
> Here you removed the read, as you did in previous version of the patch.
Sorry about the stupit mistake.
Yu Kuai
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH V2] net: 3com: 3c59x: remove set but not used variable 'mii_reg1'
2020-01-06 12:53 [PATCH V2] net: 3com: 3c59x: remove set but not used variable 'mii_reg1' yu kuai
2020-01-06 13:13 ` Michal Kubecek
@ 2020-01-08 20:40 ` David Miller
2020-01-08 21:59 ` Matthew Wilcox
1 sibling, 1 reply; 9+ messages in thread
From: David Miller @ 2020-01-08 20:40 UTC (permalink / raw)
To: yukuai3
Cc: klassert, hkallweit1, jakub.kicinski, hslester96, mst, yang.wei9,
willy, netdev, yi.zhang, zhengbin13
From: yu kuai <yukuai3@huawei.com>
Date: Mon, 6 Jan 2020 20:53:37 +0800
> Fixes gcc '-Wunused-but-set-variable' warning:
>
> drivers/net/ethernet/3com/3c59x.c: In function ‘vortex_up’:
> drivers/net/ethernet/3com/3c59x.c:1551:9: warning: variable
> ‘mii_reg1’ set but not used [-Wunused-but-set-variable]
>
> It is never used, and so can be removed.
>
> Signed-off-by: yu kuai <yukuai3@huawei.com>
> ---
> changes in V2
> -The read might have side effects, don't remove it.
Applied to net-next, thank you.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH V2] net: 3com: 3c59x: remove set but not used variable 'mii_reg1'
2020-01-08 20:40 ` David Miller
@ 2020-01-08 21:59 ` Matthew Wilcox
2020-01-08 23:05 ` David Miller
0 siblings, 1 reply; 9+ messages in thread
From: Matthew Wilcox @ 2020-01-08 21:59 UTC (permalink / raw)
To: David Miller
Cc: yukuai3, klassert, hkallweit1, jakub.kicinski, hslester96, mst,
yang.wei9, netdev, yi.zhang, zhengbin13
On Wed, Jan 08, 2020 at 12:40:21PM -0800, David Miller wrote:
> From: yu kuai <yukuai3@huawei.com>
> Date: Mon, 6 Jan 2020 20:53:37 +0800
>
> > Fixes gcc '-Wunused-but-set-variable' warning:
> >
> > drivers/net/ethernet/3com/3c59x.c: In function ‘vortex_up’:
> > drivers/net/ethernet/3com/3c59x.c:1551:9: warning: variable
> > ‘mii_reg1’ set but not used [-Wunused-but-set-variable]
> >
> > It is never used, and so can be removed.
> >
> > Signed-off-by: yu kuai <yukuai3@huawei.com>
> > ---
> > changes in V2
> > -The read might have side effects, don't remove it.
>
> Applied to net-next, thank you.
This waas a mistaken version; please revert and apply v3 instead.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH V2] net: 3com: 3c59x: remove set but not used variable 'mii_reg1'
2020-01-08 21:59 ` Matthew Wilcox
@ 2020-01-08 23:05 ` David Miller
2020-01-09 1:03 ` Matthew Wilcox
0 siblings, 1 reply; 9+ messages in thread
From: David Miller @ 2020-01-08 23:05 UTC (permalink / raw)
To: willy
Cc: yukuai3, klassert, hkallweit1, jakub.kicinski, hslester96, mst,
yang.wei9, netdev, yi.zhang, zhengbin13
From: Matthew Wilcox <willy@infradead.org>
Date: Wed, 8 Jan 2020 13:59:29 -0800
> This waas a mistaken version; please revert and apply v3 instead.
Are you sure?
[davem@localhost net-next]$ git show e102774588b3ac0d221ed2d03a5153e056f1354f >x.diff
[davem@localhost net-next]$ patch -p1 -R <x.diff
patching file drivers/net/ethernet/3com/3c59x.c
[davem@localhost net-next]$ mv ~/Downloads/V3-net-3com-3c59x-remove-set-but-not-used-variable-mii_reg1.patch ./
[davem@localhost net-next]$ patch -p1 <V3-net-3com-3c59x-remove-set-but-not-used-variable-mii_reg1.patch
patching file drivers/net/ethernet/3com/3c59x.c
[davem@localhost net-next]$ git diff
[davem@localhost net-next]$
There is no difference in the code of the commit at all between V2 and V3.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH V2] net: 3com: 3c59x: remove set but not used variable 'mii_reg1'
2020-01-08 23:05 ` David Miller
@ 2020-01-09 1:03 ` Matthew Wilcox
2020-01-09 1:14 ` yukuai (C)
2020-01-09 1:55 ` David Miller
0 siblings, 2 replies; 9+ messages in thread
From: Matthew Wilcox @ 2020-01-09 1:03 UTC (permalink / raw)
To: David Miller
Cc: yukuai3, klassert, hkallweit1, jakub.kicinski, hslester96, mst,
yang.wei9, netdev, yi.zhang, zhengbin13
On Wed, Jan 08, 2020 at 03:05:49PM -0800, David Miller wrote:
> From: Matthew Wilcox <willy@infradead.org>
> Date: Wed, 8 Jan 2020 13:59:29 -0800
>
> > This waas a mistaken version; please revert and apply v3 instead.
>
> Are you sure?
>
> [davem@localhost net-next]$ git show e102774588b3ac0d221ed2d03a5153e056f1354f >x.diff
> [davem@localhost net-next]$ patch -p1 -R <x.diff
> patching file drivers/net/ethernet/3com/3c59x.c
> [davem@localhost net-next]$ mv ~/Downloads/V3-net-3com-3c59x-remove-set-but-not-used-variable-mii_reg1.patch ./
> [davem@localhost net-next]$ patch -p1 <V3-net-3com-3c59x-remove-set-but-not-used-variable-mii_reg1.patch
> patching file drivers/net/ethernet/3com/3c59x.c
> [davem@localhost net-next]$ git diff
> [davem@localhost net-next]$
>
> There is no difference in the code of the commit at all between V2 and V3.
v2:
- mii_reg1 = mdio_read(dev, vp->phys[0], MII_BMSR);
v3:
- mii_reg1 = mdio_read(dev, vp->phys[0], MII_BMSR);
+ mdio_read(dev, vp->phys[0], MII_BMSR);
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH V2] net: 3com: 3c59x: remove set but not used variable 'mii_reg1'
2020-01-09 1:03 ` Matthew Wilcox
@ 2020-01-09 1:14 ` yukuai (C)
2020-01-09 1:55 ` David Miller
1 sibling, 0 replies; 9+ messages in thread
From: yukuai (C) @ 2020-01-09 1:14 UTC (permalink / raw)
To: Matthew Wilcox, David Miller
Cc: klassert, hkallweit1, jakub.kicinski, hslester96, mst, yang.wei9,
netdev, yi.zhang, zhengbin13
On 2020/1/9 9:03, Matthew Wilcox wrote:
> v2:
> - mii_reg1 = mdio_read(dev, vp->phys[0], MII_BMSR);
>
> v3:
> - mii_reg1 = mdio_read(dev, vp->phys[0], MII_BMSR);
> + mdio_read(dev, vp->phys[0], MII_BMSR);
Yes, V2 was a mistaken, my bad.
Please apply v3 instead.
Thanks!
Yu Kuai
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH V2] net: 3com: 3c59x: remove set but not used variable 'mii_reg1'
2020-01-09 1:03 ` Matthew Wilcox
2020-01-09 1:14 ` yukuai (C)
@ 2020-01-09 1:55 ` David Miller
1 sibling, 0 replies; 9+ messages in thread
From: David Miller @ 2020-01-09 1:55 UTC (permalink / raw)
To: willy
Cc: yukuai3, klassert, hkallweit1, jakub.kicinski, hslester96, mst,
yang.wei9, netdev, yi.zhang, zhengbin13
From: Matthew Wilcox <willy@infradead.org>
Date: Wed, 8 Jan 2020 17:03:44 -0800
> On Wed, Jan 08, 2020 at 03:05:49PM -0800, David Miller wrote:
>> From: Matthew Wilcox <willy@infradead.org>
>> Date: Wed, 8 Jan 2020 13:59:29 -0800
>>
>> > This waas a mistaken version; please revert and apply v3 instead.
>>
>> Are you sure?
>>
>> [davem@localhost net-next]$ git show e102774588b3ac0d221ed2d03a5153e056f1354f >x.diff
>> [davem@localhost net-next]$ patch -p1 -R <x.diff
>> patching file drivers/net/ethernet/3com/3c59x.c
>> [davem@localhost net-next]$ mv ~/Downloads/V3-net-3com-3c59x-remove-set-but-not-used-variable-mii_reg1.patch ./
>> [davem@localhost net-next]$ patch -p1 <V3-net-3com-3c59x-remove-set-but-not-used-variable-mii_reg1.patch
>> patching file drivers/net/ethernet/3com/3c59x.c
>> [davem@localhost net-next]$ git diff
>> [davem@localhost net-next]$
>>
>> There is no difference in the code of the commit at all between V2 and V3.
>
> v2:
> - mii_reg1 = mdio_read(dev, vp->phys[0], MII_BMSR);
>
> v3:
> - mii_reg1 = mdio_read(dev, vp->phys[0], MII_BMSR);
> + mdio_read(dev, vp->phys[0], MII_BMSR);
Then check what is in the GIT tree I probably applied V3 and replied accidently
to V2 :-)
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2020-01-09 1:55 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-06 12:53 [PATCH V2] net: 3com: 3c59x: remove set but not used variable 'mii_reg1' yu kuai
2020-01-06 13:13 ` Michal Kubecek
2020-01-06 14:20 ` yukuai (C)
2020-01-08 20:40 ` David Miller
2020-01-08 21:59 ` Matthew Wilcox
2020-01-08 23:05 ` David Miller
2020-01-09 1:03 ` Matthew Wilcox
2020-01-09 1:14 ` yukuai (C)
2020-01-09 1:55 ` David Miller
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).