OSDN Git Service

USB: core: constify vm_operations_struct
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Thu, 24 Aug 2017 11:17:09 +0000 (16:47 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Aug 2017 09:39:31 +0000 (11:39 +0200)
vm_operations_struct are not supposed to change at runtime.
All functions working with const vm_operations_struct.
So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/core/devio.c

index 0ff0fed..318bb3b 100644 (file)
@@ -210,7 +210,7 @@ static void usbdev_vm_close(struct vm_area_struct *vma)
        dec_usb_memory_use_count(usbm, &usbm->vma_use_count);
 }
 
-static struct vm_operations_struct usbdev_vm_ops = {
+static const struct vm_operations_struct usbdev_vm_ops = {
        .open = usbdev_vm_open,
        .close = usbdev_vm_close
 };