diff mbox

[V2,07/36] hrtimer: replace sizeof(struct hrtimer) with sizeof(*timer)

Message ID 67b891e708df0147862e9107c6d920c9b9e9065b.1396592516.git.viresh.kumar@linaro.org
State New
Headers show

Commit Message

Viresh Kumar April 4, 2014, 6:35 a.m. UTC
Linux coding guidelines says:

The preferred form for passing a size of a struct is the following:
	p = kmalloc(sizeof(*p), ...);

But __hrtimer_init() wasn't following that. Fix it.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 kernel/hrtimer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index f6b1968..db580ab 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -1166,7 +1166,7 @@  static void __hrtimer_init(struct hrtimer *timer, clockid_t clock_id,
 	struct hrtimer_cpu_base *cpu_base;
 	int base;
 
-	memset(timer, 0, sizeof(struct hrtimer));
+	memset(timer, 0, sizeof(*timer));
 
 	cpu_base = &__raw_get_cpu_var(hrtimer_bases);