summaryrefslogtreecommitdiff
path: root/security/apparmor/apparmorfs.c
diff options
context:
space:
mode:
authorJohn Johansen <john.johansen@canonical.com>2017-01-16 00:43:01 -0800
committerJohn Johansen <john.johansen@canonical.com>2017-01-16 01:18:46 -0800
commit47f6e5cc7355e4ff2fd7ace919aa9e291077c26b (patch)
tree28afc953505fa769dafd1532b141a779b80672b9 /security/apparmor/apparmorfs.c
parent55a26ebf630b6bf1cb7ddf8882fdc81d58afeaa2 (diff)
apparmor: change op from int to const char *
Having ops be an integer that is an index into an op name table is awkward and brittle. Every op change requires an edit for both the op constant and a string in the table. Instead switch to using const strings directly, eliminating the need for the table that needs to be kept in sync. Signed-off-by: John Johansen <john.johansen@canonical.com>
Diffstat (limited to 'security/apparmor/apparmorfs.c')
-rw-r--r--security/apparmor/apparmorfs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
index af36af88c4ed..999a43e598f0 100644
--- a/security/apparmor/apparmorfs.c
+++ b/security/apparmor/apparmorfs.c
@@ -85,7 +85,7 @@ static int mangle_name(const char *name, char *target)
* Returns: kernel buffer containing copy of user buffer data or an
* ERR_PTR on failure.
*/
-static struct aa_loaddata *aa_simple_write_to_buffer(int op,
+static struct aa_loaddata *aa_simple_write_to_buffer(const char *op,
const char __user *userbuf,
size_t alloc_size,
size_t copy_size,
@@ -122,7 +122,7 @@ static ssize_t policy_update(int binop, const char __user *buf, size_t size,
ssize_t error;
struct aa_loaddata *data;
struct aa_profile *profile = aa_current_profile();
- int op = binop == PROF_ADD ? OP_PROF_LOAD : OP_PROF_REPL;
+ const char *op = binop == PROF_ADD ? OP_PROF_LOAD : OP_PROF_REPL;
/* high level check about policy management - fine grained in
* below after unpack
*/