Skip to contentSkip to conversation

nfsd: constify write_op[]

PATCH In review Eric Biggers 2 participants 2 messages Jul 17, 2018 – Aug 1, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfsd: constify write_op[]

From: Eric Biggers <[email protected]>

write_op[] is never modified, so make it 'const'.

---
 fs/nfsd/nfsctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfsd/nfsctl.c +1 -1
index 2c46451c7d60..19aa4ded2590 100644
@@ -73,7 +73,7 @@ static ssize_t write_recoverydir(struct file *file, char *buf, size_t size);
 static ssize_t write_v4_end_grace(struct file *file, char *buf, size_t size);
 #endif
 
-static ssize_t (*write_op[])(struct file *, char *, size_t) = {
+static ssize_t (*const write_op[])(struct file *, char *, size_t) = {
 	[NFSD_Fh] = write_filehandle,
 	[NFSD_FO_UnlockIP] = write_unlock_ip,
 	[NFSD_FO_UnlockFS] = write_unlock_fs,
Signature · 1 line
2.18.0.203.gfac676dfb9-goog
#1 lore raw
Quoted 3 lines · Eric Biggers

From: Eric Biggers <[email protected]>

write_op[] is never modified, so make it 'const'.

Thanks, applying for 2.19.--b.

Quoted 21 lines
---
 fs/nfsd/nfsctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfsd/nfsctl.c +1 -1
index 2c46451c7d60..19aa4ded2590 100644
@@ -73,7 +73,7 @@ static ssize_t write_recoverydir(struct file *file, char *buf, size_t size);
 static ssize_t write_v4_end_grace(struct file *file, char *buf, size_t size);
 #endif
 
-static ssize_t (*write_op[])(struct file *, char *, size_t) = {
+static ssize_t (*const write_op[])(struct file *, char *, size_t) = {
 	[NFSD_Fh] = write_filehandle,
 	[NFSD_FO_UnlockIP] = write_unlock_ip,
 	[NFSD_FO_UnlockFS] = write_unlock_fs,
Signature · 1 line
2.18.0.203.gfac676dfb9-goog