Commit 0ef416e0 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Jakub Kicinski

net: xgbe: remove extraneous #ifdef checks

When both ACPI and OF are disabled, xgbe_v1 is unused and
causes a W=1 warning:

drivers/net/ethernet/amd/xgbe/xgbe-platform.c:533:39: error: unused variable 'xgbe_v1' [-Werror,-Wunused-const-variable]
static const struct xgbe_version_data xgbe_v1 = {

There is no real point in trying to save a few bytes for the match
tables, so just make them always visible.
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20240403080702.3509288-29-arnd@kernel.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 91188544
...@@ -538,7 +538,6 @@ static const struct xgbe_version_data xgbe_v1 = { ...@@ -538,7 +538,6 @@ static const struct xgbe_version_data xgbe_v1 = {
.tx_tstamp_workaround = 1, .tx_tstamp_workaround = 1,
}; };
#ifdef CONFIG_ACPI
static const struct acpi_device_id xgbe_acpi_match[] = { static const struct acpi_device_id xgbe_acpi_match[] = {
{ .id = "AMDI8001", { .id = "AMDI8001",
.driver_data = (kernel_ulong_t)&xgbe_v1 }, .driver_data = (kernel_ulong_t)&xgbe_v1 },
...@@ -546,9 +545,7 @@ static const struct acpi_device_id xgbe_acpi_match[] = { ...@@ -546,9 +545,7 @@ static const struct acpi_device_id xgbe_acpi_match[] = {
}; };
MODULE_DEVICE_TABLE(acpi, xgbe_acpi_match); MODULE_DEVICE_TABLE(acpi, xgbe_acpi_match);
#endif
#ifdef CONFIG_OF
static const struct of_device_id xgbe_of_match[] = { static const struct of_device_id xgbe_of_match[] = {
{ .compatible = "amd,xgbe-seattle-v1a", { .compatible = "amd,xgbe-seattle-v1a",
.data = &xgbe_v1 }, .data = &xgbe_v1 },
...@@ -556,7 +553,6 @@ static const struct of_device_id xgbe_of_match[] = { ...@@ -556,7 +553,6 @@ static const struct of_device_id xgbe_of_match[] = {
}; };
MODULE_DEVICE_TABLE(of, xgbe_of_match); MODULE_DEVICE_TABLE(of, xgbe_of_match);
#endif
static SIMPLE_DEV_PM_OPS(xgbe_platform_pm_ops, static SIMPLE_DEV_PM_OPS(xgbe_platform_pm_ops,
xgbe_platform_suspend, xgbe_platform_resume); xgbe_platform_suspend, xgbe_platform_resume);
...@@ -564,12 +560,8 @@ static SIMPLE_DEV_PM_OPS(xgbe_platform_pm_ops, ...@@ -564,12 +560,8 @@ static SIMPLE_DEV_PM_OPS(xgbe_platform_pm_ops,
static struct platform_driver xgbe_driver = { static struct platform_driver xgbe_driver = {
.driver = { .driver = {
.name = XGBE_DRV_NAME, .name = XGBE_DRV_NAME,
#ifdef CONFIG_ACPI
.acpi_match_table = xgbe_acpi_match, .acpi_match_table = xgbe_acpi_match,
#endif
#ifdef CONFIG_OF
.of_match_table = xgbe_of_match, .of_match_table = xgbe_of_match,
#endif
.pm = &xgbe_platform_pm_ops, .pm = &xgbe_platform_pm_ops,
}, },
.probe = xgbe_platform_probe, .probe = xgbe_platform_probe,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment