summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMiquel Raynal <miquel.raynal@bootlin.com>2018-11-18 21:18:30 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-12-17 20:38:32 +0100
commit1c1dc30605fd146e9acfdb92c595d99f7861d14b (patch)
tree62f10fd30e309c236cbd7d318f8e71fa58e1399b /include
parenta87bd630bc84586f181f07a90a1f2ad715148a06 (diff)
mtd: fix mtd_oobavail() incoherent returned value
[ Upstream commit 4348433d8c0234f44adb6e12112e69343f50f0c5 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mtd/mtd.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index 6cd0f6b7658b..aadc2ee050f1 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -401,7 +401,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;
}