RM: shmobile: lager: phy fixup needs CONFIG_PHYLIB
PATCH 1/1 RM: shmobile: lager: phy fixup needs CONFIG_PHYLIB
Do not build the phy fixup unless CONFIG_PHYLIB is enabled. Other than not being useful it is also not possible to compile the code under this condition as phy_register_fixup_for_id() is not defined.
This problem was introduced by 48c8b96f21817aad ("ARM: shmobile: Lager: add Micrel KSZ8041 PHY fixup")
--- arch/arm/mach-shmobile/board-lager.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
arch/arm/mach-shmobile/board-lager.c +3 -1
@@ -245,7 +245,9 @@ static void __init lager_init(void) {lager_add_standard_devices (); -phy_register_fixup_for_id ("r8a7790-ether-ff:01" , lager_ksz8041_fixup); +if (IS_ENABLED (CONFIG_PHYLIB )) +phy_register_fixup_for_id ("r8a7790-ether-ff:01" , + lager_ksz8041_fixup); }static const char *const lager_boards_compat_dt[]__initconst = {
Signature · 1 line
1.8.4
PATCH 1/1 RM: shmobile: lager: phy fixup needs CONFIG_PHYLIB
Quoted 2 lines · Simon Horman
Do not build the phy fixup unless
CONFIG_PHYLIBis enabled. Other than not being useful it is also not possible to compile
s/compile/link/.
Quoted 2 lines
the code under this condition as
phy_register_fixup_for_id()is not defined.
Not only this function is absent...
Quoted 14 lines
This problem was introduced by
48c8b96f21817aad("ARM: shmobile: Lager: add Micrel KSZ8041 PHY fixup")Cc Sergei Shtylyov <[email protected]>Signed-off-by Simon Horman <[email protected]>--- arch/arm/mach-shmobile/board-lager.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)arch/arm/mach-shmobile/board-lager.c +0
-0
arch/arm/mach-shmobile/board-lager.c static void __init lager_init(void) · line 250
Quoted 7 lines
arch/arm/mach-shmobile/board-lager.c +3
-1@@ -245,7 +245,9 @@ static void __init lager_init(void) {lager_add_standard_devices (); -phy_register_fixup_for_id ("r8a7790-ether-ff:01" , lager_ksz8041_fixup); +if (IS_ENABLED (CONFIG_PHYLIB )) +phy_register_fixup_for_id ("r8a7790-ether-ff:01" , + lager_ksz8041_fixup);
Perhaps you would consider enclosing the fixup function itself into #ifdef
as it causes link errors as well? Doesn't seem necessary as gcc probably drops it anyway but for completeness' sake...
WBR, Sergei
PATCH 1/1 RM: shmobile: lager: phy fixup needs CONFIG_PHYLIB
Quoted 29 lines · Sergei Shtylyov
Quoted 2 lines · Simon Horman
Do not build the phy fixup unless
CONFIG_PHYLIBis enabled. Other than not being useful it is also not possible to compiles/compile/link/.
Quoted 2 lines
the code under this condition as
phy_register_fixup_for_id()is not defined.Not only this function is absent...
Quoted 17 lines
This problem was introduced by
48c8b96f21817aad("ARM: shmobile: Lager: add Micrel KSZ8041 PHY fixup")Cc Sergei Shtylyov <[email protected]>Signed-off-by Simon Horman <[email protected]>--- arch/arm/mach-shmobile/board-lager.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)arch/arm/mach-shmobile/board-lager.c +0
-0@@ -245,7 +245,9 @@ static void __init lager_init(void) {lager_add_standard_devices ();
Quoted 9 lines
arch/arm/mach-shmobile/board-lager.c static void __init lager_init(void) · line 250
Quoted 4 lines
arch/arm/mach-shmobile/board-lager.c +3
-1-phy_register_fixup_for_id ("r8a7790-ether-ff:01" , lager_ksz8041_fixup); +if (IS_ENABLED (CONFIG_PHYLIB )) +phy_register_fixup_for_id ("r8a7790-ether-ff:01" , + lager_ksz8041_fixup);Perhaps you would consider enclosing the fixup function itself
into #ifdef as it causes link errors as well? Doesn't seem necessary as gcc probably drops it anyway but for completeness' sake...
My understanding of the motivation for IS_ENABLED() is to take advantage of gcc optimising away unused code and making such problems disappear.
With this patch in place do you still see any warnings?
PATCH 1/1 RM: shmobile: lager: phy fixup needs CONFIG_PHYLIB
Quoted 37 lines · Simon Horman
Quoted 27 lines
Quoted 2 lines
Do not build the phy fixup unless
CONFIG_PHYLIBis enabled. Other than not being useful it is also not possible to compiles/compile/link/.
Quoted 2 lines
the code under this condition as
phy_register_fixup_for_id()is not defined.Not only this function is absent...
Quoted 17 lines
This problem was introduced by
48c8b96f21817aad("ARM: shmobile: Lager: add Micrel KSZ8041 PHY fixup")Cc Sergei Shtylyov <[email protected]>Signed-off-by Simon Horman <[email protected]>--- arch/arm/mach-shmobile/board-lager.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)arch/arm/mach-shmobile/board-lager.c +0
-0@@ -245,7 +245,9 @@ static void __init lager_init(void) {lager_add_standard_devices ();Quoted 9 lines
arch/arm/mach-shmobile/board-lager.c static void __init lager_init(void) · line 250
Quoted 4 lines
arch/arm/mach-shmobile/board-lager.c +3
-1-phy_register_fixup_for_id ("r8a7790-ether-ff:01" , lager_ksz8041_fixup); +if (IS_ENABLED (CONFIG_PHYLIB )) +phy_register_fixup_for_id ("r8a7790-ether-ff:01" , + lager_ksz8041_fixup);Perhaps you would consider enclosing the fixup function itself
into #ifdef as it causes link errors as well? Doesn't seem necessary as gcc probably drops it anyway but for completeness' sake...
Quoted 5 lines
My understanding of the motivation for
IS_ENABLED()is to take advantage of gcc optimising away unused code and making such problems disappear.With this patch in place do you still see any warnings?
No (but those were errors :-).
I'd like the changelog to be adjusted at least...
WBR, Sergei
PATCH 1/1 RM: shmobile: lager: phy fixup needs CONFIG_PHYLIB
Quoted 39 lines · Sergei Shtylyov
Quoted 36 lines · Simon Horman
Quoted 36 lines
Quoted 2 lines
Do not build the phy fixup unless
CONFIG_PHYLIBis enabled. Other than not being useful it is also not possible to compiles/compile/link/.
Quoted 2 lines
the code under this condition as
phy_register_fixup_for_id()is not defined.Not only this function is absent...
Quoted 14 lines
This problem was introduced by
48c8b96f21817aad("ARM: shmobile: Lager: add Micrel KSZ8041 PHY fixup")Cc Sergei Shtylyov <[email protected]>Signed-off-by Simon Horman <[email protected]>--- arch/arm/mach-shmobile/board-lager.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)arch/arm/mach-shmobile/board-lager.c +0
-0arch/arm/mach-shmobile/board-lager.c static void __init lager_init(void) · line 250
Quoted 7 lines
arch/arm/mach-shmobile/board-lager.c +3
-1@@ -245,7 +245,9 @@ static void __init lager_init(void) {lager_add_standard_devices (); -phy_register_fixup_for_id ("r8a7790-ether-ff:01" , lager_ksz8041_fixup); +if (IS_ENABLED (CONFIG_PHYLIB )) +phy_register_fixup_for_id ("r8a7790-ether-ff:01" , + lager_ksz8041_fixup);Perhaps you would consider enclosing the fixup function itself
into #ifdef as it causes link errors as well? Doesn't seem necessary as gcc probably drops it anyway but for completeness' sake...
Quoted 8 lines
Quoted 5 lines
My understanding of the motivation for
IS_ENABLED()is to take advantage of gcc optimising away unused code and making such problems disappear.With this patch in place do you still see any warnings?
No (but those were errors :-).
I'd like the changelog to be adjusted at least...
Sure. Would you like me to list in the changelog the compile problems that gcc reports without this patch? Or do you have something else in mind?
PATCH 1/1 RM: shmobile: lager: phy fixup needs CONFIG_PHYLIB
Hello.
Quoted 41 lines · Simon Horman
Quoted 40 lines
Quoted 40 lines
Quoted 27 lines
Quoted 2 lines
Do not build the phy fixup unless
CONFIG_PHYLIBis enabled. Other than not being useful it is also not possible to compiles/compile/link/.
Quoted 2 lines
the code under this condition as
phy_register_fixup_for_id()is not defined.Not only this function is absent...
Quoted 17 lines
This problem was introduced by
48c8b96f21817aad("ARM: shmobile: Lager: add Micrel KSZ8041 PHY fixup")Cc Sergei Shtylyov <[email protected]>Signed-off-by Simon Horman <[email protected]>--- arch/arm/mach-shmobile/board-lager.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)arch/arm/mach-shmobile/board-lager.c +0
-0@@ -245,7 +245,9 @@ static void __init lager_init(void) {lager_add_standard_devices ();Quoted 9 lines
arch/arm/mach-shmobile/board-lager.c static void __init lager_init(void) · line 250
Quoted 4 lines
arch/arm/mach-shmobile/board-lager.c +3
-1-phy_register_fixup_for_id ("r8a7790-ether-ff:01" , lager_ksz8041_fixup); +if (IS_ENABLED (CONFIG_PHYLIB )) +phy_register_fixup_for_id ("r8a7790-ether-ff:01" , + lager_ksz8041_fixup);Perhaps you would consider enclosing the fixup function itself
into #ifdef as it causes link errors as well? Doesn't seem necessary as gcc probably drops it anyway but for completeness' sake...My understanding of the motivation for
IS_ENABLED()is to take advantage of gcc optimising away unused code and making such problems disappear.
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
With this patch in place do you still see any warnings?
No (but those were errors :-).
I'd like the changelog to be adjusted at least...Sure. Would you like me to list in the changelog the compile problems that gcc reports without this patch?
Erm... gcc doesn't report any compile problems, it's ld that does report
link errors. That would be good to include them, yes.
Quoted 1 line
Or do you have something else in mind?
See the top of the mail for my comments to the changelog. Also, you need
to fix the subject which has "RM:" instead of "ARM:"...
WBR, Sergei
PATCH 1/1 RM: shmobile: lager: phy fixup needs CONFIG_PHYLIB
In reply to Sergei ShtylyovHello.
Quoted 28 lines · Sergei Shtylyov
Quoted 2 lines
Do not build the phy fixup unless
CONFIG_PHYLIBis enabled. Other than not being useful it is also not possible to compiles/compile/link/.
Quoted 2 lines
the code under this condition as
phy_register_fixup_for_id()is not defined.Not only this function is absent...
Quoted 18 lines
This problem was introduced by
48c8b96f21817aad("ARM: shmobile: Lager: add Micrel KSZ8041 PHY fixup")Cc Sergei Shtylyov <[email protected]>Signed-off-by Simon Horman <[email protected]>--- arch/arm/mach-shmobile/board-lager.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)arch/arm/mach-shmobile/board-lager.c +0
-0@@ -245,7 +245,9 @@ static void __init lager_init(void) {lager_add_standard_devices ();
Quoted 8 lines
arch/arm/mach-shmobile/board-lager.c static void __init lager_init(void) · line 250
Quoted 4 lines
arch/arm/mach-shmobile/board-lager.c +3
-1-phy_register_fixup_for_id ("r8a7790-ether-ff:01" , lager_ksz8041_fixup); +if (IS_ENABLED (CONFIG_PHYLIB )) +phy_register_fixup_for_id ("r8a7790-ether-ff:01" , + lager_ksz8041_fixup);Perhaps you would consider enclosing the fixup function itself into #ifdef
as it causes link errors as well? Doesn't seem necessary as gcc probably drops it anyway but for completeness' sake...
It's not necessary and it won't even work (causes compilation failure) as
my testing has shown, so sorry for wasting your time on this suggestion.
WBR, Sergei