* [PATCH net-next 1/1] forcedeth: remove unused variable
@ 2018-01-15 5:32 Zhu Yanjun
2018-01-15 20:11 ` David Miller
0 siblings, 1 reply; 4+ messages in thread
From: Zhu Yanjun @ 2018-01-15 5:32 UTC (permalink / raw)
To: netdev, keescook
The variable miistat is not used. So it is removed.
CC: Srinivas Eeda <srinivas.eeda@oracle.com>
CC: Joe Jin <joe.jin@oracle.com>
CC: Junxiao Bi <junxiao.bi@oracle.com>
Signed-off-by: Zhu Yanjun <yanjun.zhu@oracle.com>
---
drivers/net/ethernet/nvidia/forcedeth.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c
index 21e15cb..c518f8c 100644
--- a/drivers/net/ethernet/nvidia/forcedeth.c
+++ b/drivers/net/ethernet/nvidia/forcedeth.c
@@ -5510,11 +5510,8 @@ static int nv_open(struct net_device *dev)
/* One manual link speed update: Interrupts are enabled, future link
* speed changes cause interrupts and are handled by nv_link_irq().
*/
- {
- u32 miistat;
- miistat = readl(base + NvRegMIIStatus);
- writel(NVREG_MIISTAT_MASK_ALL, base + NvRegMIIStatus);
- }
+ writel(NVREG_MIISTAT_MASK_ALL, base + NvRegMIIStatus);
+
/* set linkspeed to invalid value, thus force nv_update_linkspeed
* to init hw */
np->linkspeed = 0;
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next 1/1] forcedeth: remove unused variable
2018-01-15 5:32 [PATCH net-next 1/1] forcedeth: remove unused variable Zhu Yanjun
@ 2018-01-15 20:11 ` David Miller
2018-01-17 2:59 ` [PATCHv2 " Zhu Yanjun
0 siblings, 1 reply; 4+ messages in thread
From: David Miller @ 2018-01-15 20:11 UTC (permalink / raw)
To: yanjun.zhu; +Cc: netdev, keescook
From: Zhu Yanjun <yanjun.zhu@oracle.com>
Date: Mon, 15 Jan 2018 00:32:22 -0500
> The variable miistat is not used. So it is removed.
>
> CC: Srinivas Eeda <srinivas.eeda@oracle.com>
> CC: Joe Jin <joe.jin@oracle.com>
> CC: Junxiao Bi <junxiao.bi@oracle.com>
> Signed-off-by: Zhu Yanjun <yanjun.zhu@oracle.com>
> ---
> drivers/net/ethernet/nvidia/forcedeth.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c
> index 21e15cb..c518f8c 100644
> --- a/drivers/net/ethernet/nvidia/forcedeth.c
> +++ b/drivers/net/ethernet/nvidia/forcedeth.c
> @@ -5510,11 +5510,8 @@ static int nv_open(struct net_device *dev)
> /* One manual link speed update: Interrupts are enabled, future link
> * speed changes cause interrupts and are handled by nv_link_irq().
> */
> - {
> - u32 miistat;
> - miistat = readl(base + NvRegMIIStatus);
> - writel(NVREG_MIISTAT_MASK_ALL, base + NvRegMIIStatus);
> - }
> + writel(NVREG_MIISTAT_MASK_ALL, base + NvRegMIIStatus);
> +
The readl() may have side effects and be necessary to clear some state
in the register. I don't think you can remove the readl() without
verifying this and making sure it really is not necessary.
I can't apply this patch, sorry.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCHv2 net-next 1/1] forcedeth: remove unused variable
2018-01-15 20:11 ` David Miller
@ 2018-01-17 2:59 ` Zhu Yanjun
2018-01-19 19:32 ` David Miller
0 siblings, 1 reply; 4+ messages in thread
From: Zhu Yanjun @ 2018-01-17 2:59 UTC (permalink / raw)
To: netdev, keescook
The variable miistat is not used. So it is removed.
CC: Srinivas Eeda <srinivas.eeda@oracle.com>
CC: Joe Jin <joe.jin@oracle.com>
CC: Junxiao Bi <junxiao.bi@oracle.com>
Signed-off-by: Zhu Yanjun <yanjun.zhu@oracle.com>
---
v1->v2: Keep readl function
---
drivers/net/ethernet/nvidia/forcedeth.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c
index 21e15cb..a3f6d51 100644
--- a/drivers/net/ethernet/nvidia/forcedeth.c
+++ b/drivers/net/ethernet/nvidia/forcedeth.c
@@ -5510,11 +5510,9 @@ static int nv_open(struct net_device *dev)
/* One manual link speed update: Interrupts are enabled, future link
* speed changes cause interrupts and are handled by nv_link_irq().
*/
- {
- u32 miistat;
- miistat = readl(base + NvRegMIIStatus);
- writel(NVREG_MIISTAT_MASK_ALL, base + NvRegMIIStatus);
- }
+ readl(base + NvRegMIIStatus);
+ writel(NVREG_MIISTAT_MASK_ALL, base + NvRegMIIStatus);
+
/* set linkspeed to invalid value, thus force nv_update_linkspeed
* to init hw */
np->linkspeed = 0;
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCHv2 net-next 1/1] forcedeth: remove unused variable
2018-01-17 2:59 ` [PATCHv2 " Zhu Yanjun
@ 2018-01-19 19:32 ` David Miller
0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2018-01-19 19:32 UTC (permalink / raw)
To: yanjun.zhu; +Cc: netdev, keescook
From: Zhu Yanjun <yanjun.zhu@oracle.com>
Date: Tue, 16 Jan 2018 21:59:41 -0500
> The variable miistat is not used. So it is removed.
>
> CC: Srinivas Eeda <srinivas.eeda@oracle.com>
> CC: Joe Jin <joe.jin@oracle.com>
> CC: Junxiao Bi <junxiao.bi@oracle.com>
> Signed-off-by: Zhu Yanjun <yanjun.zhu@oracle.com>
> ---
> v1->v2: Keep readl function
Applied.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-01-19 19:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-15 5:32 [PATCH net-next 1/1] forcedeth: remove unused variable Zhu Yanjun
2018-01-15 20:11 ` David Miller
2018-01-17 2:59 ` [PATCHv2 " Zhu Yanjun
2018-01-19 19:32 ` 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).