mtd: Add WARN_ON_ONCE() to mtd_read() to check the return value
authorZhaoLong Wang <wangzhaolong1@huawei.com>
Tue, 26 Sep 2023 06:57:33 +0000 (14:57 +0800)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Mon, 16 Oct 2023 08:50:28 +0000 (10:50 +0200)
commit0339f62a9a778bb7cd4f764cd4640cc89155177e
treec97c521eeced18bbbc59ffc313b3b115157fa577
parent3cff177fc2793a362d784c912f536e69a755925e
mtd: Add WARN_ON_ONCE() to mtd_read() to check the return value

If the driver cannot read all the requested data, -EBADMSG or
-EUCLEAN should never be returned.

Add a WARN_ON_ONCE() to help driver developers detect this error.

Signed-off-by: ZhaoLong Wang <wangzhaolong1@huawei.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20230926065733.3240322-1-wangzhaolong1@huawei.com
drivers/mtd/mtdcore.c