Skip to contentSkip to conversation

I2C: i2c-core, make attr groups const

PATCH Applied Jiri Slaby 2 participants 2 messages Aug 22, 2009 – Aug 29, 2009

Subsystems (2)
lore
Share & tools
lore

Jiri Slaby

author
#0 lore raw

PATCH 1/1 I2C: i2c-core, make attr groups const

Make attribute_group structure const, to avoid a compiler warning.

The groups were introduces by commit:
i2c: Convert i2c adapters to bus devices

---
 drivers/i2c/i2c-core.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/i2c/i2c-core.c +2 -2
index eeb9ae5..8d80fce 100644
@@ -214,7 +214,7 @@ static struct attribute_group i2c_dev_attr_group = {
 	.attrs		= i2c_dev_attrs,
 };
 
-static struct attribute_group *i2c_dev_attr_groups[] = {
+static const struct attribute_group *i2c_dev_attr_groups[] = {
 	&i2c_dev_attr_group,
 	NULL
 };
@@ -528,7 +528,7 @@ static struct attribute_group i2c_adapter_attr_group = {
 	.attrs		= i2c_adapter_attrs,
 };
 
-static struct attribute_group *i2c_adapter_attr_groups[] = {
+static const struct attribute_group *i2c_adapter_attr_groups[] = {
 	&i2c_adapter_attr_group,
 	NULL
 };
Signature · 1 line
1.6.3.3
Applied
#1 lore raw
Quoted 25 lines · Jiri Slaby

Make attribute_group structure const, to avoid a compiler warning.

The groups were introduces by commit:
i2c: Convert i2c adapters to bus devices

---
 drivers/i2c/i2c-core.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/i2c/i2c-core.c +1 -1
index eeb9ae5..8d80fce 100644
@@ -214,7 +214,7 @@ static struct attribute_group i2c_dev_attr_group = {
 	.attrs		= i2c_dev_attrs,
 };
 
-static struct attribute_group *i2c_dev_attr_groups[] = {
+static const struct attribute_group *i2c_dev_attr_groups[] = {
 	&i2c_dev_attr_group,
 	NULL
 };

drivers/i2c/i2c-core.c static struct attribute_group i2c_adapter_attr_group = { · line 534

Quoted 8 lines
drivers/i2c/i2c-core.c +1 -1
@@ -528,7 +528,7 @@ static struct attribute_group i2c_adapter_attr_group = {
 	.attrs		= i2c_adapter_attrs,
 };
 
-static struct attribute_group *i2c_adapter_attr_groups[] = {
+static const struct attribute_group *i2c_adapter_attr_groups[] = {
 	&i2c_adapter_attr_group,
 	NULL
 };

Merged into the faulty patches, thanks for reporting.

Signature · 1 line
Jean Delvare