]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ALSA: compress: Remove pointless NULL check
authorCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Wed, 4 May 2016 13:59:09 +0000 (14:59 +0100)
committerTakashi Iwai <tiwai@suse.de>
Mon, 9 May 2016 15:35:32 +0000 (17:35 +0200)
stream can't be NULL here as we have just taken the address of it, so no
need for the check.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/compress_offload.c

index 5268546d6935691da51ce5c54d72ba381ea90830..5215df2940b335eeeb8ed3c273a3c54714883c48 100644 (file)
@@ -392,9 +392,8 @@ static unsigned int snd_compr_poll(struct file *f, poll_table *wait)
 
        if (snd_BUG_ON(!data))
                return -EFAULT;
+
        stream = &data->stream;
-       if (snd_BUG_ON(!stream))
-               return -EFAULT;
 
        mutex_lock(&stream->device->lock);
        if (stream->runtime->state == SNDRV_PCM_STATE_OPEN) {
@@ -799,9 +798,9 @@ static long snd_compr_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
 
        if (snd_BUG_ON(!data))
                return -EFAULT;
+
        stream = &data->stream;
-       if (snd_BUG_ON(!stream))
-               return -EFAULT;
+
        mutex_lock(&stream->device->lock);
        switch (_IOC_NR(cmd)) {
        case _IOC_NR(SNDRV_COMPRESS_IOCTL_VERSION):