diff mbox

mtd: ndfc: silence an array underflow static checker warning

Message ID 20140731153620.GH31539@mwanda
State Accepted
Commit 5828c60826e9422169b3711aa58a583242864cc8
Headers show

Commit Message

Dan Carpenter July 31, 2014, 3:36 p.m. UTC
We check "cs" for array overflows but we don't check for underflows and
it upsets the static checkers.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Comments

Brian Norris Aug. 4, 2014, 9:15 p.m. UTC | #1
On Thu, Jul 31, 2014 at 06:36:20PM +0300, Dan Carpenter wrote:
> We check "cs" for array overflows but we don't check for underflows and
> it upsets the static checkers.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Queued to l2-mtd.git/next.

Brian
diff mbox

Patch

diff --git a/drivers/mtd/nand/ndfc.c b/drivers/mtd/nand/ndfc.c
index 69eaba6..253a644 100644
--- a/drivers/mtd/nand/ndfc.c
+++ b/drivers/mtd/nand/ndfc.c
@@ -203,7 +203,8 @@  static int ndfc_probe(struct platform_device *ofdev)
 	struct ndfc_controller *ndfc;
 	const __be32 *reg;
 	u32 ccr;
-	int err, len, cs;
+	u32 cs;
+	int err, len;
 
 	/* Read the reg property to get the chip select */
 	reg = of_get_property(ofdev->dev.of_node, "reg", &len);