Skip to contentSkip to conversation

clocksource: exynos_mct: silence a static checker warning

PATCH New Dan Carpenter 1 participant 1 message Mar 1, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clocksource: exynos_mct: silence a static checker warning

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.

drivers/clocksource/exynos_mct.c +1 -1
index ed49b25fa552..a6ee6d7cd63f 100644
@@ -408,7 +408,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);