[PATCH] staging: vchiq_arm: Make vchiq_platform_init() static
Simon Horman
horms at kernel.org
Tue Apr 18 22:39:47 PDT 2023
On Tue, Apr 18, 2023 at 11:39:58AM -0700, Nick Desaulniers wrote:
> On Tue, Apr 18, 2023 at 4:23 AM Simon Horman <horms at kernel.org> 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>
>
> I would have kept the return type on the original line and just added
> the explicit linkage on top, but it's fine and checkpatch doesn't
> complain. Thanks for the patch!
Thanks, I wasn't sure which was the best way to to on that.
I'll keep this in mind in future.
> Reviewed-by: Nick Desaulniers <ndesaulniers at google.com>
>
> > ---
> > 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);
> >
>
>
> --
> Thanks,
> ~Nick Desaulniers
>
More information about the linux-arm-kernel
mailing list