OSDN Git Service

vfio-mdev/samples: make mdev_fops const and static
authorBhumika Goyal <bhumirks@gmail.com>
Sat, 30 Sep 2017 16:17:24 +0000 (21:47 +0530)
committerAlex Williamson <alex.williamson@redhat.com>
Mon, 2 Oct 2017 18:40:05 +0000 (12:40 -0600)
Make this const as it is only passed to a const argument of the function
mdev_register_device. Make it static as it is not referenced in any
other file.

Structure found using Coccinelle and changes done by hand.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
samples/vfio-mdev/mtty.c

index ca49568..09f255b 100644 (file)
@@ -1413,7 +1413,7 @@ struct attribute_group *mdev_type_groups[] = {
        NULL,
 };
 
-struct mdev_parent_ops mdev_fops = {
+static const struct mdev_parent_ops mdev_fops = {
        .owner                  = THIS_MODULE,
        .dev_attr_groups        = mtty_dev_groups,
        .mdev_attr_groups       = mdev_dev_groups,