Skip to contentSkip to conversation

drm/vboxvideo: Make structure vbox_fb_helper_funcs constant

PATCH In review Nishka Dasgupta 4 participants 8 messages Aug 13, 2019 – Aug 18, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/vboxvideo: Make structure vbox_fb_helper_funcs constant

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.

---
 drivers/gpu/drm/vboxvideo/vbox_drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/vboxvideo/vbox_drv.c +1 -1
index 02537ab9cc08..2b57ea3195f2 100644
@@ -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,
 };
 
Signature · 6 lines
2.19.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw

Hi,

Quoted 7 lines · Nishka Dasgupta

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.

Thank you for the patch, this looks good to me:

Regards,

Hans

Quoted 10 lines
---
  drivers/gpu/drm/vboxvideo/vbox_drv.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/vboxvideo/vbox_drv.c +0 -0
index 02537ab9cc08..2b57ea3195f2 100644

drivers/gpu/drm/vboxvideo/vbox_drv.c static const struct pci_device_id pciidlist[] = { · line 38

Quoted 8 lines
drivers/gpu/drm/vboxvideo/vbox_drv.c +1 -1
@@ -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,
  };
 

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw
Quoted 9 lines · Hans de Goede

Hi,

Quoted 6 lines · Nishka Dasgupta

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.

Quoted 5 lines
Quoted 1 line

Thank you for the patch, this looks good to me:

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

Quoted 22 lines

Regards,

Hans

Quoted 16 lines
---
  drivers/gpu/drm/vboxvideo/vbox_drv.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/vboxvideo/vbox_drv.c +1 -1
index 02537ab9cc08..2b57ea3195f2 100644
@@ -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,
  };
 
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#3 lore raw

Hi,

Quoted 10 lines · Daniel Vetter
Quoted 9 lines · Hans de Goede

Hi,

Quoted 6 lines · Nishka Dasgupta

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.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

Thank you for the patch, this looks good to me:

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

Actually I'm so used to the workflow in other subsystems I was expecting the subsys maintainer to pick it up. But I know that is not how it works for the drm subsys and since I'm the vboxvideo maintainer I guess it makes sense for me to pick this up and push it.

So yes I will pick this up and push it to drm-misc-next, sorry for the confusion.

Regards,

Hans

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
---
   drivers/gpu/drm/vboxvideo/vbox_drv.c | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 13 lines
Quoted 4 lines
Quoted 4 lines
drivers/gpu/drm/vboxvideo/vbox_drv.c +0 -0
index 02537ab9cc08..2b57ea3195f2 100644
Quoted 8 lines

drivers/gpu/drm/vboxvideo/vbox_drv.c static const struct pci_device_id pciidlist[] = { · line 37

Quoted 8 lines
drivers/gpu/drm/vboxvideo/vbox_drv.c +1 -1
@@ -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,
   };
 

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#4 lore raw
Quoted 19 lines · Hans de Goede

Hi,

Quoted 16 lines · Daniel Vetter
Quoted 14 lines · Hans de Goede

Hi,

Quoted 7 lines · Nishka Dasgupta

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.

Thank you for the patch, this looks good to me:

Quoted 7 lines
Quoted 2 lines

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

Actually I'm so used to the workflow in other subsystems I was expecting the subsys maintainer to pick it up. But I know that is not how it works for the drm subsys and since I'm the vboxvideo maintainer I guess it makes sense for me to pick this up and push it.

Yeah, drm subsystem maintainers are exceedingly lazy bastards. Same applies to subtree maintainers (at least in most cases).

Quoted 2 lines

So yes I will pick this up and push it to drm-misc-next, sorry for the confusion.

Thanks, Daniel

Quoted 23 lines

Regards,

Hans

Quoted 17 lines
Quoted 16 lines
Quoted 16 lines
---
   drivers/gpu/drm/vboxvideo/vbox_drv.c | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/vboxvideo/vbox_drv.c +1 -1
index 02537ab9cc08..2b57ea3195f2 100644
@@ -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,
   };
 
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#5 lore raw
Quoted 23 lines · Daniel Vetter
Quoted 22 lines · Hans de Goede

Hi,

Quoted 18 lines · Daniel Vetter
Quoted 9 lines · Hans de Goede

Hi,

Quoted 6 lines · Nishka Dasgupta

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.

Quoted 5 lines
Quoted 1 line

Thank you for the patch, this looks good to me:

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

Quoted 7 lines
Quoted 4 lines

Actually I'm so used to the workflow in other subsystems I was expecting the subsys maintainer to pick it up. But I know that is not how it works for the drm subsys and since I'm the vboxvideo maintainer I guess it makes sense for me to pick this up and push it.

Yeah, drm subsystem maintainers are exceedingly lazy bastards. Same applies to subtree maintainers (at least in most cases).

Be careful, this could end up in some popular news site.

Sam

Quoted 16 lines
Quoted 3 lines

So yes I will pick this up and push it to drm-misc-next, sorry for the confusion.

Thanks, Daniel

Quoted 10 lines

Regards,

Hans

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
---
   drivers/gpu/drm/vboxvideo/vbox_drv.c | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 22 lines
Quoted 13 lines
Quoted 13 lines
Quoted 12 lines
Quoted 12 lines
drivers/gpu/drm/vboxvideo/vbox_drv.c +1 -1
index 02537ab9cc08..2b57ea3195f2 100644
@@ -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,
   };
 
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#6 lore raw
Quoted 29 lines · Sam Ravnborg
Quoted 28 lines · Daniel Vetter
Quoted 26 lines · Hans de Goede

Hi,

Quoted 10 lines · Daniel Vetter
Quoted 9 lines · Hans de Goede

Hi,

Quoted 6 lines · Nishka Dasgupta

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.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

Thank you for the patch, this looks good to me:

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

Actually I'm so used to the workflow in other subsystems I was expecting the subsys maintainer to pick it up. But I know that is not how it works for the drm subsys and since I'm the vboxvideo maintainer I guess it makes sense for me to pick this up and push it.

Quoted 4 lines
Quoted 2 lines

Yeah, drm subsystem maintainers are exceedingly lazy bastards. Same applies to subtree maintainers (at least in most cases).

Be careful, this could end up in some popular news site.

Rule of Cool: Always be quotable :-)

Cheers, Daniel

Quoted 40 lines

Sam

Quoted 38 lines
Quoted 3 lines

So yes I will pick this up and push it to drm-misc-next, sorry for the confusion.

Thanks, Daniel

Quoted 23 lines

Regards,

Hans

Quoted 17 lines
Quoted 16 lines
Quoted 16 lines
---
   drivers/gpu/drm/vboxvideo/vbox_drv.c | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/vboxvideo/vbox_drv.c +1 -1
index 02537ab9cc08..2b57ea3195f2 100644
@@ -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,
   };
 
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#7 lore raw
In reply to Hans de Goede

Hi all,

Quoted 22 lines · Hans de Goede

Hi,

Quoted 10 lines · Daniel Vetter
Quoted 9 lines · Hans de Goede

Hi,

Quoted 6 lines · Nishka Dasgupta

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.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

Thank you for the patch, this looks good to me:

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

Quoted 7 lines

Actually I'm so used to the workflow in other subsystems I was expecting the subsys maintainer to pick it up. But I know that is not how it works for the drm subsys and since I'm the vboxvideo maintainer I guess it makes sense for me to pick this up and push it.

So yes I will pick this up and push it to drm-misc-next, sorry for the confusion.

I've pushed this to drm-misc-next now.

Regards,

Hans

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

---
   drivers/gpu/drm/vboxvideo/vbox_drv.c | 2 +-

   1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 13 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
drivers/gpu/drm/vboxvideo/vbox_drv.c +0 -0
index 02537ab9cc08..2b57ea3195f2 100644
Quoted 9 lines
Quoted 8 lines

drivers/gpu/drm/vboxvideo/vbox_drv.c static const struct pci_device_id pciidlist[] = { · line 37

Quoted 8 lines
drivers/gpu/drm/vboxvideo/vbox_drv.c +1 -1
@@ -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,
    };
 

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel