Fix the following compilation warning: drivers/firmware/efi/sysfb_efi.c:345:39: warning: ‘efifb_fwnode_ops’ defined but not used [-Wunused-const-variable=] 345 | static const struct fwnode_operations efifb_fwnode_ops = { drivers/firmware/efi/sysfb_efi.c:238:35: warning: ‘efifb_dmi_swap_width_height’ defined but not used [-Wunused-const-variable=] 238 | static const struct dmi_system_id efifb_dmi_swap_width_height[] __initconst = { drivers/firmware/efi/sysfb_efi.c:188:35: warning: ‘efifb_dmi_system_table’ defined but not used [-Wunused-const-variable=] 188 | static const struct dmi_system_id efifb_dmi_system_table[] __initconst = { Only define the const variables when the CONFIG_EFI is enabled. Fixes: 8633ef82f101 ("drivers/firmware: consolidate EFI framebuffer setup for all arches") Signed-off-by: Zeng Heng <zengheng4@xxxxxxxxxx> --- drivers/firmware/efi/sysfb_efi.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/firmware/efi/sysfb_efi.c b/drivers/firmware/efi/sysfb_efi.c index cc807ed35aed..f75bfe9b197c 100644 --- a/drivers/firmware/efi/sysfb_efi.c +++ b/drivers/firmware/efi/sysfb_efi.c @@ -185,6 +185,7 @@ static int __init efifb_set_system(const struct dmi_system_id *id) &efifb_dmi_list[enumid] \ } +#ifdef CONFIG_EFI static const struct dmi_system_id efifb_dmi_system_table[] __initconst = { EFIFB_DMI_SYSTEM_ID("Apple Computer, Inc.", "iMac4,1", M_I17), /* At least one of these two will be right; maybe both? */ @@ -282,6 +283,7 @@ static const struct dmi_system_id efifb_dmi_swap_width_height[] __initconst = { }, {}, }; +#endif static bool efifb_overlaps_pci_range(const struct of_pci_range *range) { @@ -342,10 +344,6 @@ static int efifb_add_links(struct fwnode_handle *fwnode) return 0; } -static const struct fwnode_operations efifb_fwnode_ops = { - .add_links = efifb_add_links, -}; - #ifdef CONFIG_EFI static struct fwnode_handle efifb_fwnode; @@ -365,6 +363,10 @@ __init void sysfb_apply_efi_quirks(void) } } +static const struct fwnode_operations efifb_fwnode_ops = { + .add_links = efifb_add_links, +}; + __init void sysfb_set_efifb_fwnode(struct platform_device *pd) { if (screen_info.orig_video_isVGA == VIDEO_TYPE_EFI && IS_ENABLED(CONFIG_PCI)) { -- 2.25.1