2017-07-19 07:09:58

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 0/8] constify s390 attribute_group structures

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.

Arvind Yadav (9):
s390: zcrypt_queue: constify attribute_group structures.
s390: zcrypt_card: constify attribute_group structures.
s390: dasd_devmap: constify attribute_group structures.
s390: device: constify attribute_group structures.
s390: qeth: constify attribute_group structures.
s390: raw3270: constify attribute_group structures.
s390: tape_core: constify attribute_group structures.
s390: sclp_ocf: constify attribute_group structures.

drivers/s390/block/dasd_devmap.c | 2 +-
drivers/s390/char/raw3270.c | 2 +-
drivers/s390/char/sclp_ocf.c | 2 +-
drivers/s390/char/tape_core.c | 2 +-
drivers/s390/cio/device.c | 4 ++--
drivers/s390/crypto/zcrypt_card.c | 2 +-
drivers/s390/crypto/zcrypt_queue.c | 2 +-
drivers/s390/net/qeth_l3_sys.c | 8 ++++----
8 files changed, 12 insertions(+), 12 deletions(-)

--
1.9.1


2017-07-19 07:10:05

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 1/8] s390: zcrypt_queue: constify attribute_group structures.

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.

File size before:
text data bss dec hex filename
1361 96 0 1457 5b1 s390/crypto/zcrypt_queue.o

File size After adding 'const':
text data bss dec hex filename
1425 32 0 1457 5b1 s390/crypto/zcrypt_queue.o

Signed-off-by: Arvind Yadav <[email protected]>
---
drivers/s390/crypto/zcrypt_queue.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/s390/crypto/zcrypt_queue.c b/drivers/s390/crypto/zcrypt_queue.c
index a303f3b..4742be0 100644
--- a/drivers/s390/crypto/zcrypt_queue.c
+++ b/drivers/s390/crypto/zcrypt_queue.c
@@ -89,7 +89,7 @@ static DEVICE_ATTR(online, 0644, zcrypt_queue_online_show,
NULL,
};

-static struct attribute_group zcrypt_queue_attr_group = {
+static const struct attribute_group zcrypt_queue_attr_group = {
.attrs = zcrypt_queue_attrs,
};

--
1.9.1

2017-07-19 07:10:13

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 3/8] s390: dasd_devmap: constify attribute_group structures.

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 <[email protected]>
---
drivers/s390/block/dasd_devmap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/s390/block/dasd_devmap.c b/drivers/s390/block/dasd_devmap.c
index 779dce0..7b539d9 100644
--- a/drivers/s390/block/dasd_devmap.c
+++ b/drivers/s390/block/dasd_devmap.c
@@ -1634,7 +1634,7 @@ static DEVICE_ATTR(path_interval, 0644, dasd_path_interval_show,
NULL,
};

-static struct attribute_group dasd_attr_group = {
+static const struct attribute_group dasd_attr_group = {
.attrs = dasd_attrs,
};

--
1.9.1

2017-07-19 07:10:19

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 5/8] s390: qeth: constify attribute_group structures.

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.

File size before:
text data bss dec hex filename
6763 1216 0 7979 1f2b drivers/s390/net/qeth_l3_sys.o

File size After adding 'const':
text data bss dec hex filename
7019 960 0 7971 1f2b drivers/s390/net/qeth_l3_sys.o

Signed-off-by: Arvind Yadav <[email protected]>
---
drivers/s390/net/qeth_l3_sys.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/s390/net/qeth_l3_sys.c b/drivers/s390/net/qeth_l3_sys.c
index f2f94f5..1a80ce4 100644
--- a/drivers/s390/net/qeth_l3_sys.c
+++ b/drivers/s390/net/qeth_l3_sys.c
@@ -350,7 +350,7 @@ static DEVICE_ATTR(hsuid, 0644, qeth_l3_dev_hsuid_show,
NULL,
};

-static struct attribute_group qeth_l3_device_attr_group = {
+static const struct attribute_group qeth_l3_device_attr_group = {
.attrs = qeth_l3_device_attrs,
};

@@ -680,7 +680,7 @@ static QETH_DEVICE_ATTR(ipato_del6, del6, 0200, NULL,
NULL,
};

-static struct attribute_group qeth_device_ipato_group = {
+static const struct attribute_group qeth_device_ipato_group = {
.name = "ipa_takeover",
.attrs = qeth_ipato_device_attrs,
};
@@ -843,7 +843,7 @@ static QETH_DEVICE_ATTR(vipa_del6, del6, 0200, NULL,
NULL,
};

-static struct attribute_group qeth_device_vipa_group = {
+static const struct attribute_group qeth_device_vipa_group = {
.name = "vipa",
.attrs = qeth_vipa_device_attrs,
};
@@ -1006,7 +1006,7 @@ static QETH_DEVICE_ATTR(rxip_del6, del6, 0200, NULL,
NULL,
};

-static struct attribute_group qeth_device_rxip_group = {
+static const struct attribute_group qeth_device_rxip_group = {
.name = "rxip",
.attrs = qeth_rxip_device_attrs,
};
--
1.9.1

2017-07-19 07:10:22

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 6/8] s390: raw3270: constify attribute_group structures.

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.

File size before:
text data bss dec hex filename
8069 816 16 8901 22c5 drivers/s390/char/raw3270.o

File size After adding 'const':
text data bss dec hex filename
8133 752 16 8901 22c5 drivers/s390/char/raw3270.o

Signed-off-by: Arvind Yadav <[email protected]>
---
drivers/s390/char/raw3270.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/s390/char/raw3270.c b/drivers/s390/char/raw3270.c
index 710f229..5d4f053 100644
--- a/drivers/s390/char/raw3270.c
+++ b/drivers/s390/char/raw3270.c
@@ -1082,7 +1082,7 @@ struct raw3270_view *
NULL,
};

-static struct attribute_group raw3270_attr_group = {
+static const struct attribute_group raw3270_attr_group = {
.attrs = raw3270_attrs,
};

--
1.9.1

2017-07-19 07:10:26

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 7/8] s390: tape_core: constify attribute_group structures.

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.

File size before:
text data bss dec hex filename
11511 656 16 12183 2f97 drivers/s390/char/tape_core.o

File size After adding 'const':
text data bss dec hex filename
11575 592 16 12183 2f97 drivers/s390/char/tape_core.o

Signed-off-by: Arvind Yadav <[email protected]>
---
drivers/s390/char/tape_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/s390/char/tape_core.c b/drivers/s390/char/tape_core.c
index 3c379da..9dd4534 100644
--- a/drivers/s390/char/tape_core.c
+++ b/drivers/s390/char/tape_core.c
@@ -175,7 +175,7 @@ static int devid_to_int(struct ccw_dev_id *dev_id)
NULL
};

-static struct attribute_group tape_attr_group = {
+static const struct attribute_group tape_attr_group = {
.attrs = tape_attrs,
};

--
1.9.1

2017-07-19 07:10:30

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 8/8] s390: sclp_ocf: constify attribute_group structures.

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 <[email protected]>
---
drivers/s390/char/sclp_ocf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/s390/char/sclp_ocf.c b/drivers/s390/char/sclp_ocf.c
index f59b717..f9cbb1a 100644
--- a/drivers/s390/char/sclp_ocf.c
+++ b/drivers/s390/char/sclp_ocf.c
@@ -126,7 +126,7 @@ static ssize_t hmc_network_show(struct kobject *kobj,
NULL,
};

-static struct attribute_group ocf_attr_group = {
+static const struct attribute_group ocf_attr_group = {
.attrs = ocf_attrs,
};

--
1.9.1

2017-07-19 07:11:20

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 2/8] s390: zcrypt_card: constify attribute_group structures.

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.

File size before:
text data bss dec hex filename
1019 160 0 1179 49b drivers/s390/crypto/zcrypt_card.o

File size After adding 'const':
text data bss dec hex filename
1083 96 0 1179 49b drivers/s390/crypto/zcrypt_card.o

Signed-off-by: Arvind Yadav <[email protected]>
---
drivers/s390/crypto/zcrypt_card.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/s390/crypto/zcrypt_card.c b/drivers/s390/crypto/zcrypt_card.c
index 53436ea..f85dacf 100644
--- a/drivers/s390/crypto/zcrypt_card.c
+++ b/drivers/s390/crypto/zcrypt_card.c
@@ -98,7 +98,7 @@ static DEVICE_ATTR(online, 0644, zcrypt_card_online_show,
NULL,
};

-static struct attribute_group zcrypt_card_attr_group = {
+static const struct attribute_group zcrypt_card_attr_group = {
.attrs = zcrypt_card_attrs,
};

--
1.9.1

2017-07-19 07:11:19

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 4/8] s390: device: constify attribute_group structures.

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 <[email protected]>
---
drivers/s390/cio/device.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c
index 7be01a5..489b583 100644
--- a/drivers/s390/cio/device.c
+++ b/drivers/s390/cio/device.c
@@ -612,7 +612,7 @@ static ssize_t vpm_show(struct device *dev, struct device_attribute *attr,
NULL,
};

-static struct attribute_group io_subchannel_attr_group = {
+static const struct attribute_group io_subchannel_attr_group = {
.attrs = io_subchannel_attrs,
};

@@ -626,7 +626,7 @@ static ssize_t vpm_show(struct device *dev, struct device_attribute *attr,
NULL,
};

-static struct attribute_group ccwdev_attr_group = {
+static const struct attribute_group ccwdev_attr_group = {
.attrs = ccwdev_attrs,
};

--
1.9.1

2017-07-19 08:50:49

by Martin Schwidefsky

[permalink] [raw]
Subject: Re: [PATCH 0/8] constify s390 attribute_group structures

On Wed, 19 Jul 2017 12:39:09 +0530
Arvind Yadav <[email protected]> wrote:

> 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.
>
> Arvind Yadav (9):
> s390: zcrypt_queue: constify attribute_group structures.
> s390: zcrypt_card: constify attribute_group structures.
> s390: dasd_devmap: constify attribute_group structures.
> s390: device: constify attribute_group structures.
> s390: qeth: constify attribute_group structures.
> s390: raw3270: constify attribute_group structures.
> s390: tape_core: constify attribute_group structures.
> s390: sclp_ocf: constify attribute_group structures.
>
> drivers/s390/block/dasd_devmap.c | 2 +-
> drivers/s390/char/raw3270.c | 2 +-
> drivers/s390/char/sclp_ocf.c | 2 +-
> drivers/s390/char/tape_core.c | 2 +-
> drivers/s390/cio/device.c | 4 ++--
> drivers/s390/crypto/zcrypt_card.c | 2 +-
> drivers/s390/crypto/zcrypt_queue.c | 2 +-
> drivers/s390/net/qeth_l3_sys.c | 8 ++++----
> 8 files changed, 12 insertions(+), 12 deletions(-)

Applied to linux-s390:features for the next merge window. Thanks.

--
blue skies,
Martin.

"Reality continues to ruin my life." - Calvin.