Re: [Xen-devel] [PATCH] drm/xen-front: Make structure fb_funcs constant

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Aug 13, 2019 at 10:32:00AM +0300, Oleksandr Andrushchenko wrote:
> 
> On 8/13/19 9:27 AM, Nishka Dasgupta wrote:
> > Static structure fb_funcs, of type drm_framebuffer_funcs, is used only
> > when it is passed to drm_gem_fb_create_with_funcs() as its last
> > argument. drm_gem_fb_create_with_funcs does not modify its lst argument
> > (fb_funcs) and hence fb_funcs is never modified. Therefore make fb_funcs
> > constant to protect it from further modification.
> > Issue found with Coccinelle.
> > 
> > Signed-off-by: Nishka Dasgupta <nishkadg.linux@xxxxxxxxx>
> Reviewed-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@xxxxxxxx>

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

> > ---
> >   drivers/gpu/drm/xen/xen_drm_front_kms.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/xen/xen_drm_front_kms.c b/drivers/gpu/drm/xen/xen_drm_front_kms.c
> > index c2955d375394..4a984f45555e 100644
> > --- a/drivers/gpu/drm/xen/xen_drm_front_kms.c
> > +++ b/drivers/gpu/drm/xen/xen_drm_front_kms.c
> > @@ -45,7 +45,7 @@ static void fb_destroy(struct drm_framebuffer *fb)
> >   	drm_gem_fb_destroy(fb);
> >   }
> > -static struct drm_framebuffer_funcs fb_funcs = {
> > +static const struct drm_framebuffer_funcs fb_funcs = {
> >   	.destroy = fb_destroy,
> >   };
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux