aboutsummaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-03-31 11:12:57 -0700
committerGerrit Code Review <gerrit@cyanogenmod.org>2015-11-09 06:36:32 -0800
commit4ede8c06a6b1bb846fe7e770d4a1934fad623601 (patch)
tree3109d3d6acec7bdd22d8a9f29cdc7f1c7cd1fe27 /security
parent0829ab05e113d5b52dfa4c8de94eb7bfffdf72bb (diff)
downloadkernel_samsung_smdk4412-4ede8c06a6b1bb846fe7e770d4a1934fad623601.zip
kernel_samsung_smdk4412-4ede8c06a6b1bb846fe7e770d4a1934fad623601.tar.gz
kernel_samsung_smdk4412-4ede8c06a6b1bb846fe7e770d4a1934fad623601.tar.bz2
selinux: inline avc_audit() and avc_has_perm_noaudit() into caller
Now that all the slow-path code is gone from these functions, we can inline them into the main caller - avc_has_perm_flags(). Now the compiler can see that 'avc' is allocated on the stack for this case, which helps register pressure a bit. It also actually shrinks the total stack frame, because the stack frame that avc_has_perm_flags() always needed (for that 'avc' allocation) is now sufficient for the inlined functions too. Inlining isn't bad - but mindless inlining of cold code (see the previous commit) is. Change-Id: Id07f865367d7fd542e2db7e554e7335107d991b6 Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'security')
-rw-r--r--security/selinux/avc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/security/selinux/avc.c b/security/selinux/avc.c
index 799b0f9..3bbc081 100644
--- a/security/selinux/avc.c
+++ b/security/selinux/avc.c
@@ -513,7 +513,7 @@ static noinline int slow_avc_audit(u32 ssid, u32 tsid, u16 tclass,
* be performed under a lock, to allow the lock to be released
* before calling the auditing code.
*/
-int avc_audit(u32 ssid, u32 tsid,
+inline int avc_audit(u32 ssid, u32 tsid,
u16 tclass, u32 requested,
struct av_decision *avd, int result, struct common_audit_data *a,
unsigned flags)
@@ -796,7 +796,7 @@ static noinline int avc_denied(u32 ssid, u32 tsid,
* auditing, e.g. in cases where a lock must be held for the check but
* should be released for the auditing.
*/
-int avc_has_perm_noaudit(u32 ssid, u32 tsid,
+inline int avc_has_perm_noaudit(u32 ssid, u32 tsid,
u16 tclass, u32 requested,
unsigned flags,
struct av_decision *avd)