char: virtio: constify attribute_group structures.
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Wed, 2 Aug 2017 11:21:08 +0000 (16:51 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Aug 2017 15:57:53 +0000 (17:57 +0200)
attribute_group are not supposed to change at runtime. All functions
working with attribute_group provided by <linux/sysfs.h> work with
const attribute_group. 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/char/virtio_console.c

index ad843eb02ae7be21ae7470c6cc840a30a3f6e272..06bd6351e3357af9e75fe7f2feb9ce9898eff10d 100644 (file)
@@ -1308,7 +1308,7 @@ static struct attribute *port_sysfs_entries[] = {
        NULL
 };
 
-static struct attribute_group port_attribute_group = {
+static const struct attribute_group port_attribute_group = {
        .name = NULL,           /* put in device directory */
        .attrs = port_sysfs_entries,
 };