Skip to contentSkip to conversation

mmc: mxs-mmc: remove unneeded NULL check

PATCH Applied Dan Carpenter 2 participants 2 messages Dec 16, 2014 – Dec 22, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: mxs-mmc: remove unneeded NULL check

Static checkers complain about the inconsistent NULL checking here:

	drivers/mmc/host/mxs-mmc.c:680 mxs_mmc_probe()
	warn: variable dereferenced before check 'ssp->dmach' (see line 660)

The variable can't actually be NULL so we can remove the check.

drivers/mmc/host/mxs-mmc.c +1 -2
index 60c4ca9..a82411a 100644
@@ -677,8 +677,7 @@ static int mxs_mmc_probe(struct platform_device *pdev)
 	return 0;
 
 out_free_dma:
-	if (ssp->dmach)
-		dma_release_channel(ssp->dmach);
+	dma_release_channel(ssp->dmach);
 out_clk_disable:
 	clk_disable_unprepare(ssp->clk);
 out_mmc_free:
Applied
#1 lore raw
Quoted 8 lines · Dan Carpenter

Static checkers complain about the inconsistent NULL checking here:

        drivers/mmc/host/mxs-mmc.c:680 mxs_mmc_probe()
        warn: variable dereferenced before check 'ssp->dmach' (see line 660)

The variable can't actually be NULL so we can remove the check.

Thanks! Applied for next.

Kind regards
Uffe

Quoted 15 lines
drivers/mmc/host/mxs-mmc.c +1 -2
index 60c4ca9..a82411a 100644
@@ -677,8 +677,7 @@ static int mxs_mmc_probe(struct platform_device *pdev)
        return 0;
 
 out_free_dma:
-       if (ssp->dmach)
-               dma_release_channel(ssp->dmach);
+       dma_release_channel(ssp->dmach);
 out_clk_disable:
        clk_disable_unprepare(ssp->clk);
 out_mmc_free: