Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 492a7ea0 authored by Markus Elfring's avatar Markus Elfring Committed by Takashi Iwai
Browse files

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: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 5c34fdf4
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -79,7 +79,6 @@ static void i2sbus_release_dev(struct device *dev)
 	if (i2sdev->out.dbdma) iounmap(i2sdev->out.dbdma);
 	if (i2sdev->in.dbdma) iounmap(i2sdev->in.dbdma);
	for (i = aoa_resource_i2smmio; i <= aoa_resource_rxdbdma; i++)
		if (i2sdev->allocated_resource[i])
		release_and_free_resource(i2sdev->allocated_resource[i]);
	free_dbdma_descriptor_ring(i2sdev, &i2sdev->out.dbdma_ring);
	free_dbdma_descriptor_ring(i2sdev, &i2sdev->in.dbdma_ring);
@@ -323,7 +322,6 @@ static int i2sbus_add_dev(struct macio_dev *macio,
	if (dev->out.dbdma) iounmap(dev->out.dbdma);
	if (dev->in.dbdma) iounmap(dev->in.dbdma);
	for (i=0;i<3;i++)
		if (dev->allocated_resource[i])
		release_and_free_resource(dev->allocated_resource[i]);
	mutex_destroy(&dev->lock);
	kfree(dev);