From patchwork Fri Jan 31 14:18:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 3561681 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9DD08C02DC for ; Fri, 31 Jan 2014 14:19:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7035720225 for ; Fri, 31 Jan 2014 14:19:15 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4D86E2021C for ; Fri, 31 Jan 2014 14:19:14 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W9Ew0-0000lu-Pu; Fri, 31 Jan 2014 14:19:08 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1W9Evx-0000xs-2N; Fri, 31 Jan 2014 14:19:05 +0000 Received: from mail-ee0-f45.google.com ([74.125.83.45]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W9Evs-0000wf-Qu for linux-arm-kernel@lists.infradead.org; Fri, 31 Jan 2014 14:19:01 +0000 Received: by mail-ee0-f45.google.com with SMTP id b15so2285594eek.32 for ; Fri, 31 Jan 2014 06:18:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:in-reply-to:references:content-type; bh=yo7jVjwdEU5d6vnR9lz1dvQgTYpqqqv10UcaJxTwnw4=; b=miOtB7W0RA4IKv3NiFYo/xdhNY5adHRjfpet3PeSmQkt7zmvFDNVno8E8JdFYa44FH lKT3hoVzNqvzcV+3jfX/japFujGiI1h95L+AJuMdm6XZUDGb4WW3zyvvXDMbY66EM55J NwCeKIw/Bc6HbZVRPSRgJ2cDZjTn5oNV8zZ6Ld0zQctij24/i47SJsAy+W7PhTo9uWOt rT87nYwqoln39cBIHqoSBpHI+lrh9mWHjf+KgYuSIwflpEwdkNLG43AqNDg9rG1xoHte meTM36GUR4NM1ABkHbi0Q04x+0aHUBT3R+5ay9FaiTrQj72yQwLqExcv4qug3jOlx+Jp YV/A== X-Gm-Message-State: ALoCoQkdQA/UquT85p3NQ/6gwKrZz8kAHRMz/uL0DToYjvv5cfPXkLRnzzIVcjSteOtnIuGX9NC1 X-Received: by 10.14.223.71 with SMTP id u47mr3531708eep.89.1391177916550; Fri, 31 Jan 2014 06:18:36 -0800 (PST) Received: from localhost (nat-63.starnet.cz. [178.255.168.63]) by mx.google.com with ESMTPSA id l4sm37024252een.13.2014.01.31.06.18.34 for (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Fri, 31 Jan 2014 06:18:35 -0800 (PST) From: Michal Simek To: linux-kernel@vger.kernel.org, monstr@monstr.eu Subject: [PATCH 02/10] watchdog: xilinx: Move control_status_reg to functions Date: Fri, 31 Jan 2014 15:18:11 +0100 Message-Id: X-Mailer: git-send-email 1.8.2.3 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140131_091900_972666_161BC209 X-CRM114-Status: GOOD ( 13.18 ) X-Spam-Score: -1.9 (-) Cc: Wim Van Sebroeck , linux-watchdog@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP control_status_reg is temp variables and should be used locally by specific function. Signed-off-by: Michal Simek Reviewed-by: Guenter Roeck --- drivers/watchdog/of_xilinx_wdt.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) -- 1.8.2.3 diff --git a/drivers/watchdog/of_xilinx_wdt.c b/drivers/watchdog/of_xilinx_wdt.c index 8c2814e..aca9bab 100644 --- a/drivers/watchdog/of_xilinx_wdt.c +++ b/drivers/watchdog/of_xilinx_wdt.c @@ -52,13 +52,14 @@ struct xwdt_device { static struct xwdt_device xdev; static u32 timeout; -static u32 control_status_reg; static u8 no_timeout; static DEFINE_SPINLOCK(spinlock); static int xilinx_wdt_start(struct watchdog_device *wdd) { + u32 control_status_reg; + spin_lock(&spinlock); /* Clean previous status and enable the watchdog timer */ @@ -77,6 +78,8 @@ static int xilinx_wdt_start(struct watchdog_device *wdd) static int xilinx_wdt_stop(struct watchdog_device *wdd) { + u32 control_status_reg; + spin_lock(&spinlock); control_status_reg = ioread32(xdev.base + XWT_TWCSR0_OFFSET); @@ -94,6 +97,8 @@ static int xilinx_wdt_stop(struct watchdog_device *wdd) static int xilinx_wdt_keepalive(struct watchdog_device *wdd) { + u32 control_status_reg; + spin_lock(&spinlock); control_status_reg = ioread32(xdev.base + XWT_TWCSR0_OFFSET);