OSDN Git Service

clocksource: exynos_mct: silence a static checker warning
authorDan Carpenter <dan.carpenter@oracle.com>
Sat, 1 Mar 2014 13:57:14 +0000 (16:57 +0300)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Tue, 11 Mar 2014 22:13:23 +0000 (23:13 +0100)
My guess is we aren't going to have a 2 digit cpuid here any time soon
but the static checkers don't know that and complain that the snprintf()
could overflow.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
drivers/clocksource/exynos_mct.c

index 48f76bc..c2e390e 100644 (file)
@@ -410,7 +410,7 @@ static int exynos4_local_timer_setup(struct clock_event_device *evt)
        mevt = container_of(evt, struct mct_clock_event_device, evt);
 
        mevt->base = EXYNOS4_MCT_L_BASE(cpu);
-       sprintf(mevt->name, "mct_tick%d", cpu);
+       snprintf(mevt->name, sizeof(mevt->name), "mct_tick%d", cpu);
 
        evt->name = mevt->name;
        evt->cpumask = cpumask_of(cpu);