From: Lars-Peter Clausen <lars@metafoo.de>
To: Mark Brown <broonie@kernel.org>, Liam Girdwood <lgirdwood@gmail.com>
Cc: alsa-devel@alsa-project.org, Lars-Peter Clausen <lars@metafoo.de>,
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
Sangbeom Kim <sbkim73@samsung.com>,
Peter Ujfalusi <peter.ujfalusi@ti.com>,
Sylwester Nawrocki <s.nawrocki@samsung.com>,
Lee Jones <lee.jones@linaro.org>
Subject: [PATCH 5/6] ASoC: samsung idma: Add proper annotation for casting iomem pointers
Date: Sun, 17 Aug 2014 16:18:21 +0200 [thread overview]
Message-ID: <1408285102-24538-6-git-send-email-lars@metafoo.de> (raw)
In-Reply-To: <1408285102-24538-1-git-send-email-lars@metafoo.de>
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]
<asn:2>*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 <lars@metafoo.de>
---
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;
}
--
1.8.0
next prev parent reply other threads:[~2014-08-17 14:18 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-17 14:18 [PATCH 0/6] Fix `sparse` warnings Lars-Peter Clausen
2014-08-17 14:18 ` [PATCH 1/6] ASoC: edma-pcm: Include edma-pcm.h Lars-Peter Clausen
2014-08-17 14:31 ` Mark Brown
2014-08-17 14:18 ` [PATCH 2/6] ASoC: odrodix2_max98090: Make non exported symbols static Lars-Peter Clausen
2014-08-17 14:32 ` Mark Brown
2014-08-17 14:18 ` [PATCH 3/6] ASoC: rcar: Use && instead of & for boolean expressions Lars-Peter Clausen
2014-08-17 14:33 ` Mark Brown
2014-08-17 14:18 ` [PATCH 4/6] ASoC: sh: Fix dma direction type Lars-Peter Clausen
2014-08-17 14:34 ` Mark Brown
2014-08-17 14:18 ` Lars-Peter Clausen [this message]
2014-08-17 14:35 ` [PATCH 5/6] ASoC: samsung idma: Add proper annotation for casting iomem pointers Mark Brown
2014-08-17 14:18 ` [PATCH 6/6] ASoC: ab8500-codec: Drop bank prefix from AB8500_GPIO_DIR4_REG register define Lars-Peter Clausen
2014-08-17 14:36 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1408285102-24538-6-git-send-email-lars@metafoo.de \
--to=lars@metafoo.de \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=lee.jones@linaro.org \
--cc=lgirdwood@gmail.com \
--cc=peter.ujfalusi@ti.com \
--cc=s.nawrocki@samsung.com \
--cc=sbkim73@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.