hw/net/e1000e: Remove overwritten/duplicated register handlers
cover hw/net/e1000e: Remove overwritten/duplicated register handlers
The STATUS and FLSWDATA registers have overwritten/duplicated handlers. Remove them.
Philippe Mathieu-Daudé (2):
hw/net/e1000e: Remove overwritten read handler for STATUS register hw/net/e1000e: Remove duplicated write handler for FLSWDATA register
hw/net/e1000e_core.c | 2 -- 1 file changed, 2 deletions(-)
Signature · 1 line
2.26.2
PATCH 1/2 hw/net/e1000e: Remove overwritten read handler for STATUS register
The STATUS register readop handler is initialized first with the generic e1000e_mac_readreg() handler:
2861 #define e1000e_getreg(x) [x] = e1000e_mac_readreg
2862 typedef uint32_t (*readops)(E1000ECore *, int);
2863 static const readops e1000e_macreg_readops[] = {
....
2919 e1000e_getreg(STATUS),Then overwritten with the specific e1000e_get_status handler:
3018 [STATUS] = e1000e_get_status,
To avoid confusion, remove the overwritten initialization.
6f3fbe4ed0 ("net: Introduce e1000e device emulation")
--- hw/net/e1000e_core.c | 1 - 1 file changed, 1 deletion(-)
hw/net/e1000e_core.c +0 -1
@@ -2916,7 +2916,6 @@ static const readops e1000e_macreg_readops[] = {e1000e_getreg (TSYNCRXCTL ),e1000e_getreg (TDH ),e1000e_getreg (LEDCTL ), -e1000e_getreg (STATUS ),e1000e_getreg (TCTL ),e1000e_getreg (TDBAL ), e1000e_getreg(TDLEN),
Signature · 1 line
2.26.2
Re: [PATCH 1/2] hw/net/e1000e: Remove overwritten read handler for STATUS register
Quoted 10 lines · Philippe Mathieu-Daudé <[email protected]> 于2020年9月4日周五 下午9:14写道:
The STATUS register readop handler is initialized first with the generic
e1000e_mac_readreg()handler:2861 #define e1000e_getreg(x) [x] = e1000e_mac_readreg 2862 typedef uint32_t (*readops)(E1000ECore *, int); 2863 static const readops e1000e_macreg_readops[] = { .... 2919 e1000e_getreg(STATUS),
Quoted 8 lines
Then overwritten with the specific
e1000e_get_statushandler:3018 [STATUS] =
e1000e_get_status,To avoid confusion, remove the overwritten initialization.
6f3fbe4ed0("net: Introduce e1000e device emulation")Signed-off-by Philippe Mathieu-Daudé <[email protected]>
Quoted 20 lines
--- hw/net/e1000e_core.c | 1 - 1 file changed, 1 deletion(-)hw/net/e1000e_core.c +0
-2@@ -2916,7 +2916,6 @@ static const readops e1000e_macreg_readops[] = {e1000e_getreg (TSYNCRXCTL ),e1000e_getreg (TDH ),e1000e_getreg (LEDCTL ), -e1000e_getreg (STATUS ),e1000e_getreg (TCTL ),e1000e_getreg (TDBAL ), e1000e_getreg(TDLEN), --2.26.2
Laurent Vivier
AppliedRe: [PATCH 1/2] hw/net/e1000e: Remove overwritten read handler for STATUS register
In reply to Philippe Mathieu-DaudéLe 04/09/2020 à 15:14, Philippe Mathieu-Daudé a écrit :
Quoted 27 lines
The STATUS register readop handler is initialized first with the generic
e1000e_mac_readreg()handler:2861 #define e1000e_getreg(x) [x] = e1000e_mac_readreg 2862 typedef uint32_t (*readops)(E1000ECore *, int); 2863 static const readops e1000e_macreg_readops[] = { .... 2919 e1000e_getreg(STATUS),Then overwritten with the specific
e1000e_get_statushandler:3018 [STATUS] =
e1000e_get_status,To avoid confusion, remove the overwritten initialization.
6f3fbe4ed0("net: Introduce e1000e device emulation")Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/net/e1000e_core.c | 1 - 1 file changed, 1 deletion(-)hw/net/e1000e_core.c +0
-0
hw/net/e1000e_core.c static const readops e1000e_macreg_readops[] = { · line 2921
Quoted 7 lines
hw/net/e1000e_core.c +0
-1@@ -2916,7 +2916,6 @@ static const readops e1000e_macreg_readops[] = {e1000e_getreg (TSYNCRXCTL ),e1000e_getreg (TDH ),e1000e_getreg (LEDCTL ), -e1000e_getreg (STATUS ),e1000e_getreg (TCTL ),e1000e_getreg (TDBAL ), e1000e_getreg(TDLEN),
Applied to my trivial-patches branch.
Thanks,
Laurent
PATCH 2/2 hw/net/e1000e: Remove duplicated write handler for FLSWDATA register
In reply to Philippe Mathieu-Daudé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.
---
Noticed after looking for other cases of the previous patch.
--- hw/net/e1000e_core.c | 1 - 1 file changed, 1 deletion(-)
hw/net/e1000e_core.c +0 -1
@@ -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),
Signature · 1 line
2.26.2
Re: [PATCH 2/2] hw/net/e1000e: Remove duplicated write handler for FLSWDATA register
Quoted 11 lines · Philippe Mathieu-Daudé <[email protected]> 于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),
Quoted 4 lines
To avoid confusion, remove the duplicated initialization.
Fixes 6f3fbe4ed0 ("net: Introduce e1000e device emulation")Signed-off-by Philippe Mathieu-Daudé <[email protected]>
Quoted 22 lines
---
Noticed after looking for other cases of the previous patch.--- hw/net/e1000e_core.c | 1 - 1 file changed, 1 deletion(-)hw/net/e1000e_core.c +0
-2@@ -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
AppliedRe: [PATCH 2/2] hw/net/e1000e: Remove duplicated write handler for FLSWDATA register
In reply to Philippe Mathieu-DaudéLe 04/09/2020 à 15:14, Philippe Mathieu-Daudé a écrit :
Quoted 26 lines
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é <[email protected]>---
Noticed after looking for other cases of the previous patch.--- hw/net/e1000e_core.c | 1 - 1 file changed, 1 deletion(-)hw/net/e1000e_core.c +0
-0
hw/net/e1000e_core.c static const writeops e1000e_macreg_writeops[] = { · line 3146
Quoted 7 lines
hw/net/e1000e_core.c +0
-1@@ -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