]> git.openpandora.org Git - pandora-kernel.git/commitdiff
ALSA: Deletion of checks before the function call "iounmap"
authorMarkus Elfring <elfring@users.sourceforge.net>
Sat, 3 Jan 2015 21:55:54 +0000 (22:55 +0100)
committerTakashi Iwai <tiwai@suse.de>
Sun, 4 Jan 2015 14:13:45 +0000 (15:13 +0100)
The iounmap() function performs also input parameter validation.
Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
26 files changed:
sound/aoa/soundbus/i2sbus/core.c
sound/arm/aaci.c
sound/drivers/ml403-ac97cr.c
sound/isa/msnd/msnd_pinnacle.c
sound/parisc/harmony.c
sound/pci/ad1889.c
sound/pci/asihpi/hpioctl.c
sound/pci/atiixp.c
sound/pci/atiixp_modem.c
sound/pci/aw2/aw2-alsa.c
sound/pci/bt87x.c
sound/pci/cs4281.c
sound/pci/cs46xx/cs46xx_lib.c
sound/pci/ctxfi/cthw20k1.c
sound/pci/ctxfi/cthw20k2.c
sound/pci/echoaudio/echoaudio.c
sound/pci/hda/hda_intel.c
sound/pci/lola/lola.c
sound/pci/mixart/mixart.c
sound/pci/nm256/nm256.c
sound/pci/rme9652/hdsp.c
sound/pci/rme9652/hdspm.c
sound/pci/rme9652/rme9652.c
sound/pci/sis7019.c
sound/pci/ymfpci/ymfpci_main.c
sound/ppc/pmac.c

index 837ba99a7524bc47ae0e4ab2e711195b3e6d59b0..b9737fae656a89ba6121eddf4804312f2843dc7f 100644 (file)
@@ -74,10 +74,9 @@ static void i2sbus_release_dev(struct device *dev)
        int i;
 
        i2sdev = container_of(dev, struct i2sbus_dev, sound.ofdev.dev);
-
-       if (i2sdev->intfregs) iounmap(i2sdev->intfregs);
-       if (i2sdev->out.dbdma) iounmap(i2sdev->out.dbdma);
-       if (i2sdev->in.dbdma) iounmap(i2sdev->in.dbdma);
+       iounmap(i2sdev->intfregs);
+       iounmap(i2sdev->out.dbdma);
+       iounmap(i2sdev->in.dbdma);
        for (i = aoa_resource_i2smmio; i <= aoa_resource_rxdbdma; i++)
                release_and_free_resource(i2sdev->allocated_resource[i]);
        free_dbdma_descriptor_ring(i2sdev, &i2sdev->out.dbdma_ring);
@@ -318,9 +317,9 @@ static int i2sbus_add_dev(struct macio_dev *macio,
                        free_irq(dev->interrupts[i], dev);
        free_dbdma_descriptor_ring(dev, &dev->out.dbdma_ring);
        free_dbdma_descriptor_ring(dev, &dev->in.dbdma_ring);
-       if (dev->intfregs) iounmap(dev->intfregs);
-       if (dev->out.dbdma) iounmap(dev->out.dbdma);
-       if (dev->in.dbdma) iounmap(dev->in.dbdma);
+       iounmap(dev->intfregs);
+       iounmap(dev->out.dbdma);
+       iounmap(dev->in.dbdma);
        for (i=0;i<3;i++)
                release_and_free_resource(dev->allocated_resource[i]);
        mutex_destroy(&dev->lock);
index 0e83a73efb16e18dc4a5dc5982e86976dc9e2f2c..4140b1b950544bce0fc0360402d67f7fc5a031d4 100644 (file)
@@ -889,8 +889,8 @@ static int aaci_probe_ac97(struct aaci *aaci)
 static void aaci_free_card(struct snd_card *card)
 {
        struct aaci *aaci = card->private_data;
-       if (aaci->base)
-               iounmap(aaci->base);
+
+       iounmap(aaci->base);
 }
 
 static struct aaci *aaci_init_card(struct amba_device *dev)
index ec01de1cb23b3c4fefa325f3186ea7bae7d532c9..bdcb5721393b1b326497e7a9e4fa43c60a2c3ee5 100644 (file)
@@ -1094,8 +1094,7 @@ static int snd_ml403_ac97cr_free(struct snd_ml403_ac97cr *ml403_ac97cr)
        if (ml403_ac97cr->capture_irq >= 0)
                free_irq(ml403_ac97cr->capture_irq, ml403_ac97cr);
        /* give back "port" */
-       if (ml403_ac97cr->port != NULL)
-               iounmap(ml403_ac97cr->port);
+       iounmap(ml403_ac97cr->port);
        kfree(ml403_ac97cr);
        PDEBUG(INIT_INFO, "free(): (done)\n");
        return 0;
index 65b36825d194a63d366f79eea5ed0adc5f517c04..4c072666115dbd1d2559974fb5701592e7b8ba2a 100644 (file)
@@ -627,8 +627,7 @@ static int snd_msnd_attach(struct snd_card *card)
        return 0;
 
 err_release_region:
-       if (chip->mappedbase)
-               iounmap(chip->mappedbase);
+       iounmap(chip->mappedbase);
        release_mem_region(chip->base, BUFFSIZE);
        release_region(chip->io, DSP_NUMIO);
        free_irq(chip->irq, chip);
index 29604a239c4447b82d14541c5337a62dc10e6f21..f2350c1d6ee89f7978a3ef00a7cdfa6c682a3795 100644 (file)
@@ -893,9 +893,7 @@ snd_harmony_free(struct snd_harmony *h)
        if (h->irq >= 0)
                free_irq(h->irq, h);
 
-       if (h->iobase)
-               iounmap(h->iobase);
-
+       iounmap(h->iobase);
        kfree(h);
        return 0;
 }
index 547ee30540a07974686219610be6f7e90164cbee..0de31290411c97ee6b2da4c57416c181b2611f01 100644 (file)
@@ -853,12 +853,9 @@ snd_ad1889_free(struct snd_ad1889 *chip)
                free_irq(chip->irq, chip);
 
 skip_hw:
-       if (chip->iobase)
-               iounmap(chip->iobase);
-
+       iounmap(chip->iobase);
        pci_release_regions(chip->pci);
        pci_disable_device(chip->pci);
-
        kfree(chip);
        return 0;
 }
index 72af66bdf7149ecaef5a30dd3b4a9736463102e9..67d113356971d04f855362ad6a35c0aa64b2d6dd 100644 (file)
@@ -541,10 +541,8 @@ void asihpi_adapter_remove(struct pci_dev *pci_dev)
        hpi_send_recv_ex(&hm, &hr, HOWNER_KERNEL);
 
        /* unmap PCI memory space, mapped during device init. */
-       for (idx = 0; idx < HPI_MAX_ADAPTER_MEM_SPACES; idx++) {
-               if (pci.ap_mem_base[idx])
-                       iounmap(pci.ap_mem_base[idx]);
-       }
+       for (idx = 0; idx < HPI_MAX_ADAPTER_MEM_SPACES; ++idx)
+               iounmap(pci.ap_mem_base[idx]);
 
        if (pa->irq)
                free_irq(pa->irq, pa);
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge