[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201410150045.53976.marex@denx.de>
Date: Wed, 15 Oct 2014 00:45:53 +0200
From: Marek Vasut <marex@...x.de>
To: "Bean Huo 霍斌斌 (beanhuo)"
<beanhuo@...ron.com>
Cc: "dwmw2@...radead.org" <dwmw2@...radead.org>,
Brian Norris <computersforpeace@...il.com>,
"shijie8@...il.com" <shijie8@...il.com>,
"geert+renesas@...der.be" <geert+renesas@...der.be>,
"grmoore@...era.com" <grmoore@...era.com>,
"linux-mtd@...ts.infradead.org" <linux-mtd@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/1 v2] driver:mtd:spi-nor:fix spi_nor_scan overwrite platform ID point
On Tuesday, October 14, 2014 at 03:26:49 AM, Bean Huo 霍斌斌 (beanhuo) wrote:
[...]
> - dev_warn(dev, "found %s, expected %s\n",
> - jid->name, id->name);
> - id = jid;
> - info = (void *)jid->driver_data;
> + struct flash_info *tmpinfo;
> +
> + tmpinfo = (void *)jid->driver_data;
> + if (tmpinfo->jedec_id != info->jedec_id ||
> + (info->ext_id != 0 &&
> + tmpinfo->ext_id != info->ext_id)) {
> + dev_warn(dev, "found %s, expected %s\n",
> + jid->name, id->name);
> + id = jid;
> + info = (void *)jid->driver_data;
> + }
Won't $info contain an undefined value in case the newly added condition isn't
met ? The old code initialized $info to a certain value always, the new code
does not do that.
Best regards,
Marek Vasut
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists