aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorBrian Norris <computersforpeace@gmail.com>2016-03-07 18:52:05 -0500
committerBrian Norris <computersforpeace@gmail.com>2016-07-09 21:48:53 -0400
commitb137aab438382fdadfe1272869357485af0252b4 (patch)
treeaca0d7028b98bbbc2c00aa694b9034141af3aa56 /drivers/mtd
parentc3cb77f8980db9dba614822d2d4a4cc61e44c8e2 (diff)
mtd: physmap_of: fix set but unused warning
drivers/mtd/maps/physmap_of.c: In function ‘of_flash_probe’: drivers/mtd/maps/physmap_of.c:165:16: warning: variable ‘p’ set but not used [-Wunused-but-set-variable] This could be a problem if the 'reg' property is not set, since that means 'count' will be uninitialized. Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/maps/physmap_of.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/maps/physmap_of.c b/drivers/mtd/maps/physmap_of.c
index 22f3858c0364..3fad35942895 100644
--- a/drivers/mtd/maps/physmap_of.c
+++ b/drivers/mtd/maps/physmap_of.c
@@ -186,7 +186,7 @@ static int of_flash_probe(struct platform_device *dev)
186 * consists internally of 2 non-identical NOR chips on one die. 186 * consists internally of 2 non-identical NOR chips on one die.
187 */ 187 */
188 p = of_get_property(dp, "reg", &count); 188 p = of_get_property(dp, "reg", &count);
189 if (count % reg_tuple_size != 0) { 189 if (!p || count % reg_tuple_size != 0) {
190 dev_err(&dev->dev, "Malformed reg property on %s\n", 190 dev_err(&dev->dev, "Malformed reg property on %s\n",
191 dev->dev.of_node->full_name); 191 dev->dev.of_node->full_name);
192 err = -EINVAL; 192 err = -EINVAL;