linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] soundwire: Fix -Wunused-function warning
@ 2019-08-16 14:14 YueHaibing
  2019-08-16 16:02 ` [alsa-devel] " Ladislav Michl
  2019-08-22 14:54 ` [PATCH v2 " YueHaibing
  0 siblings, 2 replies; 6+ messages in thread
From: YueHaibing @ 2019-08-16 14:14 UTC (permalink / raw)
  To: vkoul, sanyog.r.kale, pierre-louis.bossart
  Cc: linux-kernel, alsa-devel, YueHaibing

If CONFIG_ACPI is not set, gcc warning this:

drivers/soundwire/slave.c:16:12: warning:
 'sdw_slave_add' defined but not used [-Wunused-function]

move them to #ifdef CONFIG_ACPI block.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/soundwire/slave.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/soundwire/slave.c b/drivers/soundwire/slave.c
index f39a581..34c7e65 100644
--- a/drivers/soundwire/slave.c
+++ b/drivers/soundwire/slave.c
@@ -6,6 +6,7 @@
 #include <linux/soundwire/sdw_type.h>
 #include "bus.h"
 
+#if IS_ENABLED(CONFIG_ACPI)
 static void sdw_slave_release(struct device *dev)
 {
 	struct sdw_slave *slave = dev_to_sdw_dev(dev);
@@ -60,7 +61,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
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [alsa-devel] [PATCH -next] soundwire: Fix -Wunused-function warning
  2019-08-16 14:14 [PATCH -next] soundwire: Fix -Wunused-function warning YueHaibing
@ 2019-08-16 16:02 ` Ladislav Michl
  2019-08-22 14:54 ` [PATCH v2 " YueHaibing
  1 sibling, 0 replies; 6+ messages in thread
From: Ladislav Michl @ 2019-08-16 16:02 UTC (permalink / raw)
  To: YueHaibing
  Cc: vkoul, sanyog.r.kale, pierre-louis.bossart, alsa-devel, linux-kernel

On Fri, Aug 16, 2019 at 10:14:09PM +0800, YueHaibing wrote:
> If CONFIG_ACPI is not set, gcc warning this:
> 
> drivers/soundwire/slave.c:16:12: warning:
>  'sdw_slave_add' defined but not used [-Wunused-function]
> 
> move them to #ifdef CONFIG_ACPI block.

...and that makes slave.c empty, right? So it boils down to
obj-$(CONFIG_ACPI) += slave.o

> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  drivers/soundwire/slave.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/soundwire/slave.c b/drivers/soundwire/slave.c
> index f39a581..34c7e65 100644
> --- a/drivers/soundwire/slave.c
> +++ b/drivers/soundwire/slave.c
> @@ -6,6 +6,7 @@
>  #include <linux/soundwire/sdw_type.h>
>  #include "bus.h"
>  
> +#if IS_ENABLED(CONFIG_ACPI)
>  static void sdw_slave_release(struct device *dev)
>  {
>  	struct sdw_slave *slave = dev_to_sdw_dev(dev);
> @@ -60,7 +61,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
> -- 
> 2.7.4
> 
> 
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2 -next] soundwire: Fix -Wunused-function warning
  2019-08-16 14:14 [PATCH -next] soundwire: Fix -Wunused-function warning YueHaibing
  2019-08-16 16:02 ` [alsa-devel] " Ladislav Michl
@ 2019-08-22 14:54 ` YueHaibing
  2019-08-23  6:44   ` Vinod Koul
  2019-08-25  2:36   ` kbuild test robot
  1 sibling, 2 replies; 6+ messages in thread
From: YueHaibing @ 2019-08-22 14:54 UTC (permalink / raw)
  To: vkoul, sanyog.r.kale, pierre-louis.bossart, ladis
  Cc: alsa-devel, linux-kernel, YueHaibing

If CONFIG_ACPI is not set, gcc warning this:

drivers/soundwire/slave.c:16:12: warning:
 'sdw_slave_add' defined but not used [-Wunused-function]

Now all code in slave.c is only used on ACPI enabled,
so compiles it while CONFIG_ACPI is set.

Reported-by: Hulk Robot <hulkci@huawei.com>
Suggested-by: Ladislav Michl <ladis@linux-mips.org>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
v2: use obj-$(CONFIG_ACPI) += slave.o
---
 drivers/soundwire/Makefile | 3 ++-
 drivers/soundwire/slave.c  | 3 ---
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/soundwire/Makefile b/drivers/soundwire/Makefile
index 45b7e50..a28bf3e 100644
--- a/drivers/soundwire/Makefile
+++ b/drivers/soundwire/Makefile
@@ -4,8 +4,9 @@
 #
 
 #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
+obj-$(CONFIG_ACPI) += slave.o
 
 #Cadence Objs
 soundwire-cadence-objs := cadence_master.o
diff --git a/drivers/soundwire/slave.c b/drivers/soundwire/slave.c
index f39a581..0dc188e 100644
--- a/drivers/soundwire/slave.c
+++ b/drivers/soundwire/slave.c
@@ -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.7.4



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 -next] soundwire: Fix -Wunused-function warning
  2019-08-22 14:54 ` [PATCH v2 " YueHaibing
@ 2019-08-23  6:44   ` Vinod Koul
  2019-08-23  8:10     ` Yuehaibing
  2019-08-25  2:36   ` kbuild test robot
  1 sibling, 1 reply; 6+ messages in thread
From: Vinod Koul @ 2019-08-23  6:44 UTC (permalink / raw)
  To: YueHaibing
  Cc: sanyog.r.kale, pierre-louis.bossart, ladis, alsa-devel, linux-kernel

On 22-08-19, 22:54, YueHaibing wrote:
> If CONFIG_ACPI is not set, gcc warning this:
> 
> drivers/soundwire/slave.c:16:12: warning:
>  'sdw_slave_add' defined but not used [-Wunused-function]
> 
> Now all code in slave.c is only used on ACPI enabled,
> so compiles it while CONFIG_ACPI is set.

Sorry YueHaibing as I have said to other patch doing this, this slave.c
is acpi specific but Srini has already send DT support for this so it
doesn't become acpi only and this warn also goes away. We should get the
DT support soon

> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Suggested-by: Ladislav Michl <ladis@linux-mips.org>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
> v2: use obj-$(CONFIG_ACPI) += slave.o
> ---
>  drivers/soundwire/Makefile | 3 ++-
>  drivers/soundwire/slave.c  | 3 ---
>  2 files changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/soundwire/Makefile b/drivers/soundwire/Makefile
> index 45b7e50..a28bf3e 100644
> --- a/drivers/soundwire/Makefile
> +++ b/drivers/soundwire/Makefile
> @@ -4,8 +4,9 @@
>  #
>  
>  #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
> +obj-$(CONFIG_ACPI) += slave.o
>  
>  #Cadence Objs
>  soundwire-cadence-objs := cadence_master.o
> diff --git a/drivers/soundwire/slave.c b/drivers/soundwire/slave.c
> index f39a581..0dc188e 100644
> --- a/drivers/soundwire/slave.c
> +++ b/drivers/soundwire/slave.c
> @@ -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.7.4
> 

-- 
~Vinod

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 -next] soundwire: Fix -Wunused-function warning
  2019-08-23  6:44   ` Vinod Koul
@ 2019-08-23  8:10     ` Yuehaibing
  0 siblings, 0 replies; 6+ messages in thread
From: Yuehaibing @ 2019-08-23  8:10 UTC (permalink / raw)
  To: Vinod Koul
  Cc: sanyog.r.kale, pierre-louis.bossart, ladis, alsa-devel, linux-kernel

On 2019/8/23 14:44, Vinod Koul wrote:
> On 22-08-19, 22:54, YueHaibing wrote:
>> If CONFIG_ACPI is not set, gcc warning this:
>>
>> drivers/soundwire/slave.c:16:12: warning:
>>  'sdw_slave_add' defined but not used [-Wunused-function]
>>
>> Now all code in slave.c is only used on ACPI enabled,
>> so compiles it while CONFIG_ACPI is set.
> 
> Sorry YueHaibing as I have said to other patch doing this, this slave.c
> is acpi specific but Srini has already send DT support for this so it
> doesn't become acpi only and this warn also goes away. We should get the
> DT support soon

Ok, thanks!

> 
>>
>> Reported-by: Hulk Robot <hulkci@huawei.com>
>> Suggested-by: Ladislav Michl <ladis@linux-mips.org>
>> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
>> ---
>> v2: use obj-$(CONFIG_ACPI) += slave.o
>> ---
>>  drivers/soundwire/Makefile | 3 ++-
>>  drivers/soundwire/slave.c  | 3 ---
>>  2 files changed, 2 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/soundwire/Makefile b/drivers/soundwire/Makefile
>> index 45b7e50..a28bf3e 100644
>> --- a/drivers/soundwire/Makefile
>> +++ b/drivers/soundwire/Makefile
>> @@ -4,8 +4,9 @@
>>  #
>>  
>>  #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
>> +obj-$(CONFIG_ACPI) += slave.o
>>  
>>  #Cadence Objs
>>  soundwire-cadence-objs := cadence_master.o
>> diff --git a/drivers/soundwire/slave.c b/drivers/soundwire/slave.c
>> index f39a581..0dc188e 100644
>> --- a/drivers/soundwire/slave.c
>> +++ b/drivers/soundwire/slave.c
>> @@ -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.7.4
>>
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 -next] soundwire: Fix -Wunused-function warning
  2019-08-22 14:54 ` [PATCH v2 " YueHaibing
  2019-08-23  6:44   ` Vinod Koul
@ 2019-08-25  2:36   ` kbuild test robot
  1 sibling, 0 replies; 6+ messages in thread
From: kbuild test robot @ 2019-08-25  2:36 UTC (permalink / raw)
  To: YueHaibing
  Cc: kbuild-all, vkoul, sanyog.r.kale, pierre-louis.bossart, ladis,
	alsa-devel, linux-kernel, YueHaibing

[-- Attachment #1: Type: text/plain, Size: 870 bytes --]

Hi YueHaibing,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on next-20190823]

url:    https://github.com/0day-ci/linux/commits/YueHaibing/soundwire-Fix-Wunused-function-warning/20190825-083159
config: x86_64-randconfig-g004-201934 (attached as .config)
compiler: gcc-7 (Debian 7.4.0-10) 7.4.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> ERROR: "sdw_acpi_find_slaves" [drivers/soundwire/soundwire-bus.ko] undefined!
   WARNING: "ftrace_set_clr_event" [vmlinux] is a static EXPORT_SYMBOL_GPL

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 26645 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-08-25  2:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-16 14:14 [PATCH -next] soundwire: Fix -Wunused-function warning YueHaibing
2019-08-16 16:02 ` [alsa-devel] " Ladislav Michl
2019-08-22 14:54 ` [PATCH v2 " YueHaibing
2019-08-23  6:44   ` Vinod Koul
2019-08-23  8:10     ` Yuehaibing
2019-08-25  2:36   ` kbuild test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).