All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@inria.fr>
To: kbuild-all@lists.01.org, linux-arm-kernel@lists.infradead.org,
	 Amit Kumar Mahapatra <amit.kumar-mahapatra@xilinx.com>,
	 Michal Simek <monstr@monstr.eu>,
	 Tudor Ambarus <tudor.ambarus@microchip.com>,
	 Michael Walle <michael@walle.cc>,
	Pratyush Yadav <p.yadav@ti.com>,
	 Miquel Raynal <miquel.raynal@bootlin.com>,
	 Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	 linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: [PATCH] mtd: spi-nor: fix minmax.cocci warnings
Date: Sat, 26 Mar 2022 09:30:25 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.22.394.2203260929310.3141@hadrien> (raw)

From: kernel test robot <lkp@intel.com>

Use min to simplify the code.

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

Fixes: 2747bc2106aa ("mtd: spi-nor: Add dual parallel and stacked mode support")
CC: Amit Kumar Mahapatra <amit.kumar-mahapatra@xilinx.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@inria.fr>
---

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

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

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

WARNING: multiple messages have this Message-ID (diff)
From: Julia Lawall <julia.lawall@inria.fr>
To: kbuild-all@lists.01.org, linux-arm-kernel@lists.infradead.org,
	 Amit Kumar Mahapatra <amit.kumar-mahapatra@xilinx.com>,
	 Michal Simek <monstr@monstr.eu>,
	 Tudor Ambarus <tudor.ambarus@microchip.com>,
	 Michael Walle <michael@walle.cc>,
	Pratyush Yadav <p.yadav@ti.com>,
	 Miquel Raynal <miquel.raynal@bootlin.com>,
	 Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	 linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: [PATCH] mtd: spi-nor: fix minmax.cocci warnings
Date: Sat, 26 Mar 2022 09:30:25 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.22.394.2203260929310.3141@hadrien> (raw)

From: kernel test robot <lkp@intel.com>

Use min to simplify the code.

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

Fixes: 2747bc2106aa ("mtd: spi-nor: Add dual parallel and stacked mode support")
CC: Amit Kumar Mahapatra <amit.kumar-mahapatra@xilinx.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@inria.fr>
---

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

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: Julia Lawall <julia.lawall@inria.fr>
To: kbuild-all@lists.01.org
Subject: [PATCH] mtd: spi-nor: fix minmax.cocci warnings
Date: Sat, 26 Mar 2022 09:30:25 +0100	[thread overview]
Message-ID: <alpine.DEB.2.22.394.2203260929310.3141@hadrien> (raw)

[-- Attachment #1: Type: text/plain, Size: 1222 bytes --]

From: kernel test robot <lkp@intel.com>

Use min to simplify the code.

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

Fixes: 2747bc2106aa ("mtd: spi-nor: Add dual parallel and stacked mode support")
CC: Amit Kumar Mahapatra <amit.kumar-mahapatra@xilinx.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@inria.fr>
---

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

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

WARNING: multiple messages have this Message-ID (diff)
From: Julia Lawall <julia.lawall@inria.fr>
To: kbuild-all@lists.01.org, linux-arm-kernel@lists.infradead.org,
	Amit Kumar Mahapatra <amit.kumar-mahapatra@xilinx.com>,
	Michal Simek <monstr@monstr.eu>,
	Tudor Ambarus <tudor.ambarus@microchip.com>,
	Michael Walle <michael@walle.cc>, Pratyush Yadav <p.yadav@ti.com>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: [PATCH] mtd: spi-nor: fix minmax.cocci warnings
Date: Sat, 26 Mar 2022 09:30:25 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.22.394.2203260929310.3141@hadrien> (raw)

From: kernel test robot <lkp@intel.com>

Use min to simplify the code.

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

Fixes: 2747bc2106aa ("mtd: spi-nor: Add dual parallel and stacked mode support")
CC: Amit Kumar Mahapatra <amit.kumar-mahapatra@xilinx.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@inria.fr>
---

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

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

             reply	other threads:[~2022-03-26  8:31 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-26  8:30 Julia Lawall [this message]
2022-03-26  8:30 ` [PATCH] mtd: spi-nor: fix minmax.cocci warnings Julia Lawall
2022-03-26  8:30 ` Julia Lawall
2022-03-26  8:30 ` Julia Lawall
2022-03-28  5:58 ` Vignesh Raghavendra
2022-03-28  5:58   ` Vignesh Raghavendra
2022-03-28  5:58   ` Vignesh Raghavendra
2022-03-28  5:58   ` Vignesh Raghavendra
2022-03-29 11:38   ` Pratyush Yadav
2022-03-29 11:38     ` Pratyush Yadav
2022-03-29 11:38     ` Pratyush Yadav
2022-03-29 11:38     ` Pratyush Yadav
  -- strict thread matches above, loose matches on Subject: below --
2022-03-26  0:27 [xilinx-xlnx:xlnx_rebase_v5.15_LTS 840/1029] drivers/mtd/spi-nor/core.c:2037:10-11: WARNING opportunity for min() kernel test robot
2022-03-26  0:18 ` [PATCH] mtd: spi-nor: fix minmax.cocci warnings kernel test robot
2022-02-09 11:35 Julia Lawall
2022-02-09 11:35 ` Julia Lawall
2022-02-09 11:35 ` Julia Lawall
2022-02-09 11:35 ` Julia Lawall
2022-02-08 21:07 [xilinx-xlnx:xlnx_rebase_v5.15 840/872] drivers/mtd/spi-nor/core.c:2037:10-11: WARNING opportunity for min() kernel test robot
2022-02-08 21:06 ` [PATCH] mtd: spi-nor: fix minmax.cocci warnings kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.22.394.2203260929310.3141@hadrien \
    --to=julia.lawall@inria.fr \
    --cc=amit.kumar-mahapatra@xilinx.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=michael@walle.cc \
    --cc=miquel.raynal@bootlin.com \
    --cc=monstr@monstr.eu \
    --cc=p.yadav@ti.com \
    --cc=richard@nod.at \
    --cc=tudor.ambarus@microchip.com \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.