[Intel-xe] [PATCH 2/2] drm: xe: xe_display_misc: fix build with W=1

Mauro Carvalho Chehab mauro.chehab at linux.intel.com
Fri Oct 20 07:32:15 UTC 2023


From: Mauro Carvalho Chehab <mchehab at kernel.org>

As reported by LKP, when the Xe driver is built with W=1, a warning
will be produced:

	>> drivers/gpu/drm/xe/display/xe_display_misc.c:10:14: warning: no previous prototype for 'intel_gmch_vga_set_decode' [-Wmissing-prototypes]
	      10 | unsigned int intel_gmch_vga_set_decode(struct pci_dev *pdev, bool enable_decode)
	         |              ^~~~~~~~~~~~~~~~~~~~~~~~~

Currently, such function is just a stub, not used anywhere.
Yet, it is declared there without a prototype. As this is just a
reminder for something that will be implemented in the future,
change it to static and add __maybe_unused to disable compiler
warnings on it.

Reported-by: kernel test robot <lkp at intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202310201234.ZZLwdoiy-lkp@intel.com/
Signed-off-by: Mauro Carvalho Chehab <mchehab at kernel.org>
---
 drivers/gpu/drm/xe/display/xe_display_misc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/xe/display/xe_display_misc.c b/drivers/gpu/drm/xe/display/xe_display_misc.c
index 81ff97e704ea..53a53e500a09 100644
--- a/drivers/gpu/drm/xe/display/xe_display_misc.c
+++ b/drivers/gpu/drm/xe/display/xe_display_misc.c
@@ -7,7 +7,7 @@
 
 struct pci_dev;
 
-unsigned int intel_gmch_vga_set_decode(struct pci_dev *pdev, bool enable_decode)
+__maybe_unused static unsigned int intel_gmch_vga_set_decode(struct pci_dev *pdev, bool enable_decode)
 {
 	/* ToDo: Implement the actual handling of vga decode */
 	return 0;
-- 
2.41.0



More information about the Intel-xe mailing list