[PATCH] staging: vchiq_arm: Make vchiq_platform_init() static

Nathan Chancellor nathan at kernel.org
Tue Apr 18 11:44:19 PDT 2023


On Tue, Apr 18, 2023 at 01:23:11PM +0200, Simon Horman wrote:
> vchiq_platform_init() is only used in this file so it can be static.
> 
> clang-16 with W=1 reports:
> 
>  drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:465:5: error: no previous prototype for function 'vchiq_platform_init' [-Werror,-Wmissing-prototypes]
>  int vchiq_platform_init(struct platform_device *pdev, struct vchiq_state *state)
>      ^
>  drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:465:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
> 
> Signed-off-by: Simon Horman <horms at kernel.org>

Introduced by commit 89cc4218f640 ("staging: vchiq_arm: drop unnecessary
declarations"), not sure it is worth a fixes tag since it is a W=1
warning.

Reviewed-by: Nathan Chancellor <nathan at kernel.org>

> ---
>  drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
> index 40dd62cf7399..59312b9f2058 100644
> --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
> +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
> @@ -462,7 +462,8 @@ free_pagelist(struct vchiq_instance *instance, struct vchiq_pagelist_info *pagel
>  	cleanup_pagelistinfo(instance, pagelistinfo);
>  }
>  
> -int vchiq_platform_init(struct platform_device *pdev, struct vchiq_state *state)
> +static int
> +vchiq_platform_init(struct platform_device *pdev, struct vchiq_state *state)
>  {
>  	struct device *dev = &pdev->dev;
>  	struct vchiq_drvdata *drvdata = platform_get_drvdata(pdev);
> 



More information about the linux-arm-kernel mailing list