summaryrefslogtreecommitdiffstats
path: root/security/tomoyo/common.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2014-06-11 23:59:19 +0000
committerThomas Gleixner <tglx@linutronix.de>2014-06-12 16:18:45 +0200
commit77f4fa089c724adc3a87c10eb031bca91b144ac0 (patch)
tree1e40795801937aeb9f69ec6a2458a1c1571b13f7 /security/tomoyo/common.c
parentf037c1171db79be2a047b1a5aafa2fd1f05051cb (diff)
downloadlinux-stable-77f4fa089c724adc3a87c10eb031bca91b144ac0.tar.gz
linux-stable-77f4fa089c724adc3a87c10eb031bca91b144ac0.tar.bz2
linux-stable-77f4fa089c724adc3a87c10eb031bca91b144ac0.zip
tomoyo: Use sensible time interface
There is no point in calling gettimeofday if only the seconds part of the timespec is used. Use get_seconds() instead. It's not only the proper interface it's also faster. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Cc: John Stultz <john.stultz@linaro.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Kentaro Takeda <takedakn@nttdata.co.jp> Cc: linux-security-module@vger.kernel.org Link: http://lkml.kernel.org/r/20140611234607.775273584@linutronix.de
Diffstat (limited to 'security/tomoyo/common.c')
-rw-r--r--security/tomoyo/common.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/security/tomoyo/common.c b/security/tomoyo/common.c
index 283862aebdc8..e0fb75052550 100644
--- a/security/tomoyo/common.c
+++ b/security/tomoyo/common.c
@@ -2267,13 +2267,11 @@ static unsigned int tomoyo_stat_modified[TOMOYO_MAX_POLICY_STAT];
*/
void tomoyo_update_stat(const u8 index)
{
- struct timeval tv;
- do_gettimeofday(&tv);
/*
* I don't use atomic operations because race condition is not fatal.
*/
tomoyo_stat_updated[index]++;
- tomoyo_stat_modified[index] = tv.tv_sec;
+ tomoyo_stat_modified[index] = get_seconds();
}
/**