All of lore.kernel.org
 help / color / mirror / Atom feed
* [jlawall:for-5.12 1/6] drivers/scsi/hpsa.c:2668:28-29: WARNING opportunity for min()
@ 2021-05-02  1:01 kernel test robot
  2021-05-02  1:01 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
  2021-05-02  1:01 ` kernel test robot
  0 siblings, 2 replies; 54+ messages in thread
From: kernel test robot @ 2021-05-02  1:01 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux.git for-5.12
head:   afa104b04309a6e882f6797216e74489c0d5534f
commit: 8636e3295ce33515c50ef728f0ff3800d97f9f44 [1/6] coccinelle: misc: add minmax script
:::::: branch date: 4 days ago
:::::: commit date: 6 weeks ago
config: riscv-allyesconfig (attached as .config)
compiler: riscv64-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@lip6.fr>


cocci warnings: (new ones prefixed by >>)
>> drivers/scsi/hpsa.c:2668:28-29: WARNING opportunity for min()
   drivers/scsi/hpsa.c:3634:34-36: WARNING opportunity for min()
--
>> drivers/message/fusion/mptctl.c:1618:29-30: WARNING opportunity for min()

Please review and possibly fold the followup patch.

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 68967 bytes --]

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2021-05-02  1:01 [jlawall:for-5.12 1/6] drivers/scsi/hpsa.c:2668:28-29: WARNING opportunity for min() kernel test robot
@ 2021-05-02  1:01 ` kernel test robot
  2021-05-02  1:01 ` kernel test robot
  1 sibling, 0 replies; 54+ messages in thread
From: kernel test robot @ 2021-05-02  1:01 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: Don Brace <don.brace@microchip.com>
CC: "James E.J. Bottomley" <jejb@linux.ibm.com>
CC: "Martin K. Petersen" <martin.petersen@oracle.com>
CC: storagedev(a)microchip.com
CC: linux-scsi(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

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

drivers/scsi/hpsa.c:2668:28-29: WARNING opportunity for min()
drivers/scsi/hpsa.c:3634:34-36: 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: 8636e3295ce3 ("coccinelle: misc: add minmax script")
CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux.git for-5.12
head:   afa104b04309a6e882f6797216e74489c0d5534f
commit: 8636e3295ce33515c50ef728f0ff3800d97f9f44 [1/6] coccinelle: misc: add minmax script
:::::: branch date: 4 days ago
:::::: commit date: 6 weeks ago

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

 hpsa.c |   11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -2665,10 +2665,8 @@ static void complete_scsi_command(struct
 	case CMD_TARGET_STATUS:
 		cmd->result |= ei->ScsiStatus;
 		/* copy the sense data */
-		if (SCSI_SENSE_BUFFERSIZE < sizeof(ei->SenseInfo))
-			sense_data_size = SCSI_SENSE_BUFFERSIZE;
-		else
-			sense_data_size = sizeof(ei->SenseInfo);
+		sense_data_size = min(SCSI_SENSE_BUFFERSIZE,
+				      sizeof(ei->SenseInfo));
 		if (ei->SenseLen < sense_data_size)
 			sense_data_size = ei->SenseLen;
 		memcpy(cmd->sense_buffer, ei->SenseInfo, sense_data_size);
@@ -3631,10 +3629,7 @@ static bool hpsa_vpd_page_supported(stru
 	if (rc != 0)
 		goto exit_unsupported;
 	pages = buf[3];
-	if ((pages + HPSA_VPD_HEADER_SZ) <= 255)
-		bufsize = pages + HPSA_VPD_HEADER_SZ;
-	else
-		bufsize = 255;
+	bufsize = min(pages + HPSA_VPD_HEADER_SZ, 255);
 
 	/* Get the whole VPD page list */
 	rc = hpsa_scsi_do_inquiry(h, scsi3addr,

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2021-05-02  1:01 [jlawall:for-5.12 1/6] drivers/scsi/hpsa.c:2668:28-29: WARNING opportunity for min() kernel test robot
  2021-05-02  1:01 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
@ 2021-05-02  1:01 ` kernel test robot
  1 sibling, 0 replies; 54+ messages in thread
From: kernel test robot @ 2021-05-02  1:01 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: Sathya Prakash <sathya.prakash@broadcom.com>
CC: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
CC: Suganath Prabu Subramani <suganath-prabu.subramani@broadcom.com>
CC: MPT-FusionLinux.pdl(a)broadcom.com
CC: linux-scsi(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

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

drivers/message/fusion/mptctl.c:1618:29-30: 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: 8636e3295ce3 ("coccinelle: misc: add minmax script")
CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux.git for-5.12
head:   afa104b04309a6e882f6797216e74489c0d5534f
commit: 8636e3295ce33515c50ef728f0ff3800d97f9f44 [1/6] coccinelle: misc: add minmax script
:::::: branch date: 4 days ago
:::::: commit date: 6 weeks ago

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

 mptctl.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/message/fusion/mptctl.c
+++ b/drivers/message/fusion/mptctl.c
@@ -1615,7 +1615,7 @@ mptctl_eventreport (MPT_ADAPTER *ioc, un
 	maxEvents = numBytes/sizeof(MPT_IOCTL_EVENTS);
 
 
-	max = MPTCTL_EVENT_LOG_SIZE < maxEvents ? MPTCTL_EVENT_LOG_SIZE : maxEvents;
+	max = min(MPTCTL_EVENT_LOG_SIZE, maxEvents);
 
 	/* If fewer than 1 event is requested, there must have
 	 * been some type of error.

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2022-04-28 15:23 drivers/dma/sprd-dma.c:685:23-24: WARNING opportunity for max() kernel test robot
@ 2022-04-28 15:17 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2022-04-28 15:17 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: Vinod Koul <vkoul@kernel.org>
CC: Orson Zhai <orsonzhai@gmail.com>
CC: Baolin Wang <baolin.wang7@gmail.com>
CC: Chunyan Zhang <zhang.lyra@gmail.com>
CC: dmaengine(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

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

drivers/dma/sprd-dma.c:685:23-24: WARNING opportunity for max()


 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

CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   8f4dd16603ce834d1c5c4da67803ea82dd282511
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 19 hours ago
:::::: commit date: 12 months ago

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

 drivers/dma/sprd-dma.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

--- a/drivers/dma/sprd-dma.c
+++ b/drivers/dma/sprd-dma.c
@@ -682,10 +682,7 @@ static enum dma_status sprd_dma_tx_statu
 			pos = hw->trsc_len;
 		else if (hw->blk_len > 0)
 			pos = hw->blk_len;
-		else if (hw->frg_len > 0)
-			pos = hw->frg_len;
-		else
-			pos = 0;
+		else pos = max(hw->frg_len, 0);
 	} else if (schan->cur_desc && schan->cur_desc->vd.tx.cookie == cookie) {
 		struct sprd_dma_desc *sdesc = schan->cur_desc;
 

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2022-04-26  9:52 drivers/md/dm-raid.c:3218:44-45: WARNING opportunity for min() kernel test robot
@ 2022-04-26  9:44 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2022-04-26  9:44 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: linux-kernel(a)vger.kernel.org

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

drivers/md/dm-raid.c:3218:44-45: 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

CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   d615b5416f8a1afeb82d13b238f8152c572d59c0
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 16 hours ago
:::::: commit date: 12 months ago

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

 dm-raid.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- drivermd/dm-raid.c
@@ -3215,7 +3215,8 @@ size_check:
 			if (r)
 				goto bad;
 
-			rs_setup_recovery(rs, rs->md.recovery_cp < rs->md.dev_sectors ? rs->md.recovery_cp : rs->md.dev_sectors);
+			rs_setup_recovery(rs,
+					  min(rs->md.recovery_cp, rs->md.dev_sectors));
 		} else {
 		* This is no size change or it is shrinking, update size and record in superblocks */
 			r = rs_set_dev_and_array_sectors(rs, rs->ti->len, false);

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2022-04-23 22:58 drivers/md/dm-raid.c:3218:44-45: WARNING opportunity for min() kernel test robot
@ 2022-04-23 22:54 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2022-04-23 22:54 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: linux-kernel(a)vger.kernel.org

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

drivers/md/dm-raid.c:3218:44-45: 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

CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   c00c5e1d157bec0ef0b0b59aa5482eb8dc7e8e49
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 22 hours ago
:::::: commit date: 12 months ago

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

 dm-raid.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- drivermd/dm-raid.c
@@ -3215,7 +3215,8 @@ size_check:
 			if (r)
 				goto bad;
 
-			rs_setup_recovery(rs, rs->md.recovery_cp < rs->md.dev_sectors ? rs->md.recovery_cp : rs->md.dev_sectors);
+			rs_setup_recovery(rs,
+					  min(rs->md.recovery_cp, rs->md.dev_sectors));
 		} else {
 		* This is no size change or it is shrinking, update size and record in superblocks */
 			r = rs_set_dev_and_array_sectors(rs, rs->ti->len, false);

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2022-04-23 11:53 arch/powerpc/kernel/sysfs.c:456:36-37: WARNING opportunity for max() kernel test robot
@ 2022-04-23 11:44 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2022-04-23 11:44 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: Michael Ellerman <mpe@ellerman.id.au>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: Paul Mackerras <paulus@samba.org>
CC: linuxppc-dev(a)lists.ozlabs.org
CC: linux-kernel(a)vger.kernel.org

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

arch/powerpc/kernel/sysfs.c:456:36-37: WARNING opportunity for max()
arch/powerpc/kernel/sysfs.c:334:36-37: WARNING opportunity for max()


 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

CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   c00c5e1d157bec0ef0b0b59aa5482eb8dc7e8e49
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 10 hours ago
:::::: commit date: 12 months ago

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

 arch/powerpc/kernel/sysfs.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/arch/powerpc/kernel/sysfs.c
+++ b/arch/powerpc/kernel/sysfs.c
@@ -331,7 +331,7 @@ static ssize_t show_pw20_wait_time(struc
 		time = pw20_wt;
 	}
 
-	return sprintf(buf, "%llu\n", time > 0 ? time : 0);
+	return sprintf(buf, "%llu\n", max(time, 0));
 }
 
 static void set_pw20_wait_entry_bit(void *val)
@@ -453,7 +453,7 @@ static ssize_t show_altivec_idle_wait_ti
 		time = altivec_idle_wt;
 	}
 
-	return sprintf(buf, "%llu\n", time > 0 ? time : 0);
+	return sprintf(buf, "%llu\n", max(time, 0));
 }
 
 static void set_altivec_idle_wait_entry_bit(void *val)

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2022-04-21 23:47 net/rxrpc/input.c:870:38-39: WARNING opportunity for min() kernel test robot
@ 2022-04-21 23:40 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2022-04-21 23:40 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: David Howells <dhowells@redhat.com>
CC: Jakub Kicinski <kuba@kernel.org>
CC: linux-afs(a)lists.infradead.org
CC: netdev(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

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

net/rxrpc/input.c:870:38-39: 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

CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   59f0c2447e2553b0918b4a9fd38763a5c0587d02
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 4 hours ago
:::::: commit date: 12 months ago

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

 net/rxrpc/input.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/net/rxrpc/input.c
+++ b/net/rxrpc/input.c
@@ -867,8 +867,7 @@ static void rxrpc_input_ack(struct rxrpc
 	prev_pkt = ntohl(buf.ack.previousPacket);
 	hard_ack = first_soft_ack - 1;
 	nr_acks = buf.ack.nAcks;
-	summary.ack_reason = (buf.ack.reason < RXRPC_ACK__INVALID ?
-			      buf.ack.reason : RXRPC_ACK__INVALID);
+	summary.ack_reason = min(buf.ack.reason, RXRPC_ACK__INVALID);
 
 	trace_rxrpc_rx_ack(call, ack_serial, acked_serial,
 			   first_soft_ack, prev_pkt,

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2022-04-21 10:13 drivers/spi/spi-fsl-lpspi.c:446:12-14: WARNING opportunity for min() kernel test robot
@ 2022-04-21 10:04 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2022-04-21 10:04 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: Mark Brown <broonie@kernel.org>
CC: linux-spi(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

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

drivers/spi/spi-fsl-lpspi.c:446:12-14: 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

CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   b253435746d9a4a701b5f09211b9c14d3370d0da
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 14 hours ago
:::::: commit date: 12 months ago

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

 drivers/spi/spi-fsl-lpspi.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

--- a/drivers/spi/spi-fsl-lpspi.c
+++ b/drivers/spi/spi-fsl-lpspi.c
@@ -443,10 +443,7 @@ static int fsl_lpspi_setup_transfer(stru
 		fsl_lpspi->tx = fsl_lpspi_buf_tx_u32;
 	}
 
-	if (t->len <= fsl_lpspi->txfifosize)
-		fsl_lpspi->watermark = t->len;
-	else
-		fsl_lpspi->watermark = fsl_lpspi->txfifosize;
+	fsl_lpspi->watermark = min(t->len, fsl_lpspi->txfifosize);
 
 	if (fsl_lpspi_can_dma(controller, spi, t))
 		fsl_lpspi->usedma = true;

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2022-04-16 17:52 drivers/tty/goldfish.c:95:12-13: WARNING opportunity for min() kernel test robot
@ 2022-04-16 17:49 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2022-04-16 17:49 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
CC: Jiri Slaby <jirislaby@kernel.org>
CC: linux-kernel(a)vger.kernel.org

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

drivers/tty/goldfish.c:95:12-13: 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

CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   59250f8a7f3a60a2661b84cbafc1e0eb5d05ec9b
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 19 hours ago
:::::: commit date: 12 months ago

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

 drivers/tty/goldfish.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/tty/goldfish.c
+++ b/drivers/tty/goldfish.c
@@ -92,7 +92,7 @@ static void goldfish_tty_rw(struct goldf
 		while (addr < addr_end) {
 			unsigned long pg_end = (addr & PAGE_MASK) + PAGE_SIZE;
 			unsigned long next =
-					pg_end < addr_end ? pg_end : addr_end;
+					min(pg_end, addr_end);
 			unsigned long avail = next - addr;
 
 			/*

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2022-04-15 16:02 drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c:348:85-86: WARNING opportunity for max() kernel test robot
@ 2022-04-15 15:58 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2022-04-15 15:58 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: Evan Quan <evan.quan@amd.com>
CC: Alex Deucher <alexander.deucher@amd.com>
CC: "Christian König" <christian.koenig@amd.com>
CC: David Airlie <airlied@linux.ie>
CC: Daniel Vetter <daniel@ffwll.ch>
CC: amd-gfx(a)lists.freedesktop.org
CC: dri-devel(a)lists.freedesktop.org
CC: linux-kernel(a)vger.kernel.org

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

drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c:348:85-86: WARNING opportunity for max()
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c:351:52-53: WARNING opportunity for max()


 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

CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   028192fea1de083f4f12bfb1eb7c4d7beb5c8ecd
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 17 hours ago
:::::: commit date: 12 months ago

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

 drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c |   10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

--- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c
+++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c
@@ -345,12 +345,10 @@ static int vega10_odn_initial_default_se
 		odn_table->min_vddc = dep_table[0]->entries[0].vddc;
 
 	i = od_table[2]->count - 1;
-	od_table[2]->entries[i].clk = hwmgr->platform_descriptor.overdriveLimit.memoryClock > od_table[2]->entries[i].clk ?
-					hwmgr->platform_descriptor.overdriveLimit.memoryClock :
-					od_table[2]->entries[i].clk;
-	od_table[2]->entries[i].vddc = odn_table->max_vddc > od_table[2]->entries[i].vddc ?
-					odn_table->max_vddc :
-					od_table[2]->entries[i].vddc;
+	od_table[2]->entries[i].clk = max(hwmgr->platform_descriptor.overdriveLimit.memoryClock,
+					  od_table[2]->entries[i].clk);
+	od_table[2]->entries[i].vddc = max(odn_table->max_vddc,
+					   od_table[2]->entries[i].vddc);
 
 	return 0;
 }

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2022-04-06  9:00 drivers/net/wireless/ath/ath9k/ar9003_phy.c:1829:19-21: WARNING opportunity for min() kernel test robot
@ 2022-04-06  8:52 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2022-04-06  8:52 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: ath9k-devel(a)qca.qualcomm.com
CC: Kalle Valo <kvalo@codeaurora.org>
CC: Jakub Kicinski <kuba@kernel.org>
CC: linux-wireless(a)vger.kernel.org
CC: netdev(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

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

drivers/net/wireless/ath/ath9k/ar9003_phy.c:1829:19-21: 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

CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   3e732ebf7316ac83e8562db7e64cc68aec390a18
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 15 hours ago
:::::: commit date: 11 months ago

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

 drivers/net/wireless/ath/ath9k/ar9003_phy.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
@@ -1826,7 +1826,7 @@ static void ar9003_hw_tx99_set_txpower(s
 	static u8 p_pwr_array[ar9300RateSize] = { 0 };
 	unsigned int i;
 
-	txpower = txpower <= MAX_RATE_POWER ? txpower : MAX_RATE_POWER;
+	txpower = min(txpower, MAX_RATE_POWER);
 	for (i = 0; i < ar9300RateSize; i++)
 		p_pwr_array[i] = txpower;
 

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2022-04-02  5:38 sound/pci/hda/hda_codec.c:337:19-20: WARNING opportunity for min() kernel test robot
@ 2022-04-02  5:28 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2022-04-02  5:28 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: Jaroslav Kysela <perex@perex.cz>
CC: Takashi Iwai <tiwai@suse.com>
CC: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
CC: alsa-devel(a)alsa-project.org
CC: linux-kernel(a)vger.kernel.org

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

sound/pci/hda/hda_codec.c:337:19-20: 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

CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   88e6c0207623874922712e162e25d9dafd39661e
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 3 hours ago
:::::: commit date: 11 months ago

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

 sound/pci/hda/hda_codec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -334,7 +334,7 @@ int snd_hda_get_devices(struct hda_codec
 		return 0;
 
 	dev_len = parm + 1;
-	dev_len = dev_len < max_devices ? dev_len : max_devices;
+	dev_len = min(dev_len, max_devices);
 
 	devices = 0;
 	while (devices < dev_len) {

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2022-03-31  8:33 drivers/input/joystick/adi.c:395:13-14: WARNING opportunity for min() kernel test robot
@ 2022-03-31  8:30 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2022-03-31  8:30 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: Dmitry Torokhov <dmitry.torokhov@gmail.com>
CC: linux-input(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

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

drivers/input/joystick/adi.c:395:13-14: 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

CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   787af64d05cd528aac9ad16752d11bb1c6061bb9
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 10 hours ago
:::::: commit date: 11 months ago

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

 drivers/input/joystick/adi.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/input/joystick/adi.c
+++ b/drivers/input/joystick/adi.c
@@ -392,7 +392,7 @@ static int adi_init_input(struct adi *ad
 	if (!input_dev)
 		return -ENOMEM;
 
-	t = adi->id < ADI_ID_MAX ? adi->id : ADI_ID_MAX;
+	t = min(adi->id, ADI_ID_MAX);
 
 	snprintf(buf, ADI_MAX_PHYS_LENGTH, adi_names[t], adi->id);
 	snprintf(adi->name, ADI_MAX_NAME_LENGTH, "Logitech %s [%s]", buf, adi->cname);

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2022-03-31  1:56 drivers/tty/goldfish.c:95:12-13: WARNING opportunity for min() kernel test robot
@ 2022-03-31  1:54 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2022-03-31  1:54 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
CC: Jiri Slaby <jirislaby@kernel.org>
CC: linux-kernel(a)vger.kernel.org

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

drivers/tty/goldfish.c:95:12-13: 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

CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   74164d284b2909de0ba13518cc063e9ea9334749
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 8 hours ago
:::::: commit date: 11 months ago

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

 drivers/tty/goldfish.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/tty/goldfish.c
+++ b/drivers/tty/goldfish.c
@@ -92,7 +92,7 @@ static void goldfish_tty_rw(struct goldf
 		while (addr < addr_end) {
 			unsigned long pg_end = (addr & PAGE_MASK) + PAGE_SIZE;
 			unsigned long next =
-					pg_end < addr_end ? pg_end : addr_end;
+					min(pg_end, addr_end);
 			unsigned long avail = next - addr;
 
 			/*

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2022-03-28 12:05 sound/core/seq/seq_ports.c:142:12-14: WARNING opportunity for max() kernel test robot
@ 2022-03-28 12:03 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2022-03-28 12:03 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: Jaroslav Kysela <perex@perex.cz>
CC: Takashi Iwai <tiwai@suse.com>
CC: alsa-devel(a)alsa-project.org
CC: linux-kernel(a)vger.kernel.org

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

sound/core/seq/seq_ports.c:142:12-14: WARNING opportunity for max()


 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

CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   ae085d7f9365de7da27ab5c0d16b12d51ea7fca9
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 10 hours ago
:::::: commit date: 11 months ago

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

 sound/core/seq/seq_ports.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/sound/core/seq/seq_ports.c
+++ b/sound/core/seq/seq_ports.c
@@ -139,7 +139,7 @@ struct snd_seq_client_port *snd_seq_crea
 	port_subs_info_init(&new_port->c_dest);
 	snd_use_lock_use(&new_port->use_lock);
 
-	num = port >= 0 ? port : 0;
+	num = max(port, 0);
 	mutex_lock(&client->ports_mutex);
 	write_lock_irq(&client->ports_lock);
 	list_for_each_entry(p, &client->ports_list_head, list) {

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2022-03-25  2:13 sound/core/pcm_lib.c:77:35-36: WARNING opportunity for max() kernel test robot
@ 2022-03-25  2:04 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2022-03-25  2:04 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: Jaroslav Kysela <perex@perex.cz>
CC: Takashi Iwai <tiwai@suse.com>
CC: alsa-devel(a)alsa-project.org
CC: linux-kernel(a)vger.kernel.org

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

sound/core/pcm_lib.c:77:35-36: WARNING opportunity for max()


 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

CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   52deda9551a01879b3562e7b41748e85c591f14c
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 5 hours ago
:::::: commit date: 11 months ago

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

 sound/core/pcm_lib.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -74,7 +74,7 @@ void snd_pcm_playback_silence(struct snd
 			snd_pcm_sframes_t avail = snd_pcm_playback_hw_avail(runtime);
 			if (avail > runtime->buffer_size)
 				avail = runtime->buffer_size;
-			runtime->silence_filled = avail > 0 ? avail : 0;
+			runtime->silence_filled = max(avail, 0);
 			runtime->silence_start = (runtime->status->hw_ptr +
 						  runtime->silence_filled) %
 						 runtime->boundary;

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2022-03-21 12:01 arch/mips/sibyte/common/sb_tbprof.c:462:19-20: WARNING opportunity for min() kernel test robot
@ 2022-03-21 11:54 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2022-03-21 11:54 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
CC: linux-mips(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

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

arch/mips/sibyte/common/sb_tbprof.c:462:19-20: 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

CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   f443e374ae131c168a065ea1748feac6b2e76613
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 16 hours ago
:::::: commit date: 11 months ago

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

 arch/mips/sibyte/common/sb_tbprof.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/mips/sibyte/common/sb_tbprof.c
+++ b/arch/mips/sibyte/common/sb_tbprof.c
@@ -459,7 +459,7 @@ static ssize_t sbprof_tb_read(struct fil
 	while (size && (cur_sample < sbp.next_tb_sample)) {
 		int err;
 
-		cur_count = size < sample_left ? size : sample_left;
+		cur_count = min(size, sample_left);
 		src = (char *)(((long)sbp.sbprof_tbbuf[cur_sample])+sample_off);
 		err = __copy_to_user(dest, src, cur_count);
 		if (err) {

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2022-03-20  4:32 drivers/scsi/cxlflash/vlun.c:448:30-31: WARNING opportunity for min() kernel test robot
@ 2022-03-20  4:31 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2022-03-20  4:31 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: "Manoj N. Kumar" <manoj@linux.ibm.com>
CC: "Matthew R. Ochs" <mrochs@linux.ibm.com>
CC: Uma Krishnan <ukrishn@linux.ibm.com>
CC: "James E.J. Bottomley" <jejb@linux.ibm.com>
CC: "Martin K. Petersen" <martin.petersen@oracle.com>
CC: linux-scsi(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

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

drivers/scsi/cxlflash/vlun.c:448:30-31: 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

CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   34e047aa16c0123bbae8e2f6df33e5ecc1f56601
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 33 hours ago
:::::: commit date: 11 months ago

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

 drivers/scsi/cxlflash/vlun.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/scsi/cxlflash/vlun.c
+++ b/drivers/scsi/cxlflash/vlun.c
@@ -445,7 +445,7 @@ static int write_same16(struct scsi_devi
 		scsi_cmd[0] = WRITE_SAME_16;
 		scsi_cmd[1] = cfg->ws_unmap ? 0x8 : 0;
 		put_unaligned_be64(offset, &scsi_cmd[2]);
-		put_unaligned_be32(ws_limit < left ? ws_limit : left,
+		put_unaligned_be32(min(ws_limit, left),
 				   &scsi_cmd[10]);
 
 		/* Drop the ioctl read semahpore across lengthy call */

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2022-03-20  4:01 drivers/md/dm-raid.c:3218:44-45: WARNING opportunity for min() kernel test robot
@ 2022-03-20  3:57 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2022-03-20  3:57 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: linux-kernel(a)vger.kernel.org

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

drivers/md/dm-raid.c:3218:44-45: 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

CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   34e047aa16c0123bbae8e2f6df33e5ecc1f56601
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 32 hours ago
:::::: commit date: 11 months ago

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

 dm-raid.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- drivermd/dm-raid.c
@@ -3215,7 +3215,8 @@ size_check:
 			if (r)
 				goto bad;
 
-			rs_setup_recovery(rs, rs->md.recovery_cp < rs->md.dev_sectors ? rs->md.recovery_cp : rs->md.dev_sectors);
+			rs_setup_recovery(rs,
+					  min(rs->md.recovery_cp, rs->md.dev_sectors));
 		} else {
 		* This is no size change or it is shrinking, update size and record in superblocks */
 			r = rs_set_dev_and_array_sectors(rs, rs->ti->len, false);

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2022-03-18  8:16 drivers/md/dm-raid.c:3218:44-45: WARNING opportunity for min() kernel test robot
@ 2022-03-18  8:10 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2022-03-18  8:10 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: linux-kernel(a)vger.kernel.org

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

drivers/md/dm-raid.c:3218:44-45: 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

CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   551acdc3c3d2b6bc97f11e31dcf960bc36343bfc
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 12 hours ago
:::::: commit date: 11 months ago

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

 dm-raid.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- drivermd/dm-raid.c
@@ -3215,7 +3215,8 @@ size_check:
 			if (r)
 				goto bad;
 
-			rs_setup_recovery(rs, rs->md.recovery_cp < rs->md.dev_sectors ? rs->md.recovery_cp : rs->md.dev_sectors);
+			rs_setup_recovery(rs,
+					  min(rs->md.recovery_cp, rs->md.dev_sectors));
 		} else {
 		* This is no size change or it is shrinking, update size and record in superblocks */
 			r = rs_set_dev_and_array_sectors(rs, rs->ti->len, false);

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2022-03-16 16:54 drivers/usb/storage/realtek_cr.c:264:20-21: WARNING opportunity for min() kernel test robot
@ 2022-03-16 16:51 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2022-03-16 16:51 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: Alan Stern <stern@rowland.harvard.edu>
CC: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
CC: linux-usb(a)vger.kernel.org
CC: usb-storage(a)lists.one-eyed-alien.net
CC: linux-kernel(a)vger.kernel.org

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

drivers/usb/storage/realtek_cr.c:264:20-21: 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

CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   56e337f2cf1326323844927a04e9dbce9a244835
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 24 hours ago
:::::: commit date: 11 months ago

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

 drivers/usb/storage/realtek_cr.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/usb/storage/realtek_cr.c
+++ b/drivers/usb/storage/realtek_cr.c
@@ -261,7 +261,7 @@ static int rts51x_bulk_transport(struct
 	 * was really transferred and what the device tells us
 	 */
 	if (residue)
-		residue = residue < buf_len ? residue : buf_len;
+		residue = min(residue, buf_len);
 
 	if (act_len)
 		*act_len = buf_len - residue;

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2022-03-15  9:07 drivers/md/dm-raid.c:3218:44-45: WARNING opportunity for min() kernel test robot
@ 2022-03-15  9:06 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2022-03-15  9:06 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: Alasdair Kergon <agk@redhat.com>
CC: Mike Snitzer <snitzer@redhat.com>
CC: dm-devel(a)redhat.com
CC: linux-kernel(a)vger.kernel.org

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

drivers/md/dm-raid.c:3218:44-45: 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

CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   09688c0166e76ce2fb85e86b9d99be8b0084cdf9
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 2 days ago
:::::: commit date: 11 months ago

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

 drivers/md/dm-raid.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/md/dm-raid.c
+++ b/drivers/md/dm-raid.c
@@ -3215,7 +3215,8 @@ size_check:
 			if (r)
 				goto bad;
 
-			rs_setup_recovery(rs, rs->md.recovery_cp < rs->md.dev_sectors ? rs->md.recovery_cp : rs->md.dev_sectors);
+			rs_setup_recovery(rs,
+					  min(rs->md.recovery_cp, rs->md.dev_sectors));
 		} else {
 			/* This is no size change or it is shrinking, update size and record in superblocks */
 			r = rs_set_dev_and_array_sectors(rs, rs->ti->len, false);

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2022-03-13  0:39 sound/pci/hda/hda_codec.c:337:19-20: WARNING opportunity for min() kernel test robot
@ 2022-03-13  0:37 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2022-03-13  0:37 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: Jaroslav Kysela <perex@perex.cz>
CC: Takashi Iwai <tiwai@suse.com>
CC: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
CC: alsa-devel(a)alsa-project.org
CC: linux-kernel(a)vger.kernel.org

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

sound/pci/hda/hda_codec.c:337:19-20: 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

CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   aad611a868d16cdc16a7d4a764cef955293e47e3
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 6 hours ago
:::::: commit date: 11 months ago

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

 sound/pci/hda/hda_codec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -334,7 +334,7 @@ int snd_hda_get_devices(struct hda_codec
 		return 0;
 
 	dev_len = parm + 1;
-	dev_len = dev_len < max_devices ? dev_len : max_devices;
+	dev_len = min(dev_len, max_devices);
 
 	devices = 0;
 	while (devices < dev_len) {

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2022-03-12  8:34 drivers/md/dm-raid.c:3218:44-45: WARNING opportunity for min() kernel test robot
@ 2022-03-12  8:27 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2022-03-12  8:27 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: Alasdair Kergon <agk@redhat.com>
CC: Mike Snitzer <snitzer@redhat.com>
CC: dm-devel(a)redhat.com
CC: linux-kernel(a)vger.kernel.org

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

drivers/md/dm-raid.c:3218:44-45: 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

CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   68453767131a5deec1e8f9ac92a9042f929e585d
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 12 hours ago
:::::: commit date: 11 months ago

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

 drivers/md/dm-raid.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/md/dm-raid.c
+++ b/drivers/md/dm-raid.c
@@ -3215,7 +3215,8 @@ size_check:
 			if (r)
 				goto bad;
 
-			rs_setup_recovery(rs, rs->md.recovery_cp < rs->md.dev_sectors ? rs->md.recovery_cp : rs->md.dev_sectors);
+			rs_setup_recovery(rs,
+					  min(rs->md.recovery_cp, rs->md.dev_sectors));
 		} else {
 			/* This is no size change or it is shrinking, update size and record in superblocks */
 			r = rs_set_dev_and_array_sectors(rs, rs->ti->len, false);

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2022-03-10  1:59 drivers/md/dm-raid.c:3218:44-45: WARNING opportunity for min() kernel test robot
@ 2022-03-10  1:58 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2022-03-10  1:58 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: Alasdair Kergon <agk@redhat.com>
CC: Mike Snitzer <snitzer@redhat.com>
CC: dm-devel(a)redhat.com
CC: linux-kernel(a)vger.kernel.org

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

drivers/md/dm-raid.c:3218:44-45: 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

CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   330f4c53d3c2d8b11d86ec03a964b86dc81452f5
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 29 hours ago
:::::: commit date: 10 months ago

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

 drivers/md/dm-raid.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/md/dm-raid.c
+++ b/drivers/md/dm-raid.c
@@ -3215,7 +3215,8 @@ size_check:
 			if (r)
 				goto bad;
 
-			rs_setup_recovery(rs, rs->md.recovery_cp < rs->md.dev_sectors ? rs->md.recovery_cp : rs->md.dev_sectors);
+			rs_setup_recovery(rs,
+					  min(rs->md.recovery_cp, rs->md.dev_sectors));
 		} else {
 			/* This is no size change or it is shrinking, update size and record in superblocks */
 			r = rs_set_dev_and_array_sectors(rs, rs->ti->len, false);

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2022-02-27 19:50 drivers/staging/most/video/video.c:176:22-23: WARNING opportunity for min() kernel test robot
@ 2022-02-27 19:44 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2022-02-27 19:44 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
CC: linux-staging(a)lists.linux.dev
CC: linux-kernel(a)vger.kernel.org

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

drivers/staging/most/video/video.c:176:22-23: 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

CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   2293be58d6a18cab800e25e42081bacb75c05752
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 24 hours ago
:::::: commit date: 10 months ago

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

 drivers/staging/most/video/video.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/staging/most/video/video.c
+++ b/drivers/staging/most/video/video.c
@@ -173,7 +173,7 @@ static ssize_t comp_vdev_read(struct fil
 	while (count > 0 && data_ready(mdev)) {
 		struct mbo *const mbo = get_top_mbo(mdev);
 		int const rem = mbo->processed_length - fh->offs;
-		int const cnt = rem < count ? rem : count;
+		int const cnt = min(rem, count);
 
 		if (copy_to_user(buf, mbo->virt_address + fh->offs, cnt)) {
 			v4l2_err(&mdev->v4l2_dev, "read: copy_to_user failed\n");

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2022-02-26 12:02 drivers/w1/slaves/w1_therm.c:1452:18-19: WARNING opportunity for max() kernel test robot
@ 2022-02-26 11:57 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2022-02-26 11:57 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: Evgeniy Polyakov <zbr@ioremap.net>
CC: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
CC: Bhaskar Chowdhury <unixbhaskar@gmail.com>
CC: Randy Dunlap <rdunlap@infradead.org>
CC: Dan Carpenter <error27@gmail.com>
CC: linux-kernel(a)vger.kernel.org

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

drivers/w1/slaves/w1_therm.c:1452:18-19: WARNING opportunity for max()


 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

CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   9137eda53752ef73148e42b0d7640a00f1bc96b1
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 14 hours ago
:::::: commit date: 10 months ago

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

 drivers/w1/slaves/w1_therm.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/w1/slaves/w1_therm.c
+++ b/drivers/w1/slaves/w1_therm.c
@@ -1449,7 +1449,7 @@ static int trigger_bulk_read(struct w1_m
 		if (bulk_read_support(sl)) {
 			int t_cur = conversion_time(sl);
 
-			t_conv = t_cur > t_conv ? t_cur : t_conv;
+			t_conv = max(t_cur, t_conv);
 			strong_pullup = strong_pullup ||
 					(w1_strong_pullup == 2 ||
 					(!SLAVE_POWERMODE(sl) &&

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2022-02-24 21:43 drivers/tty/goldfish.c:95:12-13: WARNING opportunity for min() kernel test robot
@ 2022-02-24 21:33 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2022-02-24 21:33 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
CC: Jiri Slaby <jirislaby@kernel.org>
CC: linux-kernel(a)vger.kernel.org

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

drivers/tty/goldfish.c:95:12-13: 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

CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   23d04328444a8fa0ca060c5e532220dac8e8bc26
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 25 hours ago
:::::: commit date: 10 months ago

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

 drivers/tty/goldfish.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/tty/goldfish.c
+++ b/drivers/tty/goldfish.c
@@ -92,7 +92,7 @@ static void goldfish_tty_rw(struct goldf
 		while (addr < addr_end) {
 			unsigned long pg_end = (addr & PAGE_MASK) + PAGE_SIZE;
 			unsigned long next =
-					pg_end < addr_end ? pg_end : addr_end;
+					min(pg_end, addr_end);
 			unsigned long avail = next - addr;
 
 			/*

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2022-02-24  6:58 drivers/dma/dmatest.c:1033:23-24: WARNING opportunity for max() kernel test robot
@ 2022-02-24  6:55 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2022-02-24  6:55 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: Vinod Koul <vkoul@kernel.org>
CC: dmaengine(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

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

drivers/dma/dmatest.c:1033:23-24: WARNING opportunity for max()
drivers/dma/dmatest.c:1040:23-24: WARNING opportunity for max()
drivers/dma/dmatest.c:1046:22-23: WARNING opportunity for max()
drivers/dma/dmatest.c:1050:22-23: WARNING opportunity for max()


 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

CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   23d04328444a8fa0ca060c5e532220dac8e8bc26
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 11 hours ago
:::::: commit date: 10 months ago

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

 drivers/dma/dmatest.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- a/drivers/dma/dmatest.c
+++ b/drivers/dma/dmatest.c
@@ -1030,24 +1030,24 @@ static int dmatest_add_channel(struct dm
 	if (dma_has_cap(DMA_MEMCPY, dma_dev->cap_mask)) {
 		if (dmatest == 0) {
 			cnt = dmatest_add_threads(info, dtc, DMA_MEMCPY);
-			thread_count += cnt > 0 ? cnt : 0;
+			thread_count += max(cnt, 0);
 		}
 	}
 
 	if (dma_has_cap(DMA_MEMSET, dma_dev->cap_mask)) {
 		if (dmatest == 1) {
 			cnt = dmatest_add_threads(info, dtc, DMA_MEMSET);
-			thread_count += cnt > 0 ? cnt : 0;
+			thread_count += max(cnt, 0);
 		}
 	}
 
 	if (dma_has_cap(DMA_XOR, dma_dev->cap_mask)) {
 		cnt = dmatest_add_threads(info, dtc, DMA_XOR);
-		thread_count += cnt > 0 ? cnt : 0;
+		thread_count += max(cnt, 0);
 	}
 	if (dma_has_cap(DMA_PQ, dma_dev->cap_mask)) {
 		cnt = dmatest_add_threads(info, dtc, DMA_PQ);
-		thread_count += cnt > 0 ? cnt : 0;
+		thread_count += max(cnt, 0);
 	}
 
 	pr_info("Added %u threads using %s\n",

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2022-02-24  5:56 kernel/irq/affinity.c:399:12-13: WARNING opportunity for min() kernel test robot
@ 2022-02-24  5:49 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2022-02-24  5:49 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: Thomas Gleixner <tglx@linutronix.de>
CC: linux-kernel(a)vger.kernel.org

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

kernel/time/clockevents.c:75:12-13: WARNING opportunity for max()


 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

CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   23d04328444a8fa0ca060c5e532220dac8e8bc26
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 10 hours ago
:::::: commit date: 10 months ago

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

 kernel/time/clockevents.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/kernel/time/clockevents.c
+++ b/kernel/time/clockevents.c
@@ -72,7 +72,7 @@ static u64 cev_delta2ns(unsigned long la
 	do_div(clc, evt->mult);
 
 	/* Deltas less than 1usec are pointless noise */
-	return clc > 1000 ? clc : 1000;
+	return max(clc, 1000);
 }
 
 /**

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2022-02-23 13:09 kernel/irq/affinity.c:399:12-13: WARNING opportunity for min() kernel test robot
@ 2022-02-23 13:07 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2022-02-23 13:07 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: Thomas Gleixner <tglx@linutronix.de>
CC: linux-kernel(a)vger.kernel.org

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

kernel/time/clockevents.c:75:12-13: WARNING opportunity for max()


 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

CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   5c1ee569660d4a205dced9cb4d0306b907fb7599
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 13 hours ago
:::::: commit date: 10 months ago

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

 kernel/time/clockevents.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/kernel/time/clockevents.c
+++ b/kernel/time/clockevents.c
@@ -72,7 +72,7 @@ static u64 cev_delta2ns(unsigned long la
 	do_div(clc, evt->mult);
 
 	/* Deltas less than 1usec are pointless noise */
-	return clc > 1000 ? clc : 1000;
+	return max(clc, 1000);
 }
 
 /**

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2022-02-22 19:56 drivers/gpu/drm/drm_bufs.c:740:33-34: WARNING opportunity for max() kernel test robot
  2022-02-22 19:51 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
@ 2022-02-22 19:51 ` kernel test robot
  1 sibling, 0 replies; 54+ messages in thread
From: kernel test robot @ 2022-02-22 19:51 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: David Airlie <airlied@linux.ie>
CC: Daniel Vetter <daniel@ffwll.ch>
CC: dri-devel(a)lists.freedesktop.org
CC: linux-kernel(a)vger.kernel.org

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

drivers/gpu/drm/savage/savage_state.c:267:26-27: 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

CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   917bbdb107f8767cb78f24e7d6725a2f93b9effe
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 80 minutes ago
:::::: commit date: 10 months ago

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

 drivers/gpu/drm/savage/savage_state.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/gpu/drm/savage/savage_state.c
+++ b/drivers/gpu/drm/savage/savage_state.c
@@ -264,7 +264,7 @@ static int savage_dispatch_state(drm_sav
 
 	do {
 		while (count > 0) {
-			unsigned int n = count < 255 ? count : 255;
+			unsigned int n = min(count, 255);
 			DMA_SET_REGISTERS(start, n);
 			DMA_COPY(regs, n);
 			count -= n;

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2022-02-22 19:56 drivers/gpu/drm/drm_bufs.c:740:33-34: WARNING opportunity for max() kernel test robot
@ 2022-02-22 19:51 ` kernel test robot
  2022-02-22 19:51 ` kernel test robot
  1 sibling, 0 replies; 54+ messages in thread
From: kernel test robot @ 2022-02-22 19:51 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: David Airlie <airlied@linux.ie>
CC: Daniel Vetter <daniel@ffwll.ch>
CC: dri-devel(a)lists.freedesktop.org
CC: linux-kernel(a)vger.kernel.org

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

drivers/gpu/drm/r128/r128_state.c:53:19-20: 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

CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   917bbdb107f8767cb78f24e7d6725a2f93b9effe
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 80 minutes ago
:::::: commit date: 10 months ago

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

 drivers/gpu/drm/r128/r128_state.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/gpu/drm/r128/r128_state.c
+++ b/drivers/gpu/drm/r128/r128_state.c
@@ -50,7 +50,7 @@ static void r128_emit_clip_rects(drm_r12
 	RING_LOCALS;
 	DRM_DEBUG("\n");
 
-	BEGIN_RING((count < 3 ? count : 3) * 5 + 2);
+	BEGIN_RING(min(count, 3) * 5 + 2);
 
 	if (count >= 1) {
 		OUT_RING(CCE_PACKET0(R128_AUX1_SC_LEFT, 3));

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2022-02-16 16:21 drivers/thunderbolt/property.c:501:12-13: WARNING opportunity for min() kernel test robot
@ 2022-02-16 16:13 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2022-02-16 16:13 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: Zhang Rui <rui.zhang@intel.com>
CC: "Rafael J. Wysocki" <rjw@rjwysocki.net>
CC: Len Brown <lenb@kernel.org>
CC: linux-acpi(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

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

drivers/acpi/thermal.c:425:43-44: 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

CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   c5d9ae265b105d9a67575fb67bd4650a6fc08e25
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 21 hours ago
:::::: commit date: 10 months ago

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

 drivers/acpi/thermal.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -422,10 +422,8 @@ static int acpi_thermal_trips_update(str
 					 * the next higher trip point
 					 */
 					tz->trips.active[i - 1].temperature =
-						(tz->trips.active[i - 2].temperature <
-						celsius_to_deci_kelvin(act) ?
-						tz->trips.active[i - 2].temperature :
-						celsius_to_deci_kelvin(act));
+						min(tz->trips.active[i - 2].temperature,
+						    celsius_to_deci_kelvin(act));
 				break;
 			} else {
 				tz->trips.active[i].temperature = tmp;

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2022-02-16 13:26 drivers/acpi/device_pm.c:661:15-16: WARNING opportunity for max() kernel test robot
@ 2022-02-16 13:22 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2022-02-16 13:22 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: Thomas Gleixner <tglx@linutronix.de>
CC: Ingo Molnar <mingo@redhat.com>
CC: Borislav Petkov <bp@alien8.de>
CC: x86(a)kernel.org
CC: "H. Peter Anvin" <hpa@zytor.com>
CC: linux-kernel(a)vger.kernel.org

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

arch/x86/kernel/apic/ipi.c:329:14-16: WARNING opportunity for max()


 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

CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   c5d9ae265b105d9a67575fb67bd4650a6fc08e25
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 18 hours ago
:::::: commit date: 10 months ago

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

 arch/x86/kernel/apic/ipi.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/x86/kernel/apic/ipi.c
+++ b/arch/x86/kernel/apic/ipi.c
@@ -326,6 +326,6 @@ int safe_smp_processor_id(void)
 
 	cpuid = convert_apicid_to_cpu(apicid);
 
-	return cpuid >= 0 ? cpuid : 0;
+	return max(cpuid, 0);
 }
 #endif

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2022-02-15  7:36 drivers/usb/host/xhci-mem.c:436:27-28: WARNING opportunity for max() kernel test robot
@ 2022-02-15  7:32 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2022-02-15  7:32 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: Mathias Nyman <mathias.nyman@intel.com>
CC: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
CC: linux-usb(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

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

drivers/usb/host/xhci-mem.c:436:27-28: WARNING opportunity for max()


 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

CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   d567f5db412ed52de0b3b3efca4a451263de6108
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 14 hours ago
:::::: commit date: 10 months ago

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

 drivers/usb/host/xhci-mem.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -433,8 +433,7 @@ int xhci_ring_expansion(struct xhci_hcd
 				(TRBS_PER_SEGMENT - 1);
 
 	/* Allocate number of segments we needed, or double the ring size */
-	num_segs = ring->num_segs > num_segs_needed ?
-			ring->num_segs : num_segs_needed;
+	num_segs = max(ring->num_segs, num_segs_needed);
 
 	ret = xhci_alloc_segments_for_ring(xhci, &first, &last,
 			num_segs, ring->cycle_state, ring->type,

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2022-02-14  3:48 drivers/usb/host/xhci-mem.c:436:27-28: WARNING opportunity for max() kernel test robot
@ 2022-02-14  3:45 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2022-02-14  3:45 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: Mathias Nyman <mathias.nyman@intel.com>
CC: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
CC: linux-usb(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

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

drivers/usb/host/xhci-mem.c:436:27-28: WARNING opportunity for max()


 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

CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   754e0b0e35608ed5206d6a67a791563c631cec07
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 8 hours ago
:::::: commit date: 10 months ago

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

 drivers/usb/host/xhci-mem.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -433,8 +433,7 @@ int xhci_ring_expansion(struct xhci_hcd
 				(TRBS_PER_SEGMENT - 1);
 
 	/* Allocate number of segments we needed, or double the ring size */
-	num_segs = ring->num_segs > num_segs_needed ?
-			ring->num_segs : num_segs_needed;
+	num_segs = max(ring->num_segs, num_segs_needed);
 
 	ret = xhci_alloc_segments_for_ring(xhci, &first, &last,
 			num_segs, ring->cycle_state, ring->type,

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2022-02-13  6:36 sound/core/pcm_lib.c:77:35-36: WARNING opportunity for max() kernel test robot
@ 2022-02-13  6:26 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2022-02-13  6:26 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: Jaroslav Kysela <perex@perex.cz>
CC: Takashi Iwai <tiwai@suse.com>
CC: alsa-devel(a)alsa-project.org
CC: linux-kernel(a)vger.kernel.org

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

sound/core/pcm_lib.c:77:35-36: WARNING opportunity for max()


 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

CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   b81b1829e7e39f6cebdf6e4d5484eacbceda8554
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 12 hours ago
:::::: commit date: 10 months ago

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

 pcm_lib.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -74,7 +74,7 @@ void snd_pcm_playback_silence(struct snd
 			snd_pcm_sframes_t avail = snd_pcm_playback_hw_avail(runtime);
 			if (avail > runtime->buffer_size)
 				avail = runtime->buffer_size;
-			runtime->silence_filled = avail > 0 ? avail : 0;
+			runtime->silence_filled = max(avail, 0);
 			runtime->silence_start = (runtime->status->hw_ptr +
 						  runtime->silence_filled) %
 						 runtime->boundary;

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2022-02-12 10:39 drivers/video/fbdev/core/fbcon.c:605:16-17: WARNING opportunity for min() kernel test robot
@ 2022-02-12 10:04 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2022-02-12 10:04 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
CC: Du Cheng <ducheng2@gmail.com>
CC: dri-devel(a)lists.freedesktop.org
CC: linux-fbdev(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

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

drivers/video/fbdev/core/fbcon.c:605:16-17: 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

CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   83e396641110663d3c7bb25b9bc0c6a750359ecf
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 12 hours ago
:::::: commit date: 10 months ago

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

 fbcon.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/video/fbdev/core/fbcon.c
+++ b/drivers/video/fbdev/core/fbcon.c
@@ -602,7 +602,7 @@ static void fbcon_prepare_logo(struct vc
 		save = kmalloc(array3_size(logo_lines, new_cols, 2),
 			       GFP_KERNEL);
 		if (save) {
-			int i = cols < new_cols ? cols : new_cols;
+			int i = min(cols, new_cols);
 			scr_memsetw(save, erase, array3_size(logo_lines, new_cols, 2));
 			r = q - step;
 			for (cnt = 0; cnt < logo_lines; cnt++, r += i)

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2022-02-12  2:49 drivers/spi/spi-dw-dma.c:85:26-27: WARNING opportunity for max() kernel test robot
@ 2022-02-12  2:43 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2022-02-12  2:43 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: Mark Brown <broonie@kernel.org>
CC: linux-spi(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

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

drivers/spi/spi-fsl-lpspi.c:446:12-14: 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

CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   f1baf68e1383f6ed93eb9cff2866d46562607a43
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 27 hours ago
:::::: commit date: 10 months ago

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

 spi-fsl-lpspi.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

--- a/drivers/spi/spi-fsl-lpspi.c
+++ b/drivers/spi/spi-fsl-lpspi.c
@@ -443,10 +443,7 @@ static int fsl_lpspi_setup_transfer(stru
 		fsl_lpspi->tx = fsl_lpspi_buf_tx_u32;
 	}
 
-	if (t->len <= fsl_lpspi->txfifosize)
-		fsl_lpspi->watermark = t->len;
-	else
-		fsl_lpspi->watermark = fsl_lpspi->txfifosize;
+	fsl_lpspi->watermark = min(t->len, fsl_lpspi->txfifosize);
 
 	if (fsl_lpspi_can_dma(controller, spi, t))
 		fsl_lpspi->usedma = true;

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2022-02-12  2:29 drivers/usb/host/xhci-mem.c:436:27-28: WARNING opportunity for max() kernel test robot
@ 2022-02-12  2:27 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2022-02-12  2:27 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: Mathias Nyman <mathias.nyman@intel.com>
CC: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
CC: linux-usb(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

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

drivers/usb/host/xhci-mem.c:436:27-28: WARNING opportunity for max()


 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

CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   83e396641110663d3c7bb25b9bc0c6a750359ecf
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 5 hours ago
:::::: commit date: 10 months ago

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

 xhci-mem.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -433,8 +433,7 @@ int xhci_ring_expansion(struct xhci_hcd
 				(TRBS_PER_SEGMENT - 1);
 
 	/* Allocate number of segments we needed, or double the ring size */
-	num_segs = ring->num_segs > num_segs_needed ?
-			ring->num_segs : num_segs_needed;
+	num_segs = max(ring->num_segs, num_segs_needed);
 
 	ret = xhci_alloc_segments_for_ring(xhci, &first, &last,
 			num_segs, ring->cycle_state, ring->type,

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2022-02-11 17:59 drivers/net/ethernet/smsc/smc911x.c:483:20-22: WARNING opportunity for min() kernel test robot
@ 2022-02-11 17:58 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2022-02-11 17:58 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: Jakub Kicinski <kuba@kernel.org>
CC: netdev(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

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

drivers/net/ethernet/smsc/smc911x.c:483:20-22: 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

CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   f1baf68e1383f6ed93eb9cff2866d46562607a43
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 18 hours ago
:::::: commit date: 10 months ago

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

 smc911x.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/net/ethernet/smsc/smc911x.c
+++ b/drivers/net/ethernet/smsc/smc911x.c
@@ -480,7 +480,7 @@ static void smc911x_hardware_send_pkt(st
 	SMC_SET_TX_FIFO(lp, cmdB);
 
 	DBG(SMC_DEBUG_PKTS, dev, "Transmitted packet\n");
-	PRINT_PKT(buf, len <= 64 ? len : 64);
+	PRINT_PKT(buf, min(len, 64));
 
 	/* Send pkt via PIO or DMA */
 #ifdef SMC_USE_DMA

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2022-02-10  1:21 sound/pci/hda/hda_codec.c:337:19-20: WARNING opportunity for min() kernel test robot
@ 2022-02-10  1:20 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2022-02-10  1:20 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: Jaroslav Kysela <perex@perex.cz>
CC: Takashi Iwai <tiwai@suse.com>
CC: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
CC: "Pierre-Louis Bossart" <pierre-louis.bossart@linux.intel.com>
CC: alsa-devel(a)alsa-project.org
CC: linux-kernel(a)vger.kernel.org

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

sound/pci/hda/hda_codec.c:337:19-20: 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

CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   f4bc5bbb5fef3cf421ba3485d6d383c27ec473ed
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 7 hours ago
:::::: commit date: 9 months ago

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

 hda_codec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -334,7 +334,7 @@ int snd_hda_get_devices(struct hda_codec
 		return 0;
 
 	dev_len = parm + 1;
-	dev_len = dev_len < max_devices ? dev_len : max_devices;
+	dev_len = min(dev_len, max_devices);
 
 	devices = 0;
 	while (devices < dev_len) {

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2022-02-10  0:10 drivers/md/dm-raid.c:3218:44-45: WARNING opportunity for min() kernel test robot
@ 2022-02-10  0:05 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2022-02-10  0:05 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: Alasdair Kergon <agk@redhat.com>
CC: Mike Snitzer <snitzer@redhat.com>
CC: dm-devel(a)redhat.com
CC: linux-kernel(a)vger.kernel.org

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

drivers/md/dm-raid.c:3218:44-45: 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

CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   f4bc5bbb5fef3cf421ba3485d6d383c27ec473ed
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 6 hours ago
:::::: commit date: 9 months ago

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

 dm-raid.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/md/dm-raid.c
+++ b/drivers/md/dm-raid.c
@@ -3215,7 +3215,8 @@ size_check:
 			if (r)
 				goto bad;
 
-			rs_setup_recovery(rs, rs->md.recovery_cp < rs->md.dev_sectors ? rs->md.recovery_cp : rs->md.dev_sectors);
+			rs_setup_recovery(rs,
+					  min(rs->md.recovery_cp, rs->md.dev_sectors));
 		} else {
 			/* This is no size change or it is shrinking, update size and record in superblocks */
 			r = rs_set_dev_and_array_sectors(rs, rs->ti->len, false);

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2022-02-09  4:09 drivers/usb/host/xhci-mem.c:436:27-28: WARNING opportunity for max() kernel test robot
@ 2022-02-09  4:07 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2022-02-09  4:07 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: Mathias Nyman <mathias.nyman@intel.com>
CC: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
CC: linux-usb(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

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

drivers/usb/host/xhci-mem.c:436:27-28: WARNING opportunity for max()


 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

CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   e6251ab4551f51fa4cee03523e08051898c3ce82
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 8 hours ago
:::::: commit date: 9 months ago

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

 xhci-mem.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -433,8 +433,7 @@ int xhci_ring_expansion(struct xhci_hcd
 				(TRBS_PER_SEGMENT - 1);
 
 	/* Allocate number of segments we needed, or double the ring size */
-	num_segs = ring->num_segs > num_segs_needed ?
-			ring->num_segs : num_segs_needed;
+	num_segs = max(ring->num_segs, num_segs_needed);
 
 	ret = xhci_alloc_segments_for_ring(xhci, &first, &last,
 			num_segs, ring->cycle_state, ring->type,

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2022-02-08 21:58 arch/powerpc/kernel/sysfs.c:456:36-37: WARNING opportunity for max() kernel test robot
@ 2022-02-08 21:54 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2022-02-08 21:54 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: Michael Ellerman <mpe@ellerman.id.au>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: Paul Mackerras <paulus@samba.org>
CC: linuxppc-dev(a)lists.ozlabs.org
CC: linux-kernel(a)vger.kernel.org

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

arch/powerpc/kernel/sysfs.c:456:36-37: WARNING opportunity for max()
arch/powerpc/kernel/sysfs.c:334:36-37: WARNING opportunity for max()


 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

CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   555f3d7be91a873114c9656069f1a9fa476ec41a
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 22 hours ago
:::::: commit date: 9 months ago

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

 sysfs.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/arch/powerpc/kernel/sysfs.c
+++ b/arch/powerpc/kernel/sysfs.c
@@ -331,7 +331,7 @@ static ssize_t show_pw20_wait_time(struc
 		time = pw20_wt;
 	}
 
-	return sprintf(buf, "%llu\n", time > 0 ? time : 0);
+	return sprintf(buf, "%llu\n", max(time, 0));
 }
 
 static void set_pw20_wait_entry_bit(void *val)
@@ -453,7 +453,7 @@ static ssize_t show_altivec_idle_wait_ti
 		time = altivec_idle_wt;
 	}
 
-	return sprintf(buf, "%llu\n", time > 0 ? time : 0);
+	return sprintf(buf, "%llu\n", max(time, 0));
 }
 
 static void set_altivec_idle_wait_entry_bit(void *val)

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2021-05-22 17:05 [jlawall:for-5.14 1/8] fs/notify/inotify/inotify_user.c:384:12-13: WARNING opportunity for min() kernel test robot
@ 2021-05-22 17:05 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2021-05-22 17:05 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: Jan Kara <jack@suse.cz>
CC: Amir Goldstein <amir73il@gmail.com>
CC: linux-fsdevel(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

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

fs/notify/inotify/inotify_user.c:384:12-13: 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: 5f66f73b9ff4 ("coccinelle: misc: add minmax script")
CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux.git for-5.14
head:   f5b3553b5019f22ac668651ea9cddb9fa675ac41
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 [1/8] coccinelle: misc: add minmax script
:::::: branch date: 4 days ago
:::::: commit date: 3 weeks ago

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

 inotify_user.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/notify/inotify/inotify_user.c
+++ b/fs/notify/inotify/inotify_user.c
@@ -381,7 +381,7 @@ static int inotify_add_to_idr(struct idr
 
 	spin_unlock(idr_lock);
 	idr_preload_end();
-	return ret < 0 ? ret : 0;
+	return min(ret, 0);
 }
 
 static struct inotify_inode_mark *inotify_idr_find_locked(struct fsnotify_group *group,

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2021-05-01 23:01 [jlawall:for-5.12 1/6] drivers/scsi/advansys.c:7734:45-46: WARNING opportunity for min() kernel test robot
@ 2021-05-01 23:01 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2021-05-01 23:01 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: Matthew Wilcox <willy@infradead.org>
CC: Hannes Reinecke <hare@suse.com>
CC: "James E.J. Bottomley" <jejb@linux.ibm.com>
CC: "Martin K. Petersen" <martin.petersen@oracle.com>
CC: linux-scsi(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

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

drivers/scsi/advansys.c:7734:45-46: 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: 8636e3295ce3 ("coccinelle: misc: add minmax script")
CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux.git for-5.12
head:   afa104b04309a6e882f6797216e74489c0d5534f
commit: 8636e3295ce33515c50ef728f0ff3800d97f9f44 [1/6] coccinelle: misc: add minmax script
:::::: branch date: 4 days ago
:::::: commit date: 6 weeks ago

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

 advansys.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/scsi/advansys.c
+++ b/drivers/scsi/advansys.c
@@ -7731,7 +7731,7 @@ adv_build_req(struct asc_board *boardp,
 	/* Set CDB length and copy it to the request structure.  */
 	scsiqp->cdb_len = scp->cmd_len;
 	/* Copy first 12 CDB bytes to cdb[]. */
-	memcpy(scsiqp->cdb, scp->cmnd, scp->cmd_len < 12 ? scp->cmd_len : 12);
+	memcpy(scsiqp->cdb, scp->cmnd, min(scp->cmd_len, 12));
 	/* Copy last 4 CDB bytes, if present, to cdb16[]. */
 	if (scp->cmd_len > 12) {
 		int cdb16_len = scp->cmd_len - 12;

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2021-04-29 18:06 [jlawall:for-5.12 1/5] arch/arm64/kernel/cpufeature.c:705:12-13: WARNING opportunity for max() kernel test robot
@ 2021-04-29 18:06 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2021-04-29 18:06 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: Catalin Marinas <catalin.marinas@arm.com>
CC: Will Deacon <will@kernel.org>
CC: Suzuki K Poulose <suzuki.poulose@arm.com>
CC: Anshuman Khandual <anshuman.khandual@arm.com>
CC: Marc Zyngier <maz@kernel.org>
CC: Mark Rutland <mark.rutland@arm.com>
CC: Amit Daniel Kachhap <amit.kachhap@arm.com>
CC: linux-arm-kernel(a)lists.infradead.org

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

arch/arm64/kernel/cpufeature.c:705:12-13: WARNING opportunity for max()
arch/arm64/kernel/cpufeature.c:698:12-13: 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: 8636e3295ce3 ("coccinelle: misc: add minmax script")
CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux.git for-5.12
head:   44e793b89bcfe586730f4c6ce3c66174dc07cb37
commit: 8636e3295ce33515c50ef728f0ff3800d97f9f44 [1/5] coccinelle: misc: add minmax script
:::::: branch date: 6 days ago
:::::: commit date: 6 weeks ago

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

 cpufeature.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/arch/arm64/kernel/cpufeature.c
+++ b/arch/arm64/kernel/cpufeature.c
@@ -695,14 +695,14 @@ static s64 arm64_ftr_safe_value(const st
 		ret = ftrp->safe_val;
 		break;
 	case FTR_LOWER_SAFE:
-		ret = new < cur ? new : cur;
+		ret = min(new, cur);
 		break;
 	case FTR_HIGHER_OR_ZERO_SAFE:
 		if (!cur || !new)
 			break;
 		fallthrough;
 	case FTR_HIGHER_SAFE:
-		ret = new > cur ? new : cur;
+		ret = max(new, cur);
 		break;
 	default:
 		BUG();

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2021-04-24  1:50 [jlawall:for-5.12 1/5] drivers/gpu/drm/bridge/analogix/analogix_dp_core.c:186:12-13: WARNING opportunity for min() kernel test robot
@ 2021-04-24  1:50 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2021-04-24  1:50 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: Andrzej Hajda <a.hajda@samsung.com>
CC: Neil Armstrong <narmstrong@baylibre.com>
CC: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
CC: Jonas Karlman <jonas@kwiboo.se>
CC: Jernej Skrabec <jernej.skrabec@siol.net>
CC: David Airlie <airlied@linux.ie>
CC: Daniel Vetter <daniel@ffwll.ch>
CC: Sam Ravnborg <sam@ravnborg.org>

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

drivers/gpu/drm/bridge/analogix/analogix_dp_core.c:186:12-13: WARNING opportunity for min()
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c:884:12-13: WARNING opportunity for min()
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c:233:12-13: 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: 8636e3295ce3 ("coccinelle: misc: add minmax script")
CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux.git for-5.12
head:   44e793b89bcfe586730f4c6ce3c66174dc07cb37
commit: 8636e3295ce33515c50ef728f0ff3800d97f9f44 [1/5] coccinelle: misc: add minmax script
:::::: branch date: 16 hours ago
:::::: commit date: 5 weeks ago

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

 analogix_dp_core.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -183,7 +183,7 @@ analogix_dp_enable_rx_to_enhanced_mode(s
 		ret = drm_dp_dpcd_writeb(&dp->aux, DP_LANE_COUNT_SET,
 					 DPCD_LANE_COUNT_SET(data));
 
-	return ret < 0 ? ret : 0;
+	return min(ret, 0);
 }
 
 static int analogix_dp_is_enhanced_mode_available(struct analogix_dp_device *dp,
@@ -230,7 +230,7 @@ static int analogix_dp_training_pattern_
 	ret = drm_dp_dpcd_writeb(&dp->aux, DP_TRAINING_PATTERN_SET,
 				 DP_TRAINING_PATTERN_DISABLE);
 
-	return ret < 0 ? ret : 0;
+	return min(ret, 0);
 }
 
 static void
@@ -881,7 +881,7 @@ static int analogix_dp_enable_scramble(s
 		ret = drm_dp_dpcd_writeb(&dp->aux, DP_TRAINING_PATTERN_SET,
 				   (u8)(data | DP_LINK_SCRAMBLING_DISABLE));
 	}
-	return ret < 0 ? ret : 0;
+	return min(ret, 0);
 }
 
 static irqreturn_t analogix_dp_hardirq(int irq, void *arg)

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2021-04-24  1:32 [jlawall:for-5.12 1/5] drivers/ata/libata-scsi.c:3594:10-11: WARNING opportunity for min() kernel test robot
@ 2021-04-24  1:32 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2021-04-24  1:32 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: Jens Axboe <axboe@kernel.dk>
CC: linux-ide(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

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

drivers/ata/libata-scsi.c:3594:10-11: WARNING opportunity for min()
drivers/ata/libata-scsi.c:3650: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: 8636e3295ce3 ("coccinelle: misc: add minmax script")
CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux.git for-5.12
head:   44e793b89bcfe586730f4c6ce3c66174dc07cb37
commit: 8636e3295ce33515c50ef728f0ff3800d97f9f44 [1/5] coccinelle: misc: add minmax script
:::::: branch date: 15 hours ago
:::::: commit date: 5 weeks ago

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

 libata-scsi.c |   10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -3591,10 +3591,7 @@ static int ata_mselect_caching(struct at
 	 */
 
 	if (len != CACHE_MPAGE_LEN - 2) {
-		if (len < CACHE_MPAGE_LEN - 2)
-			*fp = len;
-		else
-			*fp = CACHE_MPAGE_LEN - 2;
+		*fp = min(len, CACHE_MPAGE_LEN - 2);
 		return -EINVAL;
 	}
 
@@ -3647,10 +3644,7 @@ static int ata_mselect_control(struct at
 	 */
 
 	if (len != CONTROL_MPAGE_LEN - 2) {
-		if (len < CONTROL_MPAGE_LEN - 2)
-			*fp = len;
-		else
-			*fp = CONTROL_MPAGE_LEN - 2;
+		*fp = min(len, CONTROL_MPAGE_LEN - 2);
 		return -EINVAL;
 	}
 

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2021-04-06 13:17 [jlawall:for-5.12 1/4] fs/notify/inotify/inotify_user.c:385:12-13: WARNING opportunity for min() kernel test robot
@ 2021-04-06 13:17 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2021-04-06 13:17 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: Jan Kara <jack@suse.cz>
CC: Amir Goldstein <amir73il@gmail.com>
CC: linux-fsdevel(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

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

fs/notify/inotify/inotify_user.c:385:12-13: 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: 8636e3295ce3 ("coccinelle: misc: add minmax script")
CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux.git for-5.12
head:   cbc8ed0b4f7eeb782c153ec88d6d20bc0f0ca3a7
commit: 8636e3295ce33515c50ef728f0ff3800d97f9f44 [1/4] coccinelle: misc: add minmax script
:::::: branch date: 2 days ago
:::::: commit date: 2 weeks ago

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

 inotify_user.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/notify/inotify/inotify_user.c
+++ b/fs/notify/inotify/inotify_user.c
@@ -382,7 +382,7 @@ static int inotify_add_to_idr(struct idr
 
 	spin_unlock(idr_lock);
 	idr_preload_end();
-	return ret < 0 ? ret : 0;
+	return min(ret, 0);
 }
 
 static struct inotify_inode_mark *inotify_idr_find_locked(struct fsnotify_group *group,

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

* [PATCH] coccinelle: misc: fix minmax.cocci warnings
  2021-03-26 18:37 [jlawall:for-5.12 1/3] net/ipv6/sit.c:328:19-20: WARNING opportunity for min() kernel test robot
@ 2021-03-26 18:37 ` kernel test robot
  0 siblings, 0 replies; 54+ messages in thread
From: kernel test robot @ 2021-03-26 18:37 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
CC: David Ahern <dsahern@kernel.org>
CC: Jakub Kicinski <kuba@kernel.org>
CC: netdev(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

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

net/ipv6/sit.c:328:19-20: 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: 8636e3295ce3 ("coccinelle: misc: add minmax script")
CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux.git for-5.12
head:   cefe72053fc708df551780b0a69daef68ac1c39a
commit: 8636e3295ce33515c50ef728f0ff3800d97f9f44 [1/3] coccinelle: misc: add minmax script
:::::: branch date: 2 days ago
:::::: commit date: 6 days ago

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

 sit.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -325,7 +325,7 @@ static int ipip6_tunnel_get_prl(struct n
 
 	rcu_read_lock();
 
-	ca = t->prl_count < cmax ? t->prl_count : cmax;
+	ca = min(t->prl_count, cmax);
 
 	if (!kp) {
 		/* We don't try hard to allocate much memory for

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

end of thread, other threads:[~2022-04-28 15:17 UTC | newest]

Thread overview: 54+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-02  1:01 [jlawall:for-5.12 1/6] drivers/scsi/hpsa.c:2668:28-29: WARNING opportunity for min() kernel test robot
2021-05-02  1:01 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2021-05-02  1:01 ` kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2022-04-28 15:23 drivers/dma/sprd-dma.c:685:23-24: WARNING opportunity for max() kernel test robot
2022-04-28 15:17 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-04-26  9:52 drivers/md/dm-raid.c:3218:44-45: WARNING opportunity for min() kernel test robot
2022-04-26  9:44 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-04-23 22:58 drivers/md/dm-raid.c:3218:44-45: WARNING opportunity for min() kernel test robot
2022-04-23 22:54 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-04-23 11:53 arch/powerpc/kernel/sysfs.c:456:36-37: WARNING opportunity for max() kernel test robot
2022-04-23 11:44 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-04-21 23:47 net/rxrpc/input.c:870:38-39: WARNING opportunity for min() kernel test robot
2022-04-21 23:40 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-04-21 10:13 drivers/spi/spi-fsl-lpspi.c:446:12-14: WARNING opportunity for min() kernel test robot
2022-04-21 10:04 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-04-16 17:52 drivers/tty/goldfish.c:95:12-13: WARNING opportunity for min() kernel test robot
2022-04-16 17:49 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-04-15 16:02 drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c:348:85-86: WARNING opportunity for max() kernel test robot
2022-04-15 15:58 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-04-06  9:00 drivers/net/wireless/ath/ath9k/ar9003_phy.c:1829:19-21: WARNING opportunity for min() kernel test robot
2022-04-06  8:52 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-04-02  5:38 sound/pci/hda/hda_codec.c:337:19-20: WARNING opportunity for min() kernel test robot
2022-04-02  5:28 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-03-31  8:33 drivers/input/joystick/adi.c:395:13-14: WARNING opportunity for min() kernel test robot
2022-03-31  8:30 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-03-31  1:56 drivers/tty/goldfish.c:95:12-13: WARNING opportunity for min() kernel test robot
2022-03-31  1:54 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-03-28 12:05 sound/core/seq/seq_ports.c:142:12-14: WARNING opportunity for max() kernel test robot
2022-03-28 12:03 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-03-25  2:13 sound/core/pcm_lib.c:77:35-36: WARNING opportunity for max() kernel test robot
2022-03-25  2:04 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-03-21 12:01 arch/mips/sibyte/common/sb_tbprof.c:462:19-20: WARNING opportunity for min() kernel test robot
2022-03-21 11:54 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-03-20  4:32 drivers/scsi/cxlflash/vlun.c:448:30-31: WARNING opportunity for min() kernel test robot
2022-03-20  4:31 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-03-20  4:01 drivers/md/dm-raid.c:3218:44-45: WARNING opportunity for min() kernel test robot
2022-03-20  3:57 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-03-18  8:16 drivers/md/dm-raid.c:3218:44-45: WARNING opportunity for min() kernel test robot
2022-03-18  8:10 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-03-16 16:54 drivers/usb/storage/realtek_cr.c:264:20-21: WARNING opportunity for min() kernel test robot
2022-03-16 16:51 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-03-15  9:07 drivers/md/dm-raid.c:3218:44-45: WARNING opportunity for min() kernel test robot
2022-03-15  9:06 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-03-13  0:39 sound/pci/hda/hda_codec.c:337:19-20: WARNING opportunity for min() kernel test robot
2022-03-13  0:37 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-03-12  8:34 drivers/md/dm-raid.c:3218:44-45: WARNING opportunity for min() kernel test robot
2022-03-12  8:27 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-03-10  1:59 drivers/md/dm-raid.c:3218:44-45: WARNING opportunity for min() kernel test robot
2022-03-10  1:58 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-02-27 19:50 drivers/staging/most/video/video.c:176:22-23: WARNING opportunity for min() kernel test robot
2022-02-27 19:44 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-02-26 12:02 drivers/w1/slaves/w1_therm.c:1452:18-19: WARNING opportunity for max() kernel test robot
2022-02-26 11:57 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-02-24 21:43 drivers/tty/goldfish.c:95:12-13: WARNING opportunity for min() kernel test robot
2022-02-24 21:33 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-02-24  6:58 drivers/dma/dmatest.c:1033:23-24: WARNING opportunity for max() kernel test robot
2022-02-24  6:55 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-02-24  5:56 kernel/irq/affinity.c:399:12-13: WARNING opportunity for min() kernel test robot
2022-02-24  5:49 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-02-23 13:09 kernel/irq/affinity.c:399:12-13: WARNING opportunity for min() kernel test robot
2022-02-23 13:07 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-02-22 19:56 drivers/gpu/drm/drm_bufs.c:740:33-34: WARNING opportunity for max() kernel test robot
2022-02-22 19:51 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-02-22 19:51 ` kernel test robot
2022-02-16 16:21 drivers/thunderbolt/property.c:501:12-13: WARNING opportunity for min() kernel test robot
2022-02-16 16:13 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-02-16 13:26 drivers/acpi/device_pm.c:661:15-16: WARNING opportunity for max() kernel test robot
2022-02-16 13:22 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-02-15  7:36 drivers/usb/host/xhci-mem.c:436:27-28: WARNING opportunity for max() kernel test robot
2022-02-15  7:32 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-02-14  3:48 drivers/usb/host/xhci-mem.c:436:27-28: WARNING opportunity for max() kernel test robot
2022-02-14  3:45 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-02-13  6:36 sound/core/pcm_lib.c:77:35-36: WARNING opportunity for max() kernel test robot
2022-02-13  6:26 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-02-12 10:39 drivers/video/fbdev/core/fbcon.c:605:16-17: WARNING opportunity for min() kernel test robot
2022-02-12 10:04 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-02-12  2:49 drivers/spi/spi-dw-dma.c:85:26-27: WARNING opportunity for max() kernel test robot
2022-02-12  2:43 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-02-12  2:29 drivers/usb/host/xhci-mem.c:436:27-28: WARNING opportunity for max() kernel test robot
2022-02-12  2:27 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-02-11 17:59 drivers/net/ethernet/smsc/smc911x.c:483:20-22: WARNING opportunity for min() kernel test robot
2022-02-11 17:58 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-02-10  1:21 sound/pci/hda/hda_codec.c:337:19-20: WARNING opportunity for min() kernel test robot
2022-02-10  1:20 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-02-10  0:10 drivers/md/dm-raid.c:3218:44-45: WARNING opportunity for min() kernel test robot
2022-02-10  0:05 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-02-09  4:09 drivers/usb/host/xhci-mem.c:436:27-28: WARNING opportunity for max() kernel test robot
2022-02-09  4:07 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-02-08 21:58 arch/powerpc/kernel/sysfs.c:456:36-37: WARNING opportunity for max() kernel test robot
2022-02-08 21:54 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2021-05-22 17:05 [jlawall:for-5.14 1/8] fs/notify/inotify/inotify_user.c:384:12-13: WARNING opportunity for min() kernel test robot
2021-05-22 17:05 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2021-05-01 23:01 [jlawall:for-5.12 1/6] drivers/scsi/advansys.c:7734:45-46: WARNING opportunity for min() kernel test robot
2021-05-01 23:01 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2021-04-29 18:06 [jlawall:for-5.12 1/5] arch/arm64/kernel/cpufeature.c:705:12-13: WARNING opportunity for max() kernel test robot
2021-04-29 18:06 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2021-04-24  1:50 [jlawall:for-5.12 1/5] drivers/gpu/drm/bridge/analogix/analogix_dp_core.c:186:12-13: WARNING opportunity for min() kernel test robot
2021-04-24  1:50 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2021-04-24  1:32 [jlawall:for-5.12 1/5] drivers/ata/libata-scsi.c:3594:10-11: WARNING opportunity for min() kernel test robot
2021-04-24  1:32 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2021-04-06 13:17 [jlawall:for-5.12 1/4] fs/notify/inotify/inotify_user.c:385:12-13: WARNING opportunity for min() kernel test robot
2021-04-06 13:17 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2021-03-26 18:37 [jlawall:for-5.12 1/3] net/ipv6/sit.c:328:19-20: WARNING opportunity for min() kernel test robot
2021-03-26 18:37 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot

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.