diff mbox series

[05/20] mtd: nand: ecc-bch: Return only valid error codes

Message ID 20200929230124.31491-6-miquel.raynal@bootlin.com
State Accepted
Headers show
Series Create generic software ECC engines | expand

Commit Message

Miquel Raynal Sept. 29, 2020, 11:01 p.m. UTC
When a function is not available, returning -ENOTSUPP makes much more
sense than returning -1.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 include/linux/mtd/nand-ecc-sw-bch.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Miquel Raynal Oct. 30, 2020, 5:29 p.m. UTC | #1
On Tue, 2020-09-29 at 23:01:09 UTC, Miquel Raynal wrote:
> When a function is not available, returning -ENOTSUPP makes much more
> sense than returning -1.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next.

Miquel
diff mbox series

Patch

diff --git a/include/linux/mtd/nand-ecc-sw-bch.h b/include/linux/mtd/nand-ecc-sw-bch.h
index b62b8bd4669f..d92d2abcfcef 100644
--- a/include/linux/mtd/nand-ecc-sw-bch.h
+++ b/include/linux/mtd/nand-ecc-sw-bch.h
@@ -43,7 +43,7 @@  static inline int
 nand_bch_calculate_ecc(struct nand_chip *chip, const u_char *dat,
 		       u_char *ecc_code)
 {
-	return -1;
+	return -ENOTSUPP;
 }
 
 static inline int