Skip to content

Commit

Permalink
mtd: mchp48l640: silence some uninitialized variable warnings
Browse files Browse the repository at this point in the history
Smatch complains that zero length read/writes will lead to an
uninitalized return value.  I don't know if that's possible, but
it's nicer to return a zero literal anyway so let's do that.

Fixes: 88d1250 ("mtd: devices: add support for microchip 48l640 EERAM")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/YMyir961W28TX5dT@mwanda
  • Loading branch information
Dan Carpenter authored and Miquel Raynal committed Jul 15, 2021
1 parent 962bf78 commit e83862e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/mtd/devices/mchp48l640.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ static int mchp48l640_write(struct mtd_info *mtd, loff_t to, size_t len,
woff += ws;
}

return ret;
return 0;
}

static int mchp48l640_read_page(struct mtd_info *mtd, loff_t from, size_t len,
Expand Down Expand Up @@ -286,7 +286,7 @@ static int mchp48l640_read(struct mtd_info *mtd, loff_t from, size_t len,
woff += ws;
}

return ret;
return 0;
};

static const struct mchp48_caps mchp48l640_caps = {
Expand Down

0 comments on commit e83862e

Please sign in to comment.