From: Takashi Iwai Date: Tue, 24 May 2016 13:53:36 +0000 (+0200) Subject: ALSA: pcm: Use common PCM_RUNTIME_CHECK() for sanity checks X-Git-Tag: v4.13-rc4~15^2~51 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4e99151435cb2e88b6d0d49939bf836c35e555a3;p=platform%2Fkernel%2Flinux-exynos.git ALSA: pcm: Use common PCM_RUNTIME_CHECK() for sanity checks Just a code cleanup. Reviewed-by: Takashi Sakamoto Signed-off-by: Takashi Iwai --- diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index 0941b9c..05858c9 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c @@ -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;