Commit 0701492c authored by Takashi Iwai's avatar Takashi Iwai

ALSA: korg1212: Add __force annotation to cast in user-copy callbacks

The user-copy callbacks in korg1212 driver contain the explicit cast
from a user pointer to a kernel pointer, but they missed __force
prefix.  It's mandatory for converting between them.

Spotted by sparse, a warning like:
  sound/pci/korg1212/korg1212.c:1329:33: warning: cast removes address space of expression
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 191bb51e
...@@ -1326,7 +1326,7 @@ static int snd_korg1212_copy_to(struct snd_pcm_substream *substream, ...@@ -1326,7 +1326,7 @@ static int snd_korg1212_copy_to(struct snd_pcm_substream *substream,
} }
#endif #endif
if (in_kernel) if (in_kernel)
memcpy((void *)dst, src, size); memcpy((__force void *)dst, src, size);
else if (copy_to_user(dst, src, size)) else if (copy_to_user(dst, src, size))
return -EFAULT; return -EFAULT;
src++; src++;
...@@ -1365,7 +1365,7 @@ static int snd_korg1212_copy_from(struct snd_pcm_substream *substream, ...@@ -1365,7 +1365,7 @@ static int snd_korg1212_copy_from(struct snd_pcm_substream *substream,
} }
#endif #endif
if (in_kernel) if (in_kernel)
memcpy((void *)dst, src, size); memcpy(dst, (__force void *)src, size);
else if (copy_from_user(dst, src, size)) else if (copy_from_user(dst, src, size))
return -EFAULT; return -EFAULT;
dst++; dst++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment