]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
s390/hmcdrv: constify hmcdrv_ftp_ops structs
authorAya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Sun, 13 Dec 2015 18:51:49 +0000 (20:51 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Wed, 30 Dec 2015 09:34:25 +0000 (10:34 +0100)
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>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/char/hmcdrv_ftp.c

index d4b61d9088fb731f504b83fb7aeb9b9ccc1b6fe5..8cb7d8fbadd62983dbf56cebc25fb493a31a9860 100644 (file)
@@ -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