ALSA: pcm: Use common PCM_RUNTIME_CHECK() for sanity checks
Just a code cleanup. Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
1b745cd974
commit
4e99151435
|
@ -2869,7 +2869,7 @@ static int snd_pcm_playback_ioctl1(struct file *file,
|
||||||
struct snd_pcm_substream *substream,
|
struct snd_pcm_substream *substream,
|
||||||
unsigned int cmd, void __user *arg)
|
unsigned int cmd, void __user *arg)
|
||||||
{
|
{
|
||||||
if (snd_BUG_ON(!substream))
|
if (PCM_RUNTIME_CHECK(substream))
|
||||||
return -ENXIO;
|
return -ENXIO;
|
||||||
if (snd_BUG_ON(substream->stream != SNDRV_PCM_STREAM_PLAYBACK))
|
if (snd_BUG_ON(substream->stream != SNDRV_PCM_STREAM_PLAYBACK))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
@ -2949,7 +2949,7 @@ static int snd_pcm_capture_ioctl1(struct file *file,
|
||||||
struct snd_pcm_substream *substream,
|
struct snd_pcm_substream *substream,
|
||||||
unsigned int cmd, void __user *arg)
|
unsigned int cmd, void __user *arg)
|
||||||
{
|
{
|
||||||
if (snd_BUG_ON(!substream))
|
if (PCM_RUNTIME_CHECK(substream))
|
||||||
return -ENXIO;
|
return -ENXIO;
|
||||||
if (snd_BUG_ON(substream->stream != SNDRV_PCM_STREAM_CAPTURE))
|
if (snd_BUG_ON(substream->stream != SNDRV_PCM_STREAM_CAPTURE))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
Loading…
Reference in New Issue