diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2014-06-12 01:59:19 +0200 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2014-06-12 16:18:45 +0200 |
commit | 77f4fa089c724adc3a87c10eb031bca91b144ac0 (patch) | |
tree | 1e40795801937aeb9f69ec6a2458a1c1571b13f7 /security/tomoyo/audit.c | |
parent | fork: Use ktime_get_ts() (diff) | |
download | linux-77f4fa089c724adc3a87c10eb031bca91b144ac0.tar.xz linux-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/audit.c')
-rw-r--r-- | security/tomoyo/audit.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/security/tomoyo/audit.c b/security/tomoyo/audit.c index c1b00375c9ad..3ffa4f5509d8 100644 --- a/security/tomoyo/audit.c +++ b/security/tomoyo/audit.c @@ -155,11 +155,9 @@ static char *tomoyo_print_header(struct tomoyo_request_info *r) u8 i; if (!buffer) return NULL; - { - struct timeval tv; - do_gettimeofday(&tv); - tomoyo_convert_time(tv.tv_sec, &stamp); - } + + tomoyo_convert_time(get_seconds(), &stamp); + pos = snprintf(buffer, tomoyo_buffer_len - 1, "#%04u/%02u/%02u %02u:%02u:%02u# profile=%u mode=%s " "granted=%s (global-pid=%u) task={ pid=%u ppid=%u " |