Skip to content

Commit

Permalink
ALSA: Force a cast to silence a warning from "sparse"
Browse files Browse the repository at this point in the history
Some audio drivers are calling snd_dma_continuous_data(GFP_KERNEL)
which makes "sparse" give a warning:

  $ make C=2 M=sound/usb modules
    ...
  sound/usb/6fire/pcm.c:625:25: warning: cast from restricted gfp_t
  sound/usb/caiaq/audio.c:845:41: warning: cast from restricted gfp_t
  sound/usb/usx2y/usbusx2yaudio.c:997:54: warning: cast from restricted gfp_t
  sound/usb/usx2y/usbusx2yaudio.c:1001:54: warning: cast from restricted gfp_t
  sound/usb/usx2y/usx2yhwdeppcm.c:774:54: warning: cast from restricted gfp_t
  sound/usb/usx2y/usx2yhwdeppcm.c:778:54: warning: cast from restricted gfp_t

Add __force to the cast to silence the warning.

Signed-off-by: Antonio Ospite <ao2@amarulasolutions.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Antonio Ospite authored and Takashi Iwai committed Jan 29, 2013
1 parent 7b2ee29 commit 019d80d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/sound/memalloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ struct snd_dma_device {
#ifndef snd_dma_pci_data
#define snd_dma_pci_data(pci) (&(pci)->dev)
#define snd_dma_isa_data() NULL
#define snd_dma_continuous_data(x) ((struct device *)(unsigned long)(x))
#define snd_dma_continuous_data(x) ((struct device *)(__force unsigned long)(x))
#endif


Expand Down

0 comments on commit 019d80d

Please sign in to comment.