Patchwork mtd: denali_dt: harmless case of testing the wrong variable

login
register
mail settings
Submitter Dan Carpenter
Date April 1, 2013, 6:21 a.m.
Message ID <20130401062151.GA5197@longonot.mountain>
Download mbox | patch
Permalink /patch/232670/
State New
Headers show

Comments

Dan Carpenter - April 1, 2013, 6:21 a.m.
There is a warning message that can't be printed because we test the
wrong variable.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Artem Bityutskiy - May 10, 2013, 1:11 p.m.
On Mon, 2013-04-01 at 09:21 +0300, Dan Carpenter wrote:
> There is a warning message that can't be printed because we test the
> wrong variable.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Thanks Dan, but there is already a similar fix for this in upstream:

commit 6c67050ab108bcce2576fa1d7a0557eb0376520a
Author: Sachin Kamat <sachin.kamat@linaro.org>

Patch

diff --git a/drivers/mtd/nand/denali_dt.c b/drivers/mtd/nand/denali_dt.c
index 546f8cb..02988b0 100644
--- a/drivers/mtd/nand/denali_dt.c
+++ b/drivers/mtd/nand/denali_dt.c
@@ -42,7 +42,7 @@  static void __iomem *request_and_map(struct device *dev,
 	}
 
 	ptr = devm_ioremap_nocache(dev, res->start, resource_size(res));
-	if (!res)
+	if (!ptr)
 		dev_err(dev, "ioremap_nocache of %s failed!", res->name);
 
 	return ptr;