public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] s390: char: constify hmcdrv_ftp_ops structs
@ 2015-12-13 18:51 Aya Mahfouz
  2015-12-21  9:48 ` Heiko Carstens
  0 siblings, 1 reply; 2+ messages in thread
From: Aya Mahfouz @ 2015-12-13 18:51 UTC (permalink / raw)
  To: Martin Schwidefsky, Heiko Carstens, Christophe Jaillet,
	Julia Lawall, linux-s390, linux-kernel

Constifies hmcdrv_ftp_ops structures in s390's char
driver since they are not modified after their
initialization.

Detected and found using Coccinelle.

Suggested-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
---
 drivers/s390/char/hmcdrv_ftp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/s390/char/hmcdrv_ftp.c b/drivers/s390/char/hmcdrv_ftp.c
index d4b61d9..8cb7d8f 100644
--- a/drivers/s390/char/hmcdrv_ftp.c
+++ b/drivers/s390/char/hmcdrv_ftp.c
@@ -37,7 +37,7 @@ struct hmcdrv_ftp_ops {
 static enum hmcdrv_ftp_cmdid hmcdrv_ftp_cmd_getid(const char *cmd, int len);
 static int hmcdrv_ftp_parse(char *cmd, struct hmcdrv_ftp_cmdspec *ftp);
 
-static struct hmcdrv_ftp_ops *hmcdrv_ftp_funcs; /* current operations */
+static const struct hmcdrv_ftp_ops *hmcdrv_ftp_funcs; /* current operations */
 static DEFINE_MUTEX(hmcdrv_ftp_mutex); /* mutex for hmcdrv_ftp_funcs */
 static unsigned hmcdrv_ftp_refcnt; /* start/shutdown reference counter */
 
@@ -290,13 +290,13 @@ ssize_t hmcdrv_ftp_cmd(char __kernel *cmd, loff_t offset,
  */
 int hmcdrv_ftp_startup(void)
 {
-	static struct hmcdrv_ftp_ops hmcdrv_ftp_zvm = {
+	static const struct hmcdrv_ftp_ops hmcdrv_ftp_zvm = {
 		.startup = diag_ftp_startup,
 		.shutdown = diag_ftp_shutdown,
 		.transfer = diag_ftp_cmd
 	};
 
-	static struct hmcdrv_ftp_ops hmcdrv_ftp_lpar = {
+	static const struct hmcdrv_ftp_ops hmcdrv_ftp_lpar = {
 		.startup = sclp_ftp_startup,
 		.shutdown = sclp_ftp_shutdown,
 		.transfer = sclp_ftp_cmd
-- 
2.4.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz

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

* Re: [PATCH] s390: char: constify hmcdrv_ftp_ops structs
  2015-12-13 18:51 [PATCH] s390: char: constify hmcdrv_ftp_ops structs Aya Mahfouz
@ 2015-12-21  9:48 ` Heiko Carstens
  0 siblings, 0 replies; 2+ messages in thread
From: Heiko Carstens @ 2015-12-21  9:48 UTC (permalink / raw)
  To: Aya Mahfouz
  Cc: Martin Schwidefsky, Christophe Jaillet, Julia Lawall, linux-s390,
	linux-kernel

On Sun, Dec 13, 2015 at 08:51:49PM +0200, Aya Mahfouz wrote:
> Constifies hmcdrv_ftp_ops structures in s390's char
> driver since they are not modified after their
> initialization.
> 
> Detected and found using Coccinelle.
> 
> Suggested-by: Julia Lawall <Julia.Lawall@lip6.fr>
> Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
> ---
>  drivers/s390/char/hmcdrv_ftp.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Applied, thanks.


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

end of thread, other threads:[~2015-12-21  9:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-13 18:51 [PATCH] s390: char: constify hmcdrv_ftp_ops structs Aya Mahfouz
2015-12-21  9:48 ` Heiko Carstens

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