Skip to contentSkip to conversation

s390: char: constify hmcdrv_ftp_ops structs

PATCH Applied Aya Mahfouz 2 participants 2 messages Dec 13, 2015 – Dec 21, 2015 s390

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 s390: char: constify hmcdrv_ftp_ops structs

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

Detected and found using Coccinelle.

---
 drivers/s390/char/hmcdrv_ftp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/s390/char/hmcdrv_ftp.c +3 -3
index d4b61d9..8cb7d8f 100644
@@ -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
Signature · 6 lines
2.4.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz
#1 lore raw
Quoted 11 lines · Aya Mahfouz

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

Detected and found using Coccinelle.

---
 drivers/s390/char/hmcdrv_ftp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Applied, thanks.