Message ID | 20181118201831.11636-1-miquel.raynal@bootlin.com |
---|---|
State | Accepted |
Delegated to: | Boris Brezillon |
Headers | show |
Series | [1/2] mtd: fix mtd_oobavail() incoherent returned value | expand |
On Sun, 2018-11-18 at 20:18:30 UTC, Miquel Raynal wrote: > mtd_oobavail() returns either mtd->oovabail or mtd->oobsize. Both > values are unsigned 32-bit entities, so there is no reason to pretend > returning a signed one. > > Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Applied to http://git.infradead.org/linux-mtd.git mtd/next, thanks. Boris
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index cd0be91bdefa..035d641e8847 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h @@ -386,7 +386,7 @@ static inline struct device_node *mtd_get_of_node(struct mtd_info *mtd) return dev_of_node(&mtd->dev); } -static inline int mtd_oobavail(struct mtd_info *mtd, struct mtd_oob_ops *ops) +static inline u32 mtd_oobavail(struct mtd_info *mtd, struct mtd_oob_ops *ops) { return ops->mode == MTD_OPS_AUTO_OOB ? mtd->oobavail : mtd->oobsize; }
mtd_oobavail() returns either mtd->oovabail or mtd->oobsize. Both values are unsigned 32-bit entities, so there is no reason to pretend returning a signed one. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> --- include/linux/mtd/mtd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)