From patchwork Thu Aug 22 01:57:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nobuhiro Iwamatsu X-Patchwork-Id: 268923 X-Patchwork-Delegate: iwamatsu@nigauri.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 933442C007B for ; Thu, 22 Aug 2013 11:57:58 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 533574A08E; Thu, 22 Aug 2013 03:57:55 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BO-eczDMs7bH; Thu, 22 Aug 2013 03:57:55 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8AA474A067; Thu, 22 Aug 2013 03:57:53 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 42B9B4A067 for ; Thu, 22 Aug 2013 03:57:47 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id a3Bi13Gzy3ws for ; Thu, 22 Aug 2013 03:57:42 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-pa0-f43.google.com (mail-pa0-f43.google.com [209.85.220.43]) by theia.denx.de (Postfix) with ESMTPS id 425DD4A063 for ; Thu, 22 Aug 2013 03:57:36 +0200 (CEST) Received: by mail-pa0-f43.google.com with SMTP id hz10so1474237pad.16 for ; Wed, 21 Aug 2013 18:57:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=1CQ/5uW4D2e3oBQKW0crxG/JTdE3Y3fUHaWSp8guXoI=; b=P2u8FId7z3ITp099DOCWg200dEhJxZzFClyDY/piEQYDFfcq2yiUW9jFYnQlv4CMJZ 4/CiBzGjgiJdpm0O6ijZal/lGIUl/3AsVUK3BNhx4emtF63lm7w7VZw+Vm79+OPYe1PM ITnCsln24Y/rXxlfrMJRKCdOH4R/D/dh49LmTBiyE1gmlE4bQA3IJjoE7Ms6wwl7/tmn DVQvkmV8rIeldiLdQGImZ45AXrLBkShTNNtSJNZ7PQ0qDyHqIMxUKDjdDRU31Nu6B0XC rS2HUXzbgkiPrZXWbLsM7qUfWYLADGhoc7AblY0QFiM0KTYfCUBPLoPOwB4Q7A5xDDBp 8Djg== X-Gm-Message-State: ALoCoQmsQb5mbvEKW+Fv3SlZ/Iqt1clHoAXN70wkjph/HDzdi/zm4Vq0qxANt8pfJKvcSKu9K8cu X-Received: by 10.66.218.98 with SMTP id pf2mr2692015pac.120.1377136654822; Wed, 21 Aug 2013 18:57:34 -0700 (PDT) Received: from xps-iwamatsu.renesas.com (49.14.32.202.bf.2iij.net. [202.32.14.49]) by mx.google.com with ESMTPSA id py4sm11365154pbc.14.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 21 Aug 2013 18:57:33 -0700 (PDT) From: Nobuhiro Iwamatsu To: iwamatsu@nigauri.org Date: Thu, 22 Aug 2013 10:57:11 +0900 Message-Id: <1377136635-27875-2-git-send-email-nobuhiro.iwamatsu.yj@renesas.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1377136635-27875-1-git-send-email-nobuhiro.iwamatsu.yj@renesas.com> References: <1377136635-27875-1-git-send-email-nobuhiro.iwamatsu.yj@renesas.com> Cc: u-boot@lists.denx.de, Nobuhiro Iwamatsu Subject: [U-Boot] [PATCH 2/6] sh: timer: Remove static global variable X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de "static u16 bit" is not necessary to use this as static global variable. This patch fixes this. Signed-off-by: Nobuhiro Iwamatsu --- arch/sh/lib/time.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/sh/lib/time.c b/arch/sh/lib/time.c index 8f83d46..c554fe8 100644 --- a/arch/sh/lib/time.c +++ b/arch/sh/lib/time.c @@ -21,13 +21,13 @@ static struct tmu_regs *tmu = (struct tmu_regs *)TMU_BASE; -static u16 bit; static unsigned long last_tcnt; static unsigned long long overflow_ticks; unsigned long get_tbclk(void) { - return get_tmu0_clk_rate() >> ((bit + 1) * 2); + u16 tmu_bit = (ffs(CONFIG_SYS_TMU_CLK_DIV) >> 1) - 1; + return get_tmu0_clk_rate() >> ((tmu_bit + 1) * 2); } static inline unsigned long long tick_to_time(unsigned long long tick) @@ -62,8 +62,8 @@ static void tmu_timer_stop(unsigned int timer) int timer_init(void) { - bit = (ffs(CONFIG_SYS_TMU_CLK_DIV) >> 1) - 1; - writew((readw(&tmu->tcr0) & ~TCR_TPSC) | bit, &tmu->tcr0); + u16 tmu_bit = (ffs(CONFIG_SYS_TMU_CLK_DIV) >> 1) - 1; + writew((readw(&tmu->tcr0) & ~TCR_TPSC) | tmu_bit, &tmu->tcr0); tmu_timer_stop(0); tmu_timer_start(0);