diff options
author | Eric Paris <eparis@redhat.com> | 2012-01-03 14:23:07 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-01-17 16:16:58 -0500 |
commit | a4ff8dba7d8ce5ceb43fb27df66292251cc73bdc (patch) | |
tree | 2c89a0a7a7dad853a2c2ec70417ef2f3f5a04fd4 /include/linux/audit.h | |
parent | 38cdce53daa0408a61fe6d86fe48f31515c9b840 (diff) |
audit: inline audit_free to simplify the look of generic code
make the conditional a static inline instead of doing it in generic code.
Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'include/linux/audit.h')
-rw-r--r-- | include/linux/audit.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/linux/audit.h b/include/linux/audit.h index 4f1efe3e8616..8eb8bda749b3 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
@@ -417,7 +417,7 @@ extern int audit_classify_arch(int arch); | |||
417 | /* Public API */ | 417 | /* Public API */ |
418 | extern void audit_finish_fork(struct task_struct *child); | 418 | extern void audit_finish_fork(struct task_struct *child); |
419 | extern int audit_alloc(struct task_struct *task); | 419 | extern int audit_alloc(struct task_struct *task); |
420 | extern void audit_free(struct task_struct *task); | 420 | extern void __audit_free(struct task_struct *task); |
421 | extern void __audit_syscall_entry(int arch, | 421 | extern void __audit_syscall_entry(int arch, |
422 | int major, unsigned long a0, unsigned long a1, | 422 | int major, unsigned long a0, unsigned long a1, |
423 | unsigned long a2, unsigned long a3); | 423 | unsigned long a2, unsigned long a3); |
@@ -435,6 +435,11 @@ static inline int audit_dummy_context(void) | |||
435 | void *p = current->audit_context; | 435 | void *p = current->audit_context; |
436 | return !p || *(int *)p; | 436 | return !p || *(int *)p; |
437 | } | 437 | } |
438 | static inline void audit_free(struct task_struct *task) | ||
439 | { | ||
440 | if (unlikely(task->audit_context)) | ||
441 | __audit_free(task); | ||
442 | } | ||
438 | static inline void audit_syscall_entry(int arch, int major, unsigned long a0, | 443 | static inline void audit_syscall_entry(int arch, int major, unsigned long a0, |
439 | unsigned long a1, unsigned long a2, | 444 | unsigned long a1, unsigned long a2, |
440 | unsigned long a3) | 445 | unsigned long a3) |