[PATCH] posix-cpu-timers: Fix WARNINGs for 'sizeof(X)' instead of 'sizeof X' in posix-cpu-timers.c
From: Wei Tang
Date: Wed May 25 2016 - 05:45:21 EST
This patch fixes the checkpatch.pl WARNINGs to posix-cpu-timers.c like:
WARNING: sizeof timer should be sizeof(timer)
Signed-off-by: Wei Tang <tangwei@xxxxxxxxxxxxxxxxxxxx>
---
kernel/time/posix-cpu-timers.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/kernel/time/posix-cpu-timers.c b/kernel/time/posix-cpu-timers.c
index 1cafba8..4803c65 100644
--- a/kernel/time/posix-cpu-timers.c
+++ b/kernel/time/posix-cpu-timers.c
@@ -1271,7 +1271,7 @@ static int do_cpu_nanosleep(const clockid_t which_clock, int flags,
/*
* Set up a temporary timer and then wait for it to go off.
*/
- memset(&timer, 0, sizeof timer);
+ memset(&timer, 0, sizeof(timer));
spin_lock_init(&timer.it_lock);
timer.it_clock = which_clock;
timer.it_overrun = -1;
@@ -1280,7 +1280,7 @@ static int do_cpu_nanosleep(const clockid_t which_clock, int flags,
if (!error) {
static struct itimerspec zero_it;
- memset(it, 0, sizeof *it);
+ memset(it, 0, sizeof(*it));
it->it_value = *rqtp;
spin_lock_irq(&timer.it_lock);
@@ -1373,7 +1373,7 @@ static int posix_cpu_nsleep(const clockid_t which_clock, int flags,
/*
* Report back to the user the time still remaining.
*/
- if (rmtp && copy_to_user(rmtp, &it.it_value, sizeof *rmtp))
+ if (rmtp && copy_to_user(rmtp, &it.it_value, sizeof(*rmtp)))
return -EFAULT;
restart_block->fn = posix_cpu_nsleep_restart;
@@ -1400,7 +1400,7 @@ static long posix_cpu_nsleep_restart(struct restart_block *restart_block)
/*
* Report back to the user the time still remaining.
*/
- if (rmtp && copy_to_user(rmtp, &it.it_value, sizeof *rmtp))
+ if (rmtp && copy_to_user(rmtp, &it.it_value, sizeof(*rmtp)))
return -EFAULT;
restart_block->nanosleep.expires = timespec_to_ns(&t);
--
1.9.1