From patchwork Tue Jun 7 11:53:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Dooks X-Patchwork-Id: 9160881 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CFDB660801 for ; Tue, 7 Jun 2016 11:56:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C0D2A28352 for ; Tue, 7 Jun 2016 11:56:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B5BE62835D; Tue, 7 Jun 2016 11:56:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F11CB28352 for ; Tue, 7 Jun 2016 11:56:29 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1bAFaY-0002ld-Mc; Tue, 07 Jun 2016 11:54:30 +0000 Received: from 82-70-136-246.dsl.in-addr.zen.co.uk ([82.70.136.246] helo=rainbowdash.ducie.codethink.co.uk) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1bAFZl-00015x-TE for linux-arm-kernel@lists.infradead.org; Tue, 07 Jun 2016 11:54:03 +0000 Received: from ben by rainbowdash.ducie.codethink.co.uk with local (Exim 4.87) (envelope-from ) id 1bAFZF-0005NO-Fb; Tue, 07 Jun 2016 12:53:09 +0100 From: Ben Dooks To: linux-kernel@lists.codethink.co.uk Subject: [PATCH] watchdog: sirf: fix __iomem * warnings Date: Tue, 7 Jun 2016 12:53:07 +0100 Message-Id: <1465300387-20629-1-git-send-email-ben.dooks@codethink.co.uk> X-Mailer: git-send-email 2.8.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160607_045343_163888_7E1579B4 X-CRM114-Status: UNSURE ( 9.67 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Barry Song , linux-watchdog@vger.kernel.org, Wim Van Sebroeck , Ben Dooks , Guenter Roeck , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Fix the following warnings from sparse due to casting to/from an __iomem annotated variable: drivers/watchdog/sirfsoc_wdt.c:48:18: warning: incorrect type in assignment (different address spaces) drivers/watchdog/sirfsoc_wdt.c:48:18: expected void [noderef] *wdt_base drivers/watchdog/sirfsoc_wdt.c:48:18: got void * drivers/watchdog/sirfsoc_wdt.c:64:18: warning: incorrect type in assignment (different address spaces) drivers/watchdog/sirfsoc_wdt.c:64:18: expected void [noderef] *wdt_base drivers/watchdog/sirfsoc_wdt.c:64:18: got void * drivers/watchdog/sirfsoc_wdt.c:82:54: warning: incorrect type in initializer (different address spaces) drivers/watchdog/sirfsoc_wdt.c:82:54: expected void [noderef] *wdt_base drivers/watchdog/sirfsoc_wdt.c:82:54: got void * drivers/watchdog/sirfsoc_wdt.c:99:54: warning: incorrect type in initializer (different address spaces) drivers/watchdog/sirfsoc_wdt.c:99:54: expected void [noderef] *wdt_base drivers/watchdog/sirfsoc_wdt.c:99:54: got void * drivers/watchdog/sirfsoc_wdt.c:153:44: warning: incorrect type in argument 2 (different address spaces) drivers/watchdog/sirfsoc_wdt.c:153:44: expected void *data drivers/watchdog/sirfsoc_wdt.c:153:44: got void [noderef] *[assigned] base Signed-off-by: Ben Dooks Reviewed-by: Guenter Roeck --- Cc: Wim Van Sebroeck Cc: Guenter Roeck Cc: Barry Song Cc: linux-watchdog@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org --- drivers/watchdog/sirfsoc_wdt.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/watchdog/sirfsoc_wdt.c b/drivers/watchdog/sirfsoc_wdt.c index d0578ab..3050a00 100644 --- a/drivers/watchdog/sirfsoc_wdt.c +++ b/drivers/watchdog/sirfsoc_wdt.c @@ -39,13 +39,18 @@ MODULE_PARM_DESC(timeout, "Default watchdog timeout (in seconds)"); MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); +static void __iomem *sirfsoc_wdt_base(struct watchdog_device *wdd) +{ + return (void __iomem __force *)watchdog_get_drvdata(wdd); +} + static unsigned int sirfsoc_wdt_gettimeleft(struct watchdog_device *wdd) { u32 counter, match; void __iomem *wdt_base; int time_left; - wdt_base = watchdog_get_drvdata(wdd); + wdt_base = sirfsoc_wdt_base(wdd); counter = readl(wdt_base + SIRFSOC_TIMER_COUNTER_LO); match = readl(wdt_base + SIRFSOC_TIMER_MATCH_0 + (SIRFSOC_TIMER_WDT_INDEX << 2)); @@ -61,7 +66,7 @@ static int sirfsoc_wdt_updatetimeout(struct watchdog_device *wdd) void __iomem *wdt_base; timeout_ticks = wdd->timeout * CLOCK_FREQ; - wdt_base = watchdog_get_drvdata(wdd); + wdt_base = sirfsoc_wdt_base(wdd); /* Enable the latch before reading the LATCH_LO register */ writel(1, wdt_base + SIRFSOC_TIMER_LATCH); @@ -79,7 +84,7 @@ static int sirfsoc_wdt_updatetimeout(struct watchdog_device *wdd) static int sirfsoc_wdt_enable(struct watchdog_device *wdd) { - void __iomem *wdt_base = watchdog_get_drvdata(wdd); + void __iomem *wdt_base = sirfsoc_wdt_base(wdd); sirfsoc_wdt_updatetimeout(wdd); /* @@ -96,7 +101,7 @@ static int sirfsoc_wdt_enable(struct watchdog_device *wdd) static int sirfsoc_wdt_disable(struct watchdog_device *wdd) { - void __iomem *wdt_base = watchdog_get_drvdata(wdd); + void __iomem *wdt_base = sirfsoc_wdt_base(wdd); writel(0, wdt_base + SIRFSOC_TIMER_WATCHDOG_EN); writel(readl(wdt_base + SIRFSOC_TIMER_INT_EN) @@ -150,7 +155,7 @@ static int sirfsoc_wdt_probe(struct platform_device *pdev) if (IS_ERR(base)) return PTR_ERR(base); - watchdog_set_drvdata(&sirfsoc_wdd, base); + watchdog_set_drvdata(&sirfsoc_wdd, (__force void *)base); watchdog_init_timeout(&sirfsoc_wdd, timeout, &pdev->dev); watchdog_set_nowayout(&sirfsoc_wdd, nowayout);