[PATCH] drm/vboxvideo: Make structure vbox_fb_helper_funcs constant

Daniel Vetter daniel at ffwll.ch
Wed Aug 14 17:26:34 UTC 2019


On Tue, Aug 13, 2019 at 09:57:19AM +0200, Hans de Goede wrote:
> Hi,
> 
> On 13-08-19 08:25, Nishka Dasgupta wrote:
> > The static structure vbox_fb_helper_funcs, of type drm_fb_helper_funcs,
> > is used only when it is passed as the third argument to
> > drm_fb_helper_fbdev_setup(), which does not modify it. Hence make it
> > constant to protect it from unintended modifications.
> > Issue found with Coccinelle.
> > 
> > Signed-off-by: Nishka Dasgupta <nishkadg.linux at gmail.com>
> 
> Thank you for the patch, this looks good to me:
> 
> Reviewed-by: Hans de Goede <hdegoede at redhat.com>

I'm assuming you'll apply this to drm-misc-next too? Good to state that,
to avoid confusion and coordination issues.
-Daniel

> 
> Regards,
> 
> Hans
> 
> 
> > ---
> >   drivers/gpu/drm/vboxvideo/vbox_drv.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/vboxvideo/vbox_drv.c b/drivers/gpu/drm/vboxvideo/vbox_drv.c
> > index 02537ab9cc08..2b57ea3195f2 100644
> > --- a/drivers/gpu/drm/vboxvideo/vbox_drv.c
> > +++ b/drivers/gpu/drm/vboxvideo/vbox_drv.c
> > @@ -32,7 +32,7 @@ static const struct pci_device_id pciidlist[] = {
> >   };
> >   MODULE_DEVICE_TABLE(pci, pciidlist);
> > -static struct drm_fb_helper_funcs vbox_fb_helper_funcs = {
> > +static const struct drm_fb_helper_funcs vbox_fb_helper_funcs = {
> >   	.fb_probe = vboxfb_create,
> >   };
> > 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the dri-devel mailing list