* [patch] mmc: mxs-mmc: remove unneeded NULL check
@ 2014-12-16 23:57 Dan Carpenter
2014-12-22 9:57 ` Ulf Hansson
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2014-12-16 23:57 UTC (permalink / raw)
To: Chris Ball
Cc: Ulf Hansson, Grant Likely, Rob Herring, Sascha Hauer,
Fabio Estevam, Roman Peniaev, Peter Griffin, Daniel Willmann,
linux-mmc, kernel-janitors
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.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
index 60c4ca9..a82411a 100644
--- a/drivers/mmc/host/mxs-mmc.c
+++ b/drivers/mmc/host/mxs-mmc.c
@@ -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:
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch] mmc: mxs-mmc: remove unneeded NULL check
2014-12-16 23:57 [patch] mmc: mxs-mmc: remove unneeded NULL check Dan Carpenter
@ 2014-12-22 9:57 ` Ulf Hansson
0 siblings, 0 replies; 2+ messages in thread
From: Ulf Hansson @ 2014-12-22 9:57 UTC (permalink / raw)
To: Dan Carpenter
Cc: Chris Ball, Grant Likely, Rob Herring, Sascha Hauer,
Fabio Estevam, Roman Peniaev, Peter Griffin, Daniel Willmann,
linux-mmc, kernel-janitors
On 17 December 2014 at 00:57, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> 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.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Thanks! Applied for next.
Kind regards
Uffe
>
> diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
> index 60c4ca9..a82411a 100644
> --- a/drivers/mmc/host/mxs-mmc.c
> +++ b/drivers/mmc/host/mxs-mmc.c
> @@ -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:
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-12-22 9:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-16 23:57 [patch] mmc: mxs-mmc: remove unneeded NULL check Dan Carpenter
2014-12-22 9:57 ` Ulf Hansson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox