From patchwork Sun Aug 17 14:18:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lars-Peter Clausen X-Patchwork-Id: 4731251 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9FE969F377 for ; Sun, 17 Aug 2014 14:21:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E0BFE20123 for ; Sun, 17 Aug 2014 14:21:33 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id B48D120122 for ; Sun, 17 Aug 2014 14:21:32 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id C47DE265789; Sun, 17 Aug 2014 16:21:31 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id DF676265259; Sun, 17 Aug 2014 16:18:40 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 0253A2650EE; Sun, 17 Aug 2014 16:18:36 +0200 (CEST) Received: from smtp-out-166.synserver.de (smtp-out-166.synserver.de [212.40.185.166]) by alsa0.perex.cz (Postfix) with ESMTP id AB42B2650F7 for ; Sun, 17 Aug 2014 16:18:30 +0200 (CEST) Received: (qmail 22531 invoked by uid 0); 17 Aug 2014 14:18:30 -0000 X-SynServer-TrustedSrc: 1 X-SynServer-AuthUser: lars@metafoo.de X-SynServer-PPID: 22180 Received: from ppp-188-174-38-10.dynamic.mnet-online.de (HELO lars-adi-laptop.fritz.box) [188.174.38.10] by 217.119.54.96 with SMTP; 17 Aug 2014 14:18:30 -0000 From: Lars-Peter Clausen To: Mark Brown , Liam Girdwood Date: Sun, 17 Aug 2014 16:18:21 +0200 Message-Id: <1408285102-24538-6-git-send-email-lars@metafoo.de> X-Mailer: git-send-email 1.8.0 In-Reply-To: <1408285102-24538-1-git-send-email-lars@metafoo.de> References: <1408285102-24538-1-git-send-email-lars@metafoo.de> Cc: alsa-devel@alsa-project.org, Lars-Peter Clausen , Kuninori Morimoto , Sangbeom Kim , Peter Ujfalusi , Sylwester Nawrocki , Lee Jones Subject: [alsa-devel] [PATCH 5/6] ASoC: samsung idma: Add proper annotation for casting iomem pointers X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP It is not always possible to interchange iomem pointers with normal pointers, which why we have annotations for iomem pointers and warn when casting them to a normal pointer or vice versa. In this case the casting is fine and unfortunately necessary so add the proper annotations to tell code checkers that it is intentional. This silences the following warnings from sparse: sound/soc/samsung/idma.c:354:20: warning: incorrect type in argument 1 (different address spaces) expected void volatile [noderef] *addr got unsigned char *area sound/soc/samsung/idma.c:372:22: warning: cast removes address space of expression Signed-off-by: Lars-Peter Clausen --- sound/soc/samsung/idma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/samsung/idma.c b/sound/soc/samsung/idma.c index db6cefa..0e8dd98 100644 --- a/sound/soc/samsung/idma.c +++ b/sound/soc/samsung/idma.c @@ -351,7 +351,7 @@ static void idma_free(struct snd_pcm *pcm) if (!buf->area) return; - iounmap(buf->area); + iounmap((void __iomem *)buf->area); buf->area = NULL; buf->addr = 0; @@ -369,7 +369,7 @@ static int preallocate_idma_buffer(struct snd_pcm *pcm, int stream) buf->dev.type = SNDRV_DMA_TYPE_CONTINUOUS; buf->addr = idma.lp_tx_addr; buf->bytes = idma_hardware.buffer_bytes_max; - buf->area = (unsigned char *)ioremap(buf->addr, buf->bytes); + buf->area = (unsigned char * __force)ioremap(buf->addr, buf->bytes); return 0; }