From: Nishka Dasgupta Date: Thu, 15 Aug 2019 05:49:24 +0000 (+0530) Subject: staging: gasket: apex: Make structure apex_desc constant X-Git-Tag: v5.4-rc1~134^2~137 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1548547e1d82532db70a75b9635427a727cd5590;p=thirdparty%2Flinux.git staging: gasket: apex: Make structure apex_desc constant Static structure apex_desc, of type gasket_driver_desc, is used only as an argument to the functions gasket_register_device() and gasket_unregister_device(). In the definitions of both these functions, their parameter is declared as const. Hence make apex_desc itself constant to protect it from modification. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta Link: https://lore.kernel.org/r/20190815054924.643-1-nishkadg.linux@gmail.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/gasket/apex_driver.c b/drivers/staging/gasket/apex_driver.c index 464648ee20368..2973bb920a264 100644 --- a/drivers/staging/gasket/apex_driver.c +++ b/drivers/staging/gasket/apex_driver.c @@ -659,7 +659,7 @@ static void apex_pci_remove(struct pci_dev *pci_dev) pci_disable_device(pci_dev); } -static struct gasket_driver_desc apex_desc = { +static const struct gasket_driver_desc apex_desc = { .name = "apex", .driver_version = APEX_DRIVER_VERSION, .major = 120,