w1: constify attribute_group structures.
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Fri, 28 Jul 2017 10:30:42 +0000 (16:00 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Aug 2017 15:15:16 +0000 (17:15 +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/w1/w1.c

index 74471e7aa5cc42d82305967bc5a1795363fb5895..0f614dfcb09f1c09157816f0d9fa08d72dec0b95 100644 (file)
@@ -568,7 +568,7 @@ static struct attribute *w1_master_default_attrs[] = {
        NULL
 };
 
-static struct attribute_group w1_master_defattr_group = {
+static const struct attribute_group w1_master_defattr_group = {
        .attrs = w1_master_default_attrs,
 };