OSDN Git Service

staging: lustre: obdclass: constify obd_psdev_fops structure
authorJulia Lawall <Julia.Lawall@lip6.fr>
Sun, 28 Aug 2016 21:45:11 +0000 (23:45 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Sep 2016 15:29:21 +0000 (17:29 +0200)
obd_psdev_fops, of type struct file_operations, is never modified, so
declare it as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/obdclass/linux/linux-module.c

index 27a72d8..2b691d8 100644 (file)
@@ -192,7 +192,7 @@ static long obd_class_ioctl(struct file *filp, unsigned int cmd,
 }
 
 /* declare character device */
-static struct file_operations obd_psdev_fops = {
+static const struct file_operations obd_psdev_fops = {
        .owner    = THIS_MODULE,
        .unlocked_ioctl = obd_class_ioctl, /* unlocked_ioctl */
        .open      = obd_class_open,      /* open */