]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
mtd: fix mtd_oobavail() incoherent returned value
authorMiquel Raynal <miquel.raynal@bootlin.com>
Sun, 18 Nov 2018 20:18:30 +0000 (21:18 +0100)
committerBoris Brezillon <boris.brezillon@bootlin.com>
Sun, 2 Dec 2018 08:20:39 +0000 (09:20 +0100)
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>
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
include/linux/mtd/mtd.h

index cd0be91bdefa55f568253904c7d374751fffac52..035d641e8847cea56cf39f34a92296feffefe5ae 100644 (file)
@@ -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;
 }