diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2014-12-02 16:50:24 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-12-03 01:59:04 -0500 |
commit | 492a7ea0a6d3cc9c16ad5f8af832ed4278225b2e (patch) | |
tree | ee926e9d9acaa1c8b93860a25ffc3bd8331df6e5 /sound/aoa | |
parent | 5c34fdf48b9522ca87372b1fae19de8f93ffd130 (diff) |
ALSA: i2sbus: Deletion of unnecessary checks before the function call "release_and_free_resource"
The release_and_free_resource() function tests whether its argument is NULL
and then returns immediately. 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>
Diffstat (limited to 'sound/aoa')
-rw-r--r-- | sound/aoa/soundbus/i2sbus/core.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sound/aoa/soundbus/i2sbus/core.c b/sound/aoa/soundbus/i2sbus/core.c index a80d5ea87ccd..4e2b4fbf2496 100644 --- a/sound/aoa/soundbus/i2sbus/core.c +++ b/sound/aoa/soundbus/i2sbus/core.c | |||
@@ -79,8 +79,7 @@ static void i2sbus_release_dev(struct device *dev) | |||
79 | if (i2sdev->out.dbdma) iounmap(i2sdev->out.dbdma); | 79 | if (i2sdev->out.dbdma) iounmap(i2sdev->out.dbdma); |
80 | if (i2sdev->in.dbdma) iounmap(i2sdev->in.dbdma); | 80 | if (i2sdev->in.dbdma) iounmap(i2sdev->in.dbdma); |
81 | for (i = aoa_resource_i2smmio; i <= aoa_resource_rxdbdma; i++) | 81 | for (i = aoa_resource_i2smmio; i <= aoa_resource_rxdbdma; i++) |
82 | if (i2sdev->allocated_resource[i]) | 82 | release_and_free_resource(i2sdev->allocated_resource[i]); |
83 | release_and_free_resource(i2sdev->allocated_resource[i]); | ||
84 | free_dbdma_descriptor_ring(i2sdev, &i2sdev->out.dbdma_ring); | 83 | free_dbdma_descriptor_ring(i2sdev, &i2sdev->out.dbdma_ring); |
85 | free_dbdma_descriptor_ring(i2sdev, &i2sdev->in.dbdma_ring); | 84 | free_dbdma_descriptor_ring(i2sdev, &i2sdev->in.dbdma_ring); |
86 | for (i = aoa_resource_i2smmio; i <= aoa_resource_rxdbdma; i++) | 85 | for (i = aoa_resource_i2smmio; i <= aoa_resource_rxdbdma; i++) |
@@ -323,8 +322,7 @@ static int i2sbus_add_dev(struct macio_dev *macio, | |||
323 | if (dev->out.dbdma) iounmap(dev->out.dbdma); | 322 | if (dev->out.dbdma) iounmap(dev->out.dbdma); |
324 | if (dev->in.dbdma) iounmap(dev->in.dbdma); | 323 | if (dev->in.dbdma) iounmap(dev->in.dbdma); |
325 | for (i=0;i<3;i++) | 324 | for (i=0;i<3;i++) |
326 | if (dev->allocated_resource[i]) | 325 | release_and_free_resource(dev->allocated_resource[i]); |
327 | release_and_free_resource(dev->allocated_resource[i]); | ||
328 | mutex_destroy(&dev->lock); | 326 | mutex_destroy(&dev->lock); |
329 | kfree(dev); | 327 | kfree(dev); |
330 | return 0; | 328 | return 0; |