public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/2] mtd: fix mtd_oobavail() incoherent returned value
@ 2018-11-18 20:11 Miquel Raynal
  2018-11-18 20:11 ` [U-Boot] [PATCH 2/2] mtd: fix Coverity integer handling issue Miquel Raynal
  0 siblings, 1 reply; 7+ messages in thread
From: Miquel Raynal @ 2018-11-18 20:11 UTC (permalink / raw)
  To: u-boot

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(-)

diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index 68e5915324..0525cfd27c 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -390,7 +390,7 @@ static inline void mtd_set_ooblayout(struct mtd_info *mtd,
 	mtd->ooblayout = ooblayout;
 }
 
-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;
 }
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-04-12  5:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-18 20:11 [U-Boot] [PATCH 1/2] mtd: fix mtd_oobavail() incoherent returned value Miquel Raynal
2018-11-18 20:11 ` [U-Boot] [PATCH 2/2] mtd: fix Coverity integer handling issue Miquel Raynal
2018-11-18 20:13   ` Miquel Raynal
2019-04-08  9:43     ` Miquel Raynal
2019-04-08 11:52       ` Tom Rini
2019-04-08 13:42         ` Miquel Raynal
2019-04-12  5:32   ` Jagan Teki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox