[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180907003716.57737-6-alexander.levin@microsoft.com>
Date: Fri, 7 Sep 2018 00:37:24 +0000
From: Sasha Levin <Alexander.Levin@...rosoft.com>
To: "stable@...r.kernel.org" <stable@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC: Takashi Iwai <tiwai@...e.de>,
Sasha Levin <Alexander.Levin@...rosoft.com>
Subject: [PATCH AUTOSEL 4.14 06/67] ALSA: pcm: Add __force to cast in
snd_pcm_lib_read/write()
From: Takashi Iwai <tiwai@...e.de>
[ Upstream commit 95a48b7d4459948b6bacf809809cf01a7dc06d1d ]
The snd_pcm_lib_read() and snd_pcm_lib_write() inline functions have
the explicit cast from a user pointer to a kernel pointer, but they
lacks of __force prefix.
This fixes sparse warnings like:
./include/sound/pcm.h:1093:47: warning: cast removes address space of expression
Fixes: 68541213720d ("ALSA: pcm: Direct in-kernel read/write support")
Signed-off-by: Takashi Iwai <tiwai@...e.de>
Signed-off-by: Sasha Levin <alexander.levin@...rosoft.com>
---
include/sound/pcm.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index 24febf9e177c..5087200599f1 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -1081,14 +1081,14 @@ static inline snd_pcm_sframes_t
snd_pcm_lib_write(struct snd_pcm_substream *substream,
const void __user *buf, snd_pcm_uframes_t frames)
{
- return __snd_pcm_lib_xfer(substream, (void *)buf, true, frames, false);
+ return __snd_pcm_lib_xfer(substream, (void __force *)buf, true, frames, false);
}
static inline snd_pcm_sframes_t
snd_pcm_lib_read(struct snd_pcm_substream *substream,
void __user *buf, snd_pcm_uframes_t frames)
{
- return __snd_pcm_lib_xfer(substream, (void *)buf, true, frames, false);
+ return __snd_pcm_lib_xfer(substream, (void __force *)buf, true, frames, false);
}
static inline snd_pcm_sframes_t
--
2.17.1
Powered by blists - more mailing lists