soundwire: Don't build sound.o without CONFIG_ACPI
PATCH 1/1 soundwire: Don't build sound.o without CONFIG_ACPI
clang warns when CONFIG_ACPI is unset:
../drivers/soundwire/slave.c:16:12: warning: unused function 'sdw_slave_add' [-Wunused-function]
static int sdw_slave_add(struct sdw_bus *bus,
^
1 warning generated.
Before commit 8676b3ca4673 ("soundwire: fix regmap dependencies and align with other serial links"), this code would only be compiled when ACPI was set because it was only selected by SOUNDWIRE_INTEL, which depends on ACPI.
Now, this code can be compiled without CONFIG_ACPI, which causes the above warning. The IS_ENABLED(CONFIG_ACPI) guard could be moved to avoid compiling the function; however, slave.c only contains three functions, two of which are static. Only compile slave.o when CONFIG_ACPI is set, where it will actually be used. bus.h contains a stub for sdw_acpi_find_slaves so there will be no issues with an undefined function.
This has been build tested with CONFIG_ACPI set and unset in combination with CONFIG_SOUNDWIRE unset, built in, and a module.
--- drivers/soundwire/Makefile | 6 +++++- drivers/soundwire/slave.c | 3 --- 2 files changed, 5 insertions(+), 4 deletions(-)
drivers/soundwire/Makefile +5 -1
@@ -4,9 +4,13 @@ # #Bus Objs -soundwire-bus-objs := bus_type.o bus.o slave.o mipi_disco.o stream.o +soundwire-bus-objs := bus_type.o bus.o mipi_disco.o stream.o obj-$(CONFIG_SOUNDWIRE) += soundwire-bus.o +ifdef CONFIG_ACPI +soundwire-bus-objs += slave.o +endif + #Cadence Objs soundwire-cadence-objs := cadence_master.o obj-$(CONFIG_SOUNDWIRE_CADENCE) += soundwire-cadence.o
drivers/soundwire/slave.c +0 -3
@@ -60,7 +60,6 @@ static int sdw_slave_add(struct sdw_bus *bus,return ret; } -#if IS_ENABLED (CONFIG_ACPI )/* * sdw_acpi_find_slaves() - Find Slave devices in Master ACPI node * @bus: SDW bus instance
@@ -110,5 +109,3 @@ int sdw_acpi_find_slaves(struct sdw_bus *bus)return 0 ; } - -#endif
Signature · 1 line
2.23.0.rc2
Quoted 21 lines · Nathan Chancellor
clang warns when
CONFIG_ACPIis unset:
../drivers/soundwire/slave.c:16:12: warning: unused function 'sdw_slave_add' [-Wunused-function]
static int sdw_slave_add(structsdw_bus*bus,^1 warning generated.
Before commit
8676b3ca4673("soundwire: fix regmap dependencies and align with other serial links"), this code would only be compiled when ACPI was set because it was only selected bySOUNDWIRE_INTEL, which depends on ACPI.Now, this code can be compiled without
CONFIG_ACPI, which causes the above warning. TheIS_ENABLED(CONFIG_ACPI)guard could be moved to avoid compiling the function; however,slave.conly contains three functions, two of which are static. Only compile slave.o whenCONFIG_ACPIis set, where it will actually be used.bus.hcontains a stub forsdw_acpi_find_slavesso there will be no issues with an undefined function.
Quoted 2 lines
This has been build tested with
CONFIG_ACPIset and unset in combination withCONFIG_SOUNDWIREunset, built in, and a module.
Thanks for the patch. Do you have a .config you can share offline so that we add it to our tests?
Quoted 14 lines
Fixes 8676b3ca4673 ("soundwire: fix regmap dependencies and align with other serial links")Signed-off-by Nathan Chancellor <[email protected]>--- drivers/soundwire/Makefile | 6 +++++- drivers/soundwire/slave.c | 3 --- 2 files changed, 5 insertions(+), 4 deletions(-)drivers/soundwire/Makefile +0
-0
drivers/soundwire/Makefile line 12
Quoted 10 lines
drivers/soundwire/Makefile +4
-1@@ -4,9 +4,13 @@ # #Bus Objs -soundwire-bus-objs := bus_type.o bus.o slave.o mipi_disco.o stream.o +soundwire-bus-objs := bus_type.o bus.o mipi_disco.o stream.o obj-$(CONFIG_SOUNDWIRE) += soundwire-bus.o +ifdef CONFIG_ACPI +soundwire-bus-objs += slave.o +endif
I am fine with the change, but we might as well rename the file acpi_slave.c then?
Quoted 23 lines
drivers/soundwire/Makefile +1
-0+ #Cadence Objs soundwire-cadence-objs := cadence_master.o obj-$(CONFIG_SOUNDWIRE_CADENCE) += soundwire-cadence.odrivers/soundwire/slave.c +0
-3@@ -60,7 +60,6 @@ static int sdw_slave_add(struct sdw_bus *bus,return ret; } -#if IS_ENABLED (CONFIG_ACPI )/* * sdw_acpi_find_slaves() - Find Slave devices in Master ACPI node * @bus: SDW bus instance @@ -110,5 +109,3 @@ int sdw_acpi_find_slaves(struct sdw_bus *bus)return 0 ; } - -#endif
Quoted 22 lines · Pierre-Louis Bossart
Quoted 21 lines · Nathan Chancellor
clang warns when
CONFIG_ACPIis unset:
../drivers/soundwire/slave.c:16:12: warning: unused function 'sdw_slave_add' [-Wunused-function]
static int sdw_slave_add(structsdw_bus*bus,^1 warning generated.
Before commit
8676b3ca4673("soundwire: fix regmap dependencies and align with other serial links"), this code would only be compiled when ACPI was set because it was only selected bySOUNDWIRE_INTEL, which depends on ACPI.Now, this code can be compiled without
CONFIG_ACPI, which causes the above warning. TheIS_ENABLED(CONFIG_ACPI)guard could be moved to avoid compiling the function; however,slave.conly contains three functions, two of which are static. Only compile slave.o whenCONFIG_ACPIis set, where it will actually be used.bus.hcontains a stub forsdw_acpi_find_slavesso there will be no issues with an undefined function.
Quoted 5 lines
Quoted 2 lines
This has been build tested with
CONFIG_ACPIset and unset in combination withCONFIG_SOUNDWIREunset, built in, and a module.Thanks for the patch. Do you have a .config you can share offline so that we add it to our tests?
I just took the arm64 defconfig and deleted CONFIG_ACPI and added CONFIG_SOUNDWIRE=y or =m to produce this warning. I initially found this on an arm64 allyesconfig build.
Quoted 10 lines
Quoted 10 lines
Fixes 8676b3ca4673 ("soundwire: fix regmap dependencies and align with other serial links")Signed-off-by Nathan Chancellor <[email protected]>--- drivers/soundwire/Makefile | 6 +++++- drivers/soundwire/slave.c | 3 --- 2 files changed, 5 insertions(+), 4 deletions(-)
Quoted 16 lines
drivers/soundwire/Makefile line 10
Quoted 13 lines
drivers/soundwire/Makefile +4
-1@@ -4,9 +4,13 @@ # #Bus Objs -soundwire-bus-objs := bus_type.o bus.o slave.o mipi_disco.o stream.o +soundwire-bus-objs := bus_type.o bus.o mipi_disco.o stream.o obj-$(CONFIG_SOUNDWIRE) += soundwire-bus.o +ifdef CONFIG_ACPI +soundwire-bus-objs += slave.o +endifI am fine with the change, but we might as well rename the file
acpi_slave.cthen?
Sure, I can do that rename and send a v2.
Quoted 23 lines
Quoted 22 lines
drivers/soundwire/Makefile +1
-0+ #Cadence Objs soundwire-cadence-objs := cadence_master.o obj-$(CONFIG_SOUNDWIRE_CADENCE) += soundwire-cadence.odrivers/soundwire/slave.c +0
-3@@ -60,7 +60,6 @@ static int sdw_slave_add(struct sdw_bus *bus,return ret; } -#if IS_ENABLED (CONFIG_ACPI )/* * sdw_acpi_find_slaves() - Find Slave devices in Master ACPI node * @bus: SDW bus instance @@ -110,5 +109,3 @@ int sdw_acpi_find_slaves(struct sdw_bus *bus)return 0 ; } - -#endif
Vinod Koul
maintainerQuoted 37 lines · Pierre-Louis Bossart
Quoted 21 lines · Nathan Chancellor
clang warns when
CONFIG_ACPIis unset:
../drivers/soundwire/slave.c:16:12: warning: unused function 'sdw_slave_add' [-Wunused-function]
static int sdw_slave_add(structsdw_bus*bus,^1 warning generated.
Before commit
8676b3ca4673("soundwire: fix regmap dependencies and align with other serial links"), this code would only be compiled when ACPI was set because it was only selected bySOUNDWIRE_INTEL, which depends on ACPI.Now, this code can be compiled without
CONFIG_ACPI, which causes the above warning. TheIS_ENABLED(CONFIG_ACPI)guard could be moved to avoid compiling the function; however,slave.conly contains three functions, two of which are static. Only compile slave.o whenCONFIG_ACPIis set, where it will actually be used.bus.hcontains a stub forsdw_acpi_find_slavesso there will be no issues with an undefined function.Quoted 2 lines
This has been build tested with
CONFIG_ACPIset and unset in combination withCONFIG_SOUNDWIREunset, built in, and a module.Thanks for the patch. Do you have a .config you can share offline so that we add it to our tests?
Quoted 9 lines
Fixes 8676b3ca4673 ("soundwire: fix regmap dependencies and align with other serial links")Signed-off-by Nathan Chancellor <[email protected]>--- drivers/soundwire/Makefile | 6 +++++- drivers/soundwire/slave.c | 3 --- 2 files changed, 5 insertions(+), 4 deletions(-)
Quoted 16 lines
drivers/soundwire/Makefile line 10
Quoted 13 lines
drivers/soundwire/Makefile +4
-1@@ -4,9 +4,13 @@ # #Bus Objs -soundwire-bus-objs := bus_type.o bus.o slave.o mipi_disco.o stream.o +soundwire-bus-objs := bus_type.o bus.o mipi_disco.o stream.o obj-$(CONFIG_SOUNDWIRE) += soundwire-bus.o +ifdef CONFIG_ACPI +soundwire-bus-objs += slave.o +endifI am fine with the change, but we might as well rename the file
acpi_slave.cthen?
Srini's change add support for DT for the same file, so It does not make sense to rename. Yes this patch tries to fix a warn which is there due to DT being not supported but with Srini's patches this warn should go away as sdw_slave_add() will be invoked by the DT counterpart
Sorry Nathan, we would have to live with the warn for few more days till I apply Srini's changes. So I am not taking this (or v2) patch
Thanks
Quoted 22 lines
Quoted 22 lines
drivers/soundwire/Makefile +1
-0+ #Cadence Objs soundwire-cadence-objs := cadence_master.o obj-$(CONFIG_SOUNDWIRE_CADENCE) += soundwire-cadence.odrivers/soundwire/slave.c +0
-3@@ -60,7 +60,6 @@ static int sdw_slave_add(struct sdw_bus *bus,return ret; } -#if IS_ENABLED (CONFIG_ACPI )/* * sdw_acpi_find_slaves() - Find Slave devices in Master ACPI node * @bus: SDW bus instance @@ -110,5 +109,3 @@ int sdw_acpi_find_slaves(struct sdw_bus *bus)return 0 ; } - -#endif
Signature · 1 line
~Vinod
Quoted 55 lines · Vinod Koul
Quoted 37 lines · Pierre-Louis Bossart
Quoted 21 lines · Nathan Chancellor
clang warns when
CONFIG_ACPIis unset:
../drivers/soundwire/slave.c:16:12: warning: unused function 'sdw_slave_add' [-Wunused-function]
static int sdw_slave_add(structsdw_bus*bus,^1 warning generated.
Before commit
8676b3ca4673("soundwire: fix regmap dependencies and align with other serial links"), this code would only be compiled when ACPI was set because it was only selected bySOUNDWIRE_INTEL, which depends on ACPI.Now, this code can be compiled without
CONFIG_ACPI, which causes the above warning. TheIS_ENABLED(CONFIG_ACPI)guard could be moved to avoid compiling the function; however,slave.conly contains three functions, two of which are static. Only compile slave.o whenCONFIG_ACPIis set, where it will actually be used.bus.hcontains a stub forsdw_acpi_find_slavesso there will be no issues with an undefined function.Quoted 2 lines
This has been build tested with
CONFIG_ACPIset and unset in combination withCONFIG_SOUNDWIREunset, built in, and a module.Thanks for the patch. Do you have a .config you can share offline so that we add it to our tests?
Quoted 9 lines
Fixes 8676b3ca4673 ("soundwire: fix regmap dependencies and align with other serial links")Signed-off-by Nathan Chancellor <[email protected]>--- drivers/soundwire/Makefile | 6 +++++- drivers/soundwire/slave.c | 3 --- 2 files changed, 5 insertions(+), 4 deletions(-)Quoted 16 lines
drivers/soundwire/Makefile line 10
Quoted 13 lines
drivers/soundwire/Makefile +4
-1@@ -4,9 +4,13 @@ # #Bus Objs -soundwire-bus-objs := bus_type.o bus.o slave.o mipi_disco.o stream.o +soundwire-bus-objs := bus_type.o bus.o mipi_disco.o stream.o obj-$(CONFIG_SOUNDWIRE) += soundwire-bus.o +ifdef CONFIG_ACPI +soundwire-bus-objs += slave.o +endifI am fine with the change, but we might as well rename the file
acpi_slave.cthen?
Quoted 8 lines
Srini's change add support for DT for the same file, so It does not make sense to rename. Yes this patch tries to fix a warn which is there due to DT being not supported but with Srini's patches this warn should go away as
sdw_slave_add()will be invoked by the DT counterpartSorry Nathan, we would have to live with the warn for few more days till I apply Srini's changes. So I am not taking this (or v2) patch
That is fine as I can apply this locally. Could you point me to these patches so that I can take a look at them?
Thanks for the reply!
Nathan
Vinod Koul
maintainerQuoted 12 lines · Nathan Chancellor
Quoted 11 lines · Vinod Koul
Quoted 4 lines · Pierre-Louis Bossart
On 8/13/19 1:10 AM, Nathan Chancellor wrote:
I am fine with the change, but we might as well rename the file
acpi_slave.cthen?Srini's change add support for DT for the same file, so It does not make sense to rename. Yes this patch tries to fix a warn which is there due to DT being not supported but with Srini's patches this warn should go away as
sdw_slave_add()will be invoked by the DT counterpart
Quoted 6 lines
Quoted 3 lines
Sorry Nathan, we would have to live with the warn for few more days till I apply Srini's changes. So I am not taking this (or v2) patch
That is fine as I can apply this locally. Could you point me to these patches so that I can take a look at them?
Here you go:
https://lore.kernel.org/lkml/[email protected]/
Signature · 1 line
~Vinod
PATCH v2 1/1 soundwire: Make slave.o depend on ACPI and rename to acpi_slave.o
In reply to Nathan Chancellorclang warns when CONFIG_ACPI is unset:
../drivers/soundwire/slave.c:16:12: warning: unused function 'sdw_slave_add' [-Wunused-function]
static int sdw_slave_add(struct sdw_bus *bus,
^
1 warning generated.
Before commit 8676b3ca4673 ("soundwire: fix regmap dependencies and align with other serial links"), this code would only be compiled when ACPI was set because it was only selected by SOUNDWIRE_INTEL, which depends on ACPI.
Now, this code can be compiled without CONFIG_ACPI, which causes the above warning. The IS_ENABLED(CONFIG_ACPI) guard could be moved to avoid compiling the function; however, slave.c only contains three functions, two of which are static. Since slave.c is completetely dependent on ACPI, rename it to acpi_slave.c and only compile it when CONFIG_ACPI is set so sdw_acpi_find_slaves will actually be used. bus.h contains a stub for sdw_acpi_find_slaves so there will be no issues with an undefined function.
This has been build tested with CONFIG_ACPI set and unset in combination with CONFIG_SOUNDWIRE unset, built in, and a module.
---
v1 -> v2:
* Rename slave.o to acpi_slave.o
* Reword commit message to reflect this
drivers/soundwire/Makefile | 6 +++++-
drivers/soundwire/{slave.c => acpi_slave.c} | 3 ---
2 files changed, 5 insertions(+), 4 deletions(-)
rename drivers/soundwire/{slave.c => acpi_slave.c} (98%)drivers/soundwire/Makefile +5 -1
@@ -4,9 +4,13 @@ # #Bus Objs -soundwire-bus-objs := bus_type.o bus.o slave.o mipi_disco.o stream.o +soundwire-bus-objs := bus_type.o bus.o mipi_disco.o stream.o obj-$(CONFIG_SOUNDWIRE) += soundwire-bus.o +ifdef CONFIG_ACPI +soundwire-bus-objs += acpi_slave.o +endif + #Cadence Objs soundwire-cadence-objs := cadence_master.o obj-$(CONFIG_SOUNDWIRE_CADENCE) += soundwire-cadence.o
drivers/soundwire/acpi_slave.c renamed from drivers/soundwire/slave.c +0 -3
@@ -60,7 +60,6 @@ static int sdw_slave_add(struct sdw_bus *bus,return ret; } -#if IS_ENABLED (CONFIG_ACPI )/* * sdw_acpi_find_slaves() - Find Slave devices in Master ACPI node * @bus: SDW bus instance
@@ -110,5 +109,3 @@ int sdw_acpi_find_slaves(struct sdw_bus *bus)return 0 ; } - -#endif
Signature · 1 line
2.23.0.rc2
Re: [PATCH v2] soundwire: Make slave.o depend on ACPI and rename to acpi_slave.o
Quoted 23 lines · Nathan Chancellor
clang warns when
CONFIG_ACPIis unset:
../drivers/soundwire/slave.c:16:12: warning: unused function 'sdw_slave_add' [-Wunused-function]
static int sdw_slave_add(structsdw_bus*bus,^1 warning generated.
Before commit
8676b3ca4673("soundwire: fix regmap dependencies and align with other serial links"), this code would only be compiled when ACPI was set because it was only selected bySOUNDWIRE_INTEL, which depends on ACPI.Now, this code can be compiled without
CONFIG_ACPI, which causes the above warning. TheIS_ENABLED(CONFIG_ACPI)guard could be moved to avoid compiling the function; however,slave.conly contains three functions, two of which are static. Sinceslave.cis completetely dependent on ACPI, rename it toacpi_slave.cand only compile it whenCONFIG_ACPIis set sosdw_acpi_find_slaveswill actually be used.bus.hcontains a stub forsdw_acpi_find_slavesso there will be no issues with an undefined function.
Quoted 6 lines
This has been build tested with
CONFIG_ACPIset and unset in combination withCONFIG_SOUNDWIREunset, built in, and a module.Fixes 8676b3ca4673 ("soundwire: fix regmap dependencies and align with other serial links")Signed-off-by Nathan Chancellor <[email protected]>
Looks good, thanks Nathan.
Quoted 59 lines
---
v1 -> v2:
* Rename slave.o to acpi_slave.o
* Reword commit message to reflect thisdrivers/soundwire/Makefile | 6 +++++- drivers/soundwire/{slave.c => acpi_slave.c} | 3 --- 2 files changed, 5 insertions(+), 4 deletions(-) rename drivers/soundwire/{slave.c => acpi_slave.c} (98%)drivers/soundwire/Makefile +5
-1@@ -4,9 +4,13 @@ # #Bus Objs -soundwire-bus-objs := bus_type.o bus.o slave.o mipi_disco.o stream.o +soundwire-bus-objs := bus_type.o bus.o mipi_disco.o stream.o obj-$(CONFIG_SOUNDWIRE) += soundwire-bus.o +ifdef CONFIG_ACPI +soundwire-bus-objs += acpi_slave.o +endif + #Cadence Objs soundwire-cadence-objs := cadence_master.o obj-$(CONFIG_SOUNDWIRE_CADENCE) += soundwire-cadence.odrivers/soundwire/acpi_slave.c renamed from drivers/soundwire/slave.c +0
-4@@ -60,7 +60,6 @@ static int sdw_slave_add(struct sdw_bus *bus,return ret; } -#if IS_ENABLED (CONFIG_ACPI )/* * sdw_acpi_find_slaves() - Find Slave devices in Master ACPI node * @bus: SDW bus instance @@ -110,5 +109,3 @@ int sdw_acpi_find_slaves(struct sdw_bus *bus)return 0 ; } - -#endif --2.23.0.rc2
--
You received this message because you are subscribed to the Google Groups "Clang Built Linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/20190813180929.22497-1-natechancellor%40gmail.com.
Signature · 2 lines
Thanks, ~Nick Desaulniers
Re: [alsa-devel] [PATCH v2] soundwire: Make slave.o depend on ACPI and rename to acpi_slave.o
In reply to Nathan ChancellorQuoted 22 lines · Nathan Chancellor
clang warns when
CONFIG_ACPIis unset:
../drivers/soundwire/slave.c:16:12: warning: unused function 'sdw_slave_add' [-Wunused-function]
static int sdw_slave_add(structsdw_bus*bus,^1 warning generated.
Before commit
8676b3ca4673("soundwire: fix regmap dependencies and align with other serial links"), this code would only be compiled when ACPI was set because it was only selected bySOUNDWIRE_INTEL, which depends on ACPI.Now, this code can be compiled without
CONFIG_ACPI, which causes the above warning. TheIS_ENABLED(CONFIG_ACPI)guard could be moved to avoid compiling the function; however,slave.conly contains three functions, two of which are static. Sinceslave.cis completetely dependent on ACPI, rename it toacpi_slave.cand only compile it whenCONFIG_ACPIis set sosdw_acpi_find_slaveswill actually be used.bus.hcontains a stub forsdw_acpi_find_slavesso there will be no issues with an undefined function.
Quoted 6 lines
This has been build tested with
CONFIG_ACPIset and unset in combination withCONFIG_SOUNDWIREunset, built in, and a module.Fixes 8676b3ca4673 ("soundwire: fix regmap dependencies and align with other serial links")Signed-off-by Nathan Chancellor <[email protected]>
Sounds good, thanks for the fix.
Quoted 53 lines
---
v1 -> v2:
* Rename slave.o to acpi_slave.o
* Reword commit message to reflect thisdrivers/soundwire/Makefile | 6 +++++- drivers/soundwire/{slave.c => acpi_slave.c} | 3 --- 2 files changed, 5 insertions(+), 4 deletions(-)rename
drivers/soundwire/{slave.c=>acpi_slave.c} (98%)drivers/soundwire/Makefile +5
-1@@ -4,9 +4,13 @@ # #Bus Objs -soundwire-bus-objs := bus_type.o bus.o slave.o mipi_disco.o stream.o +soundwire-bus-objs := bus_type.o bus.o mipi_disco.o stream.o obj-$(CONFIG_SOUNDWIRE) += soundwire-bus.o +ifdef CONFIG_ACPI +soundwire-bus-objs += acpi_slave.o +endif + #Cadence Objs soundwire-cadence-objs := cadence_master.o obj-$(CONFIG_SOUNDWIRE_CADENCE) += soundwire-cadence.odrivers/soundwire/acpi_slave.c renamed from drivers/soundwire/slave.c +0
-3@@ -60,7 +60,6 @@ static int sdw_slave_add(struct sdw_bus *bus,return ret; } -#if IS_ENABLED (CONFIG_ACPI )/* * sdw_acpi_find_slaves() - Find Slave devices in Master ACPI node * @bus: SDW bus instance @@ -110,5 +109,3 @@ int sdw_acpi_find_slaves(struct sdw_bus *bus)return 0 ; } - -#endif