CC: [email protected]
BCC: [email protected]
CC: [email protected]
TO: Amit Kumar Mahapatra <[email protected]>
CC: Michal Simek <[email protected]>
CC: Tudor Ambarus <[email protected]>
CC: Michael Walle <[email protected]>
CC: Pratyush Yadav <[email protected]>
CC: Miquel Raynal <[email protected]>
CC: Richard Weinberger <[email protected]>
CC: Vignesh Raghavendra <[email protected]>
CC: [email protected]
CC: [email protected]

From: kernel test robot <[email protected]>

drivers/mtd/spi-nor/core.c:2037:10-11: WARNING opportunity for min()


 Check for opencoded min(), max() implementations.
 Generated patches sometimes require adding a cast to fix compile warning.
 Warnings/patches scope intentionally limited to a function body.

Generated by: scripts/coccinelle/misc/minmax.cocci

Fixes: 2747bc2106aa ("mtd: spi-nor: Add dual parallel and stacked mode support")
CC: Amit Kumar Mahapatra <[email protected]>
Reported-by: kernel test robot <[email protected]>
Signed-off-by: kernel test robot <[email protected]>
---

tree:   https://github.com/Xilinx/linux-xlnx xlnx_rebase_v5.15_LTS
head:   1870e0fa79a9d58c6748c34550f3ccea0b515933
commit: 2747bc2106aa429773d9a932c799aa6229595148 [840/1029] mtd: spi-nor: Add 
dual parallel and stacked mode support
:::::: branch date: 34 hours ago
:::::: commit date: 8 weeks ago

Please take the patch only if it's a positive warning. Thanks!

 drivers/mtd/spi-nor/core.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

--- a/drivers/mtd/spi-nor/core.c
+++ b/drivers/mtd/spi-nor/core.c
@@ -2034,10 +2034,7 @@ static int spi_nor_read(struct mtd_info
                                                (offset << nor->shift);
                        }
                }
-               if (len < rem_bank_len)
-                       read_len = len;
-               else
-                       read_len = rem_bank_len;
+               read_len = min(len, rem_bank_len);
 
                /* Wait till previous write/erase is done. */
                ret = spi_nor_wait_till_ready(nor);
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to