net: fix phy_string_for_interface
PATCH 1/1 net: fix phy_string_for_interface
commit ffb0f6f488b9 ("treewide: Rename PHY_INTERFACE_MODE_NONE to PHY_INTERFACE_MODE_NA") broke the phy_string_for_interface function. Fix it.
Fixes ffb0f6f488b9 ("treewide: Rename PHY_INTERFACE_MODE_NONE to PHY_INTERFACE_MODE_NA")
--- include/phy_interface.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/phy_interface.h +1 -1
@@ -85,7 +85,7 @@ static const char * const backplane_mode_strings[] = {static inline const char *phy_string_for_interface (phy_interface_t i) {/* Default to unknown */ -if (i >PHY_INTERFACE_MODE_NA ) +if (i >=PHY_INTERFACE_MODE_MAX ) i =PHY_INTERFACE_MODE_NA ;return phy_interface_strings[i];
Signature · 1 line
2.17.1
Quoted 10 lines · Tim Harvey
commit
ffb0f6f488b9("treewide: RenamePHY_INTERFACE_MODE_NONEtoPHY_INTERFACE_MODE_NA") broke thephy_string_for_interfacefunction. Fix it.Fixes
ffb0f6f488b9("treewide: RenamePHY_INTERFACE_MODE_NONEtoPHY_INTERFACE_MODE_NA")Signed-off-by Tim Harvey <[email protected]>Cc Marek Behún <[email protected]>Cc Stefan Roese <[email protected]>Cc Ramon Fried <[email protected]>Cc Vladimir Oltean <[email protected]>
Thanks,
Stefan
Quoted 9 lines
--- include/phy_interface.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/phy_interface.h +0
-0
include/phy_interface.h static const char * const backplane_mode_strings[] = { · line 91
Quoted 8 lines
include/phy_interface.h +1
-1@@ -85,7 +85,7 @@ static const char * const backplane_mode_strings[] = {static inline const char *phy_string_for_interface (phy_interface_t i) {/* Default to unknown */ -if (i >PHY_INTERFACE_MODE_NA ) +if (i >=PHY_INTERFACE_MODE_MAX ) i =PHY_INTERFACE_MODE_NA ;return phy_interface_strings[i];
Viele Grüße,
Stefan Roese
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
Quoted 19 lines · On Tue, 10 May 2022 15:49:10 -0700 Tim Harvey <[email protected]> wrote:
commit
ffb0f6f488b9("treewide: RenamePHY_INTERFACE_MODE_NONEtoPHY_INTERFACE_MODE_NA") broke thephy_string_for_interfacefunction. Fix it.Fixes
ffb0f6f488b9("treewide: RenamePHY_INTERFACE_MODE_NONEtoPHY_INTERFACE_MODE_NA")Signed-off-by Tim Harvey <[email protected]>Cc Marek Behún <[email protected]>Cc Stefan Roese <[email protected]>Cc Ramon Fried <[email protected]>Cc Vladimir Oltean <[email protected]>--- include/phy_interface.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/phy_interface.h +0
-0
include/phy_interface.h static const char * const backplane_mode_strings[] = { · line 91
Quoted 8 lines
include/phy_interface.h +1
-1@@ -85,7 +85,7 @@ static const char * const backplane_mode_strings[] = {static inline const char *phy_string_for_interface (phy_interface_t i) {/* Default to unknown */ -if (i >PHY_INTERFACE_MODE_NA ) +if (i >=PHY_INTERFACE_MODE_MAX ) i =PHY_INTERFACE_MODE_NA ;return phy_interface_strings[i];
Yikes.
Ramon Fried
Reviewed-byQuoted 30 lines · Marek Behún
Quoted 26 lines · On Tue, 10 May 2022 15:49:10 -0700 Tim Harvey <[email protected]> wrote:
commit
ffb0f6f488b9("treewide: RenamePHY_INTERFACE_MODE_NONEtoPHY_INTERFACE_MODE_NA") broke thephy_string_for_interfacefunction. Fix it.Fixes
ffb0f6f488b9("treewide: RenamePHY_INTERFACE_MODE_NONEtoPHY_INTERFACE_MODE_NA")Signed-off-by Tim Harvey <[email protected]>Cc Marek Behún <[email protected]>Cc Stefan Roese <[email protected]>Cc Ramon Fried <[email protected]>Cc Vladimir Oltean <[email protected]>--- include/phy_interface.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/phy_interface.h +1
-1@@ -85,7 +85,7 @@ static const char * const backplane_mode_strings[] = {static inline const char *phy_string_for_interface (phy_interface_t i) {/* Default to unknown */ -if (i >PHY_INTERFACE_MODE_NA ) +if (i >=PHY_INTERFACE_MODE_MAX ) i =PHY_INTERFACE_MODE_NA ;
Quoted 5 lines
include/phy_interface.h static const char * const backplane_mode_strings[] = { · line 91
Quoted 1 line
include/phy_interface.h +0
-0return phy_interface_strings[i];Yikes.
Reviewed-by Marek Behún <[email protected]>
Quoted 5 lines · Tim Harvey
commit
ffb0f6f488b9("treewide: RenamePHY_INTERFACE_MODE_NONEtoPHY_INTERFACE_MODE_NA") broke thephy_string_for_interfacefunction. Fix it.Fixes
ffb0f6f488b9("treewide: RenamePHY_INTERFACE_MODE_NONEtoPHY_INTERFACE_MODE_NA")
Quoted 8 lines
Signed-off-by Tim Harvey <[email protected]>Cc Marek Behún <[email protected]>Cc Stefan Roese <[email protected]>Cc Ramon Fried <[email protected]>Cc Vladimir Oltean <[email protected]>Reviewed-by Stefan Roese <[email protected]>Reviewed-by Marek Behún <[email protected]>Reviewed-by Ramon Fried <[email protected]>
Applied to u-boot/master, thanks!
Signature · 1 line
Tom