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 <[email protected]>
---
 kernel/hrtimer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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);
 
-- 
1.7.12.rc2.18.g61b472e

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to