From 50bfde8d6eb32a316d5ee124563d54b5cf3eaaff Mon Sep 17 00:00:00 2001 From: Jack Pham Date: Mon, 15 Jul 2019 22:40:29 -0700 Subject: [PATCH] usb: host: xhci-plat: Avoid unneeded internal declaration warning When compiling with clang, the following warning is thrown: drivers/usb/host/xhci-plat.c:443:36: warning: variable 'usb_xhci_acpi_match' is not needed and will not be emitted [-Wunneeded-internal-declaration] This happens because the reference to the usb_xhci_acpi_match table is wrapped in the ACPI_PTR() macro which is NULL when CONFIG_ACPI is not defined. While __maybe_unused could be used here to quell the warning, this patch opts to simply wrap the definition of the match table within which follows the pattern used by other drivers. Change-Id: I92bdee0d22a99600ff085fe7089e16b93175abbc Signed-off-by: Jack Pham --- drivers/usb/host/xhci-plat.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index 998241f5fce3..04c223d9fc61 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -440,12 +440,14 @@ static const struct dev_pm_ops xhci_plat_pm_ops = { NULL) }; +#ifdef CONFIG_ACPI static const struct acpi_device_id usb_xhci_acpi_match[] = { /* XHCI-compliant USB Controller */ { "PNP0D10", }, { } }; MODULE_DEVICE_TABLE(acpi, usb_xhci_acpi_match); +#endif static struct platform_driver usb_xhci_driver = { .probe = xhci_plat_probe,