From patchwork Tue Jan 13 19:04:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Ian King X-Patchwork-Id: 428617 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 5DF99140213; Wed, 14 Jan 2015 06:08:24 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1YB6pD-0002Ko-9t; Tue, 13 Jan 2015 19:08:23 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1YB6n8-0001uR-K2 for fwts-devel@lists.ubuntu.com; Tue, 13 Jan 2015 19:06:14 +0000 Received: from cpc3-craw6-2-0-cust180.croy.cable.virginm.net ([77.100.248.181] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1YB6n8-0004HL-HF for fwts-devel@lists.ubuntu.com; Tue, 13 Jan 2015 19:06:14 +0000 From: Colin King To: fwts-devel@lists.ubuntu.com Subject: [PATCH 24/46] hpet: hpet_check: reduce scope of variables Date: Tue, 13 Jan 2015 19:04:43 +0000 Message-Id: <1421175905-17035-25-git-send-email-colin.king@canonical.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1421175905-17035-1-git-send-email-colin.king@canonical.com> References: <1421175905-17035-1-git-send-email-colin.king@canonical.com> X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: fwts-devel-bounces@lists.ubuntu.com From: Colin Ian King cppcheck is picking up some minor style issues which can be easily fixed: [src/hpet/hpet_check/hpet_check.c:40]: (style) The scope of the variable 'idx' can be reduced. Signed-off-by: Colin Ian King Acked-by: Ivan Hu Acked-by: Alex Hung --- src/hpet/hpet_check/hpet_check.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hpet/hpet_check/hpet_check.c b/src/hpet/hpet_check/hpet_check.c index 3a985e6..41b57bf 100644 --- a/src/hpet/hpet_check/hpet_check.c +++ b/src/hpet/hpet_check/hpet_check.c @@ -37,11 +37,11 @@ static void *hpet_base_v = 0; static void hpet_parse_check_base(fwts_framework *fw, const char *table, fwts_list_link *item) { - char *val, *idx; + char *val; if ((val = strstr(fwts_text_list_text(item), "0x")) != NULL) { uint64_t address_base; - idx = index(val, ','); + char *idx = index(val, ','); if (idx) *idx = '\0';