Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1406786 > unrolled thread

[PATCH] posix-cpu-timers: Fix WARNINGs for 'sizeof(X)' instead of 'sizeof X' in posix-cpu-timers.c

Started byWei Tang <tangwei@cmss.chinamobile.com>
First post2016-05-25 11:50 +0200
Last post2016-05-25 11:50 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] posix-cpu-timers: Fix WARNINGs for 'sizeof(X)' instead of 'sizeof X' in posix-cpu-timers.c Wei Tang <tangwei@cmss.chinamobile.com> - 2016-05-25 11:50 +0200

#1406786 — [PATCH] posix-cpu-timers: Fix WARNINGs for 'sizeof(X)' instead of 'sizeof X' in posix-cpu-timers.c

FromWei Tang <tangwei@cmss.chinamobile.com>
Date2016-05-25 11:50 +0200
Subject[PATCH] posix-cpu-timers: Fix WARNINGs for 'sizeof(X)' instead of 'sizeof X' in posix-cpu-timers.c
Message-ID<rCDBU-7Ok-35@gated-at.bofh.it>
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@cmss.chinamobile.com>
---
 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

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web