From: YueHaibing <yuehaibing@huawei.com> To: <vkoul@kernel.org>, <sanyog.r.kale@intel.com>, <pierre-louis.bossart@linux.intel.com>, <ladis@linux-mips.org> Cc: <alsa-devel@alsa-project.org>, <linux-kernel@vger.kernel.org>, YueHaibing <yuehaibing@huawei.com> Subject: [PATCH v2 -next] soundwire: Fix -Wunused-function warning Date: Thu, 22 Aug 2019 22:54:08 +0800 [thread overview] Message-ID: <20190822145408.76272-1-yuehaibing@huawei.com> (raw) In-Reply-To: <20190816141409.49940-1-yuehaibing@huawei.com> 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
WARNING: multiple messages have this Message-ID (diff)
From: YueHaibing <yuehaibing@huawei.com> To: vkoul@kernel.org, sanyog.r.kale@intel.com, pierre-louis.bossart@linux.intel.com, ladis@linux-mips.org Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, YueHaibing <yuehaibing@huawei.com> Subject: [PATCH v2 -next] soundwire: Fix -Wunused-function warning Date: Thu, 22 Aug 2019 22:54:08 +0800 [thread overview] Message-ID: <20190822145408.76272-1-yuehaibing@huawei.com> (raw) In-Reply-To: <20190816141409.49940-1-yuehaibing@huawei.com> 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
next prev parent reply other threads:[~2019-08-22 14:57 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-08-16 14:14 [PATCH -next] soundwire: Fix -Wunused-function warning YueHaibing 2019-08-16 14:14 ` YueHaibing 2019-08-16 16:02 ` [alsa-devel] " Ladislav Michl 2019-08-22 14:54 ` YueHaibing [this message] 2019-08-22 14:54 ` [PATCH v2 " YueHaibing 2019-08-23 6:44 ` Vinod Koul 2019-08-23 8:10 ` Yuehaibing 2019-08-23 8:10 ` Yuehaibing 2019-08-25 2:36 ` kbuild test robot 2019-08-25 2:36 ` kbuild test robot
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20190822145408.76272-1-yuehaibing@huawei.com \ --to=yuehaibing@huawei.com \ --cc=alsa-devel@alsa-project.org \ --cc=ladis@linux-mips.org \ --cc=linux-kernel@vger.kernel.org \ --cc=pierre-louis.bossart@linux.intel.com \ --cc=sanyog.r.kale@intel.com \ --cc=vkoul@kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.