From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Carpenter Date: Sat, 01 Mar 2014 13:57:14 +0000 Subject: [patch] clocksource: exynos_mct: silence a static checker warning Message-Id: <20140301135714.GD23929@elgon.mountain> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-arm-kernel@lists.infradead.org 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 diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c index ed49b25fa552..a6ee6d7cd63f 100644 --- a/drivers/clocksource/exynos_mct.c +++ b/drivers/clocksource/exynos_mct.c @@ -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); From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Carpenter Subject: [patch] clocksource: exynos_mct: silence a static checker warning Date: Sat, 1 Mar 2014 16:57:14 +0300 Message-ID: <20140301135714.GD23929@elgon.mountain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from aserp1040.oracle.com ([141.146.126.69]:21745 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752566AbaCAN6C (ORCPT ); Sat, 1 Mar 2014 08:58:02 -0500 Content-Disposition: inline Sender: linux-samsung-soc-owner@vger.kernel.org List-Id: linux-samsung-soc@vger.kernel.org To: Daniel Lezcano Cc: Thomas Gleixner , Kukjin Kim , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, kernel-janitors@vger.kernel.org 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 diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c index ed49b25fa552..a6ee6d7cd63f 100644 --- a/drivers/clocksource/exynos_mct.c +++ b/drivers/clocksource/exynos_mct.c @@ -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); From mboxrd@z Thu Jan 1 00:00:00 1970 From: dan.carpenter@oracle.com (Dan Carpenter) Date: Sat, 1 Mar 2014 16:57:14 +0300 Subject: [patch] clocksource: exynos_mct: silence a static checker warning Message-ID: <20140301135714.GD23929@elgon.mountain> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org 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 diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c index ed49b25fa552..a6ee6d7cd63f 100644 --- a/drivers/clocksource/exynos_mct.c +++ b/drivers/clocksource/exynos_mct.c @@ -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);