From patchwork Wed Jan 23 09:22:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 14239 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 1A21623E39 for ; Wed, 23 Jan 2013 09:31:04 +0000 (UTC) Received: from mail-vb0-f42.google.com (mail-vb0-f42.google.com [209.85.212.42]) by fiordland.canonical.com (Postfix) with ESMTP id A25EDA19534 for ; Wed, 23 Jan 2013 09:31:03 +0000 (UTC) Received: by mail-vb0-f42.google.com with SMTP id ff1so5106819vbb.1 for ; Wed, 23 Jan 2013 01:31:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=Ovq/P6mJ7smlADWmZbA/Bff6skt3g13xm/Un+CFHJdU=; b=UT3S7r3sMzDDLbGnjGwRbn1vBK0/t20fiiWCvIavV02Tj0wcCXBU4JNKf/4O/1sRFS 60KM/Dg068RSohyNqgkb/m8cLxudjfiKvvuL8+a+f2Aj33MKH3yWGGX5gbJiF7EOqIrT 0Y1xn1zicj41WZhpryNUDL7+N49gFobMiioQkom8+2LooJD1M3vVS6FJX2cE0yEHXzcx NVWDV5bTQM/YJch9NxInR/o29u3xeH/SCIEj7EXqt7raJGB/B0jEb8yzHUeKkn2ZJOlU 7IP4QaZPFptb0YXCpIfcv3giT0i3ZA8YCk/zeuZfjXGyRMfMD4rhQrFQHnxPphL8Iy0B 1XZg== X-Received: by 10.52.16.6 with SMTP id b6mr524755vdd.40.1358933463101; Wed, 23 Jan 2013 01:31:03 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.145.101 with SMTP id st5csp641veb; Wed, 23 Jan 2013 01:31:02 -0800 (PST) X-Received: by 10.68.234.36 with SMTP id ub4mr1797993pbc.68.1358933462083; Wed, 23 Jan 2013 01:31:02 -0800 (PST) Received: from mail-pa0-f48.google.com (mail-pa0-f48.google.com [209.85.220.48]) by mx.google.com with ESMTPS id g1si20225046paw.100.2013.01.23.01.31.01 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 23 Jan 2013 01:31:02 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.48 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.220.48; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.48 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) smtp.mail=sachin.kamat@linaro.org Received: by mail-pa0-f48.google.com with SMTP id fa1so4668192pad.21 for ; Wed, 23 Jan 2013 01:31:01 -0800 (PST) X-Received: by 10.66.76.194 with SMTP id m2mr3055247paw.14.1358933461484; Wed, 23 Jan 2013 01:31:01 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id gj1sm12498360pbc.11.2013.01.23.01.30.58 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 23 Jan 2013 01:31:00 -0800 (PST) From: Sachin Kamat To: linux-samsung-soc@vger.kernel.org Cc: kgene.kim@samsung.com, rjw@sisk.pl, jhbird.choi@samsung.com, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH 1/2] cpufreq: exynos: Fix unsigned variable being checked for negative value Date: Wed, 23 Jan 2013 14:52:11 +0530 Message-Id: <1358932932-14094-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQm5125Ccc8AxybYtFPH1m9eSO/0AvQUoRNvGC9QTW+3OnJFddGZ3eDxuTmxWRfUrzl70DHT exynos_cpufreq_scale function returns signed value which was assigned to an unsigned variable and checked for negative value which is always false. Hence make it signed. Fixes the following smatch warnings: drivers/cpufreq/exynos-cpufreq.c:83 exynos_cpufreq_scale() warn: unsigned 'old_index' is never less than zero. drivers/cpufreq/exynos-cpufreq.c:89 exynos_cpufreq_scale() warn: unsigned 'index' is never less than zero. Signed-off-by: Sachin Kamat --- Rafael J. Wysocki suggested these 2 patches be taken through the Samsung tree. --- drivers/cpufreq/exynos-cpufreq.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/cpufreq/exynos-cpufreq.c b/drivers/cpufreq/exynos-cpufreq.c index 218b3ce..88401ba 100644 --- a/drivers/cpufreq/exynos-cpufreq.c +++ b/drivers/cpufreq/exynos-cpufreq.c @@ -65,7 +65,7 @@ static int exynos_cpufreq_scale(unsigned int target_freq) struct cpufreq_policy *policy = cpufreq_cpu_get(0); unsigned int arm_volt, safe_arm_volt = 0; unsigned int mpll_freq_khz = exynos_info->mpll_freq_khz; - unsigned int index, old_index; + int index, old_index; int ret = 0; freqs.old = policy->cur;