[PATCH v2 2/2] checkpatch: Ensure that TypeInfos are const

Bernhard Beschow posted 2 patches 4 years ago
Maintainers: Christian Borntraeger <borntraeger@linux.ibm.com>, Matthew Rosato <mjrosato@linux.ibm.com>, "Philippe Mathieu-Daudé" <f4bug@amsat.org>, Jason Wang <jasowang@redhat.com>, Beniamino Galvani <b.galvani@gmail.com>, Halil Pasic <pasic@linux.ibm.com>, Fam Zheng <fam@euphon.net>, Ani Sinha <ani@anisinha.ca>, Alistair Francis <alistair@alistair23.me>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, Eric Farman <farman@linux.ibm.com>, Cornelia Huck <cohuck@redhat.com>, Eduardo Habkost <eduardo@habkost.net>, Igor Mammedov <imammedo@redhat.com>, Thomas Huth <thuth@redhat.com>, David Gibson <david@gibson.dropbear.id.au>, Havard Skinnemoen <hskinnemoen@google.com>, "Hervé Poussineau" <hpoussin@reactos.org>, Daniel Henrique Barboza <danielhb413@gmail.com>, "Alex Bennée" <alex.bennee@linaro.org>, Richard Henderson <richard.henderson@linaro.org>, Corey Minyard <minyard@acm.org>, Alex Williamson <alex.williamson@redhat.com>, "Cédric Le Goater" <clg@kaod.org>, "Michael S. Tsirkin" <mst@redhat.com>, Andrew Jeffery <andrew@aj.id.au>, Gerd Hoffmann <kraxel@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Peter Maydell <peter.maydell@linaro.org>, Laurent Vivier <laurent@vivier.eu>, Xiao Guangrong <xiaoguangrong.eric@gmail.com>, Joel Stanley <joel@jms.id.au>, Tyrone Ting <kfting@nuvoton.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, David Hildenbrand <david@redhat.com>, Greg Kurz <groug@kaod.org>
[PATCH v2 2/2] checkpatch: Ensure that TypeInfos are const
Posted by Bernhard Beschow 4 years ago
Now that all static TypeInfo instances are declared const, prevent that
new non-const instances are created.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
 scripts/checkpatch.pl | 1 +
 1 file changed, 1 insertion(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 5caa739db4..509a290041 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2883,6 +2883,7 @@ sub process {
 				SCSIBusInfo|
 				SCSIReqOps|
 				Spice[A-Z][a-zA-Z0-9]*Interface|
+				TypeInfo|
 				USBDesc[A-Z][a-zA-Z0-9]*|
 				VhostOps|
 				VMStateDescription|
-- 
2.34.1


Re: [PATCH v2 2/2] checkpatch: Ensure that TypeInfos are const
Posted by Philippe Mathieu-Daudé via 4 years ago
On 1/17/22 15:58, Bernhard Beschow wrote:
> Now that all static TypeInfo instances are declared const, prevent that
> new non-const instances are created.
> 
> Signed-off-by: Bernhard Beschow <shentey@gmail.com>
> ---
>  scripts/checkpatch.pl | 1 +
>  1 file changed, 1 insertion(+)

Thanks!

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>