* [PATCH] serial: 8250_dw: #ifdef out dw8250_acpi_match if ACPI isn't set
@ 2016-12-23 12:33 Jisheng Zhang
2016-12-23 18:09 ` Greg KH
0 siblings, 1 reply; 3+ messages in thread
From: Jisheng Zhang @ 2016-12-23 12:33 UTC (permalink / raw)
To: gregkh, jslaby; +Cc: linux-serial, linux-kernel, Jisheng Zhang
dw8250_acpi_match is used only when ACPI is enabled. Fix the following
gcc warning when W=1 is set:
drivers/tty/serial/8250/8250_dw.c:640:36: warning: 'dw8250_acpi_match'
defined but not used [-Wunused-const-variable=]
Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
---
drivers/tty/serial/8250/8250_dw.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
index c89fafc972b6..bd43cbfd0783 100644
--- a/drivers/tty/serial/8250/8250_dw.c
+++ b/drivers/tty/serial/8250/8250_dw.c
@@ -637,6 +637,7 @@ static const struct of_device_id dw8250_of_match[] = {
};
MODULE_DEVICE_TABLE(of, dw8250_of_match);
+#ifdef CONFIG_ACPI
static const struct acpi_device_id dw8250_acpi_match[] = {
{ "INT33C4", 0 },
{ "INT33C5", 0 },
@@ -651,6 +652,7 @@ static const struct acpi_device_id dw8250_acpi_match[] = {
{ },
};
MODULE_DEVICE_TABLE(acpi, dw8250_acpi_match);
+#endif
static struct platform_driver dw8250_platform_driver = {
.driver = {
--
2.11.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] serial: 8250_dw: #ifdef out dw8250_acpi_match if ACPI isn't set
2016-12-23 12:33 [PATCH] serial: 8250_dw: #ifdef out dw8250_acpi_match if ACPI isn't set Jisheng Zhang
@ 2016-12-23 18:09 ` Greg KH
2016-12-26 5:28 ` Jisheng Zhang
0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2016-12-23 18:09 UTC (permalink / raw)
To: Jisheng Zhang; +Cc: jslaby, linux-serial, linux-kernel
On Fri, Dec 23, 2016 at 08:33:55PM +0800, Jisheng Zhang wrote:
> dw8250_acpi_match is used only when ACPI is enabled. Fix the following
> gcc warning when W=1 is set:
>
> drivers/tty/serial/8250/8250_dw.c:640:36: warning: 'dw8250_acpi_match'
> defined but not used [-Wunused-const-variable=]
Don't set W=1 then, this type of "fix" is foolish and is just going to
make code messier, sorry.
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] serial: 8250_dw: #ifdef out dw8250_acpi_match if ACPI isn't set
2016-12-23 18:09 ` Greg KH
@ 2016-12-26 5:28 ` Jisheng Zhang
0 siblings, 0 replies; 3+ messages in thread
From: Jisheng Zhang @ 2016-12-26 5:28 UTC (permalink / raw)
To: Greg KH; +Cc: jslaby, linux-serial, linux-kernel
Hi Greg,
On Fri, 23 Dec 2016 19:09:23 +0100 Greg KH wrote:
>
> On Fri, Dec 23, 2016 at 08:33:55PM +0800, Jisheng Zhang wrote:
> > dw8250_acpi_match is used only when ACPI is enabled. Fix the following
> > gcc warning when W=1 is set:
> >
> > drivers/tty/serial/8250/8250_dw.c:640:36: warning: 'dw8250_acpi_match'
> > defined but not used [-Wunused-const-variable=]
>
> Don't set W=1 then, this type of "fix" is foolish and is just going to
> make code messier, sorry.
Per my understanding of commit c9c6837d3931 ("kbuild: move
-Wunused-const-variable to W=1 warning level"), "Once we have eliminated
the majority of the warnings for both, we can put them back into the
default list.", so we'll have such warning one day without W=1 in the
future.
And FWICT, other devices drivers which could be used in ACPI and DT also
add the "#ifdef ACPI" to the acpi match table, such as:
drivers/ata/ahci_xgene.c
drivers/dma/dw/platform.c
drivers/i2c/busses/i2c-designware-platdrv.c
drivers/hid/i2c-hid/i2c-hid.c
drivers/usb/dwc3/core.c
Thanks,
Jisheng
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-12-26 5:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-23 12:33 [PATCH] serial: 8250_dw: #ifdef out dw8250_acpi_match if ACPI isn't set Jisheng Zhang
2016-12-23 18:09 ` Greg KH
2016-12-26 5:28 ` Jisheng Zhang
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).