diff mbox

selinux: constify write_op[]

Message ID 20180717174356.116660-1-ebiggers@google.com (mailing list archive)
State Accepted
Headers show

Commit Message

Jann Horn via Selinux July 17, 2018, 5:43 p.m. UTC
write_op[] is never modified, so make it 'const'.

Signed-off-by: Eric Biggers <ebiggers@google.com>
---
 security/selinux/selinuxfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Paul Moore July 17, 2018, 10:39 p.m. UTC | #1
On Tue, Jul 17, 2018 at 1:45 PM Eric Biggers <ebiggers@google.com> wrote:
>
> write_op[] is never modified, so make it 'const'.
>
> Signed-off-by: Eric Biggers <ebiggers@google.com>
> ---
>  security/selinux/selinuxfs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Merged, thanks.

> diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c
> index ab77da649b77..fb25396d2966 100644
> --- a/security/selinux/selinuxfs.c
> +++ b/security/selinux/selinuxfs.c
> @@ -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
diff mbox

Patch

diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c
index ab77da649b77..fb25396d2966 100644
--- a/security/selinux/selinuxfs.c
+++ b/security/selinux/selinuxfs.c
@@ -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,