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

Jani Nikula jani.nikula at linux.intel.com
Tue Oct 24 10:43:34 UTC 2023


On Fri, 20 Oct 2023, Mauro Carvalho Chehab <mauro.chehab at linux.intel.com> wrote:
> 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.

Please just include the header with the prototype.

BR,
Jani.

>
> 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;

-- 
Jani Nikula, Intel


More information about the Intel-xe mailing list