diff mbox series

[2/2] hw/net/e1000e: Remove duplicated write handler for FLSWDATA register

Message ID 20200904131402.590055-3-f4bug@amsat.org
State New
Headers show
Series hw/net/e1000e: Remove overwritten/duplicated register handlers | expand

Commit Message

Philippe Mathieu-Daudé Sept. 4, 2020, 1:14 p.m. UTC
The FLSWDATA register writeop handler is initialized twice:

  3067 #define e1000e_putreg(x)    [x] = e1000e_mac_writereg
  3068 typedef void (*writeops)(E1000ECore *, int, uint32_t);
  3069 static const writeops e1000e_macreg_writeops[] = {
  ....
  3102     e1000e_putreg(FLSWDATA),
  ....
  3145     e1000e_putreg(FLSWDATA),

To avoid confusion, remove the duplicated initialization.

Fixes: 6f3fbe4ed0 ("net: Introduce e1000e device emulation")
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
Noticed after looking for other cases of the previous patch.
---
 hw/net/e1000e_core.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Li Qiang Sept. 5, 2020, 12:58 a.m. UTC | #1
Philippe Mathieu-Daudé <f4bug@amsat.org> 于2020年9月4日周五 下午9:14写道:
>
> The FLSWDATA register writeop handler is initialized twice:
>
>   3067 #define e1000e_putreg(x)    [x] = e1000e_mac_writereg
>   3068 typedef void (*writeops)(E1000ECore *, int, uint32_t);
>   3069 static const writeops e1000e_macreg_writeops[] = {
>   ....
>   3102     e1000e_putreg(FLSWDATA),
>   ....
>   3145     e1000e_putreg(FLSWDATA),
>
> To avoid confusion, remove the duplicated initialization.
>
> Fixes: 6f3fbe4ed0 ("net: Introduce e1000e device emulation")
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

Reviewed-by: Li Qiang <liq3ea@gmail.com>

> ---
> Noticed after looking for other cases of the previous patch.
> ---
>  hw/net/e1000e_core.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c
> index 5170e6a4563..bcfd46696ff 100644
> --- a/hw/net/e1000e_core.c
> +++ b/hw/net/e1000e_core.c
> @@ -3141,7 +3141,6 @@ static const writeops e1000e_macreg_writeops[] = {
>      e1000e_putreg(RXCFGL),
>      e1000e_putreg(TSYNCRXCTL),
>      e1000e_putreg(TSYNCTXCTL),
> -    e1000e_putreg(FLSWDATA),
>      e1000e_putreg(EXTCNF_SIZE),
>      e1000e_putreg(EEMNGCTL),
>      e1000e_putreg(RA),
> --
> 2.26.2
>
>
Laurent Vivier Sept. 9, 2020, 1:49 p.m. UTC | #2
Le 04/09/2020 à 15:14, Philippe Mathieu-Daudé a écrit :
> The FLSWDATA register writeop handler is initialized twice:
> 
>   3067 #define e1000e_putreg(x)    [x] = e1000e_mac_writereg
>   3068 typedef void (*writeops)(E1000ECore *, int, uint32_t);
>   3069 static const writeops e1000e_macreg_writeops[] = {
>   ....
>   3102     e1000e_putreg(FLSWDATA),
>   ....
>   3145     e1000e_putreg(FLSWDATA),
> 
> To avoid confusion, remove the duplicated initialization.
> 
> Fixes: 6f3fbe4ed0 ("net: Introduce e1000e device emulation")
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> Noticed after looking for other cases of the previous patch.
> ---
>  hw/net/e1000e_core.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c
> index 5170e6a4563..bcfd46696ff 100644
> --- a/hw/net/e1000e_core.c
> +++ b/hw/net/e1000e_core.c
> @@ -3141,7 +3141,6 @@ static const writeops e1000e_macreg_writeops[] = {
>      e1000e_putreg(RXCFGL),
>      e1000e_putreg(TSYNCRXCTL),
>      e1000e_putreg(TSYNCTXCTL),
> -    e1000e_putreg(FLSWDATA),
>      e1000e_putreg(EXTCNF_SIZE),
>      e1000e_putreg(EEMNGCTL),
>      e1000e_putreg(RA),
> 

Applied to my trivial-patches branch.

Thanks,
Laurent
diff mbox series

Patch

diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c
index 5170e6a4563..bcfd46696ff 100644
--- a/hw/net/e1000e_core.c
+++ b/hw/net/e1000e_core.c
@@ -3141,7 +3141,6 @@  static const writeops e1000e_macreg_writeops[] = {
     e1000e_putreg(RXCFGL),
     e1000e_putreg(TSYNCRXCTL),
     e1000e_putreg(TSYNCTXCTL),
-    e1000e_putreg(FLSWDATA),
     e1000e_putreg(EXTCNF_SIZE),
     e1000e_putreg(EEMNGCTL),
     e1000e_putreg(RA),