ALSA: pcm: Use common PCM_RUNTIME_CHECK() for sanity checks
authorTakashi Iwai <tiwai@suse.de>
Tue, 24 May 2016 13:53:36 +0000 (15:53 +0200)
committerTakashi Iwai <tiwai@suse.de>
Wed, 14 Jun 2017 05:44:19 +0000 (07:44 +0200)
Just a code cleanup.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/pcm_native.c

index 0941b9c92b3f0b1c7594fd4102cec1ea73525869..05858c91c0eac4ad59cd13b0cf44b334cd6aaf21 100644 (file)
@@ -2869,7 +2869,7 @@ static int snd_pcm_playback_ioctl1(struct file *file,
                                   struct snd_pcm_substream *substream,
                                   unsigned int cmd, void __user *arg)
 {
-       if (snd_BUG_ON(!substream))
+       if (PCM_RUNTIME_CHECK(substream))
                return -ENXIO;
        if (snd_BUG_ON(substream->stream != SNDRV_PCM_STREAM_PLAYBACK))
                return -EINVAL;
@@ -2949,7 +2949,7 @@ static int snd_pcm_capture_ioctl1(struct file *file,
                                  struct snd_pcm_substream *substream,
                                  unsigned int cmd, void __user *arg)
 {
-       if (snd_BUG_ON(!substream))
+       if (PCM_RUNTIME_CHECK(substream))
                return -ENXIO;
        if (snd_BUG_ON(substream->stream != SNDRV_PCM_STREAM_CAPTURE))
                return -EINVAL;