Skip to contentSkip to conversation

selinux: constify write_op[]

PATCH Applied Eric Biggers 2 participants 2 messages Jul 17, 2018 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selinux: constify write_op[]

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

---
 security/selinux/selinuxfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
security/selinux/selinuxfs.c +1 -1
index ab77da649b77..fb25396d2966 100644
@@ -767,7 +767,7 @@ static ssize_t sel_write_relabel(struct file *file, char *buf, size_t size);
 static ssize_t sel_write_user(struct file *file, char *buf, size_t size);
 static ssize_t sel_write_member(struct file *file, char *buf, size_t size);
 
-static ssize_t (*write_op[])(struct file *, char *, size_t) = {
+static ssize_t (*const write_op[])(struct file *, char *, size_t) = {
 	[SEL_ACCESS] = sel_write_access,
 	[SEL_CREATE] = sel_write_create,
 	[SEL_RELABEL] = sel_write_relabel,
Signature · 1 line
2.18.0.203.gfac676dfb9-goog
maintainer Applied
#1 lore raw
Quoted 7 lines · Eric Biggers

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

---
 security/selinux/selinuxfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Merged, thanks.

Quoted 15 lines
security/selinux/selinuxfs.c +1 -2
index ab77da649b77..fb25396d2966 100644
@@ -767,7 +767,7 @@ static ssize_t sel_write_relabel(struct file *file, char *buf, size_t size);
 static ssize_t sel_write_user(struct file *file, char *buf, size_t size);
 static ssize_t sel_write_member(struct file *file, char *buf, size_t size);
 
-static ssize_t (*write_op[])(struct file *, char *, size_t) = {
+static ssize_t (*const write_op[])(struct file *, char *, size_t) = {
        [SEL_ACCESS] = sel_write_access,
        [SEL_CREATE] = sel_write_create,
        [SEL_RELABEL] = sel_write_relabel,
--

2.18.0.203.gfac676dfb9-goog

Signature · 2 lines
paul moore
www.paul-moore.com