public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] s390: add const to bin_attribute structures
@ 2017-08-02 16:07 Bhumika Goyal
  2017-08-02 16:07 ` [PATCH 1/2] s390/sclp: add const to bin_attribute structure Bhumika Goyal
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Bhumika Goyal @ 2017-08-02 16:07 UTC (permalink / raw)
  To: julia.lawall, sebott, oberpar, schwidefsky, heiko.carstens,
	linux-s390, linux-kernel
  Cc: Bhumika Goyal

Declare bin_attribute structures as const.

Bhumika Goyal (2):
  s390/sclp: add const to bin_attribute structure
  s390/cio: add const to bin_attribute structures

 drivers/s390/char/sclp_config.c | 2 +-
 drivers/s390/cio/chp.c          | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] s390/sclp: add const to bin_attribute structure
  2017-08-02 16:07 [PATCH 0/2] s390: add const to bin_attribute structures Bhumika Goyal
@ 2017-08-02 16:07 ` Bhumika Goyal
  2017-08-02 16:07 ` [PATCH 2/2] s390/cio: add const to bin_attribute structures Bhumika Goyal
  2017-08-03 10:59 ` [PATCH 0/2] s390: " Martin Schwidefsky
  2 siblings, 0 replies; 4+ messages in thread
From: Bhumika Goyal @ 2017-08-02 16:07 UTC (permalink / raw)
  To: julia.lawall, sebott, oberpar, schwidefsky, heiko.carstens,
	linux-s390, linux-kernel
  Cc: Bhumika Goyal

Declare bin_attribute structure as const as it is only passed as an
argument to the function sysfs_create_bin_file. This argument is of
type const, so declare the structure as const.

Cross compiled for s390 architecture.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
---
 drivers/s390/char/sclp_config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/s390/char/sclp_config.c b/drivers/s390/char/sclp_config.c
index 1406fb6..7003d52 100644
--- a/drivers/s390/char/sclp_config.c
+++ b/drivers/s390/char/sclp_config.c
@@ -135,7 +135,7 @@ static ssize_t sysfs_ofb_data_write(struct file *filp, struct kobject *kobj,
 	return rc ?: count;
 }
 
-static struct bin_attribute ofb_bin_attr = {
+static const struct bin_attribute ofb_bin_attr = {
 	.attr = {
 		.name = "event_data",
 		.mode = S_IWUSR,
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] s390/cio: add const to bin_attribute structures
  2017-08-02 16:07 [PATCH 0/2] s390: add const to bin_attribute structures Bhumika Goyal
  2017-08-02 16:07 ` [PATCH 1/2] s390/sclp: add const to bin_attribute structure Bhumika Goyal
@ 2017-08-02 16:07 ` Bhumika Goyal
  2017-08-03 10:59 ` [PATCH 0/2] s390: " Martin Schwidefsky
  2 siblings, 0 replies; 4+ messages in thread
From: Bhumika Goyal @ 2017-08-02 16:07 UTC (permalink / raw)
  To: julia.lawall, sebott, oberpar, schwidefsky, heiko.carstens,
	linux-s390, linux-kernel
  Cc: Bhumika Goyal

Add const to bin_attribute structures as they are only passed to the
functions device_{remove/create}_bin_file. The corresponding arguments
are of type const, so declare the structures to be const.

Cross compiled for s390 architecture.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
---
 drivers/s390/cio/chp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/s390/cio/chp.c b/drivers/s390/cio/chp.c
index 432fc40..f4166f8 100644
--- a/drivers/s390/cio/chp.c
+++ b/drivers/s390/cio/chp.c
@@ -143,7 +143,7 @@ static ssize_t chp_measurement_chars_read(struct file *filp,
 				       sizeof(chp->cmg_chars));
 }
 
-static struct bin_attribute chp_measurement_chars_attr = {
+static const struct bin_attribute chp_measurement_chars_attr = {
 	.attr = {
 		.name = "measurement_chars",
 		.mode = S_IRUSR,
@@ -197,7 +197,7 @@ static ssize_t chp_measurement_read(struct file *filp, struct kobject *kobj,
 	return count;
 }
 
-static struct bin_attribute chp_measurement_attr = {
+static const struct bin_attribute chp_measurement_attr = {
 	.attr = {
 		.name = "measurement",
 		.mode = S_IRUSR,
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] s390: add const to bin_attribute structures
  2017-08-02 16:07 [PATCH 0/2] s390: add const to bin_attribute structures Bhumika Goyal
  2017-08-02 16:07 ` [PATCH 1/2] s390/sclp: add const to bin_attribute structure Bhumika Goyal
  2017-08-02 16:07 ` [PATCH 2/2] s390/cio: add const to bin_attribute structures Bhumika Goyal
@ 2017-08-03 10:59 ` Martin Schwidefsky
  2 siblings, 0 replies; 4+ messages in thread
From: Martin Schwidefsky @ 2017-08-03 10:59 UTC (permalink / raw)
  To: Bhumika Goyal
  Cc: julia.lawall, sebott, oberpar, heiko.carstens, linux-s390,
	linux-kernel

On Wed,  2 Aug 2017 21:37:21 +0530
Bhumika Goyal <bhumirks@gmail.com> wrote:

> Declare bin_attribute structures as const.
> 
> Bhumika Goyal (2):
>   s390/sclp: add const to bin_attribute structure
>   s390/cio: add const to bin_attribute structures
> 
>  drivers/s390/char/sclp_config.c | 2 +-
>  drivers/s390/cio/chp.c          | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
 
Applied. Thanks!

-- 
blue skies,
   Martin.

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-08-03 10:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-02 16:07 [PATCH 0/2] s390: add const to bin_attribute structures Bhumika Goyal
2017-08-02 16:07 ` [PATCH 1/2] s390/sclp: add const to bin_attribute structure Bhumika Goyal
2017-08-02 16:07 ` [PATCH 2/2] s390/cio: add const to bin_attribute structures Bhumika Goyal
2017-08-03 10:59 ` [PATCH 0/2] s390: " Martin Schwidefsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox