All of lore.kernel.org
 help / color / mirror / Atom feed
* [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; 2+ 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] 2+ messages in thread

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

[-- Attachment #1: Type: text/plain, Size: 1035 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>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   59f0c2447e2553b0918b4a9fd38763a5c0587d02
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
date:   12 months ago
:::::: branch date: 4 hours ago
:::::: commit date: 12 months ago
config: i386-randconfig-c021 (https://download.01.org/0day-ci/archive/20220422/202204220716.YVD1Mvku-lkp(a)intel.com/config)
compiler: gcc-11 (Debian 11.2.0-20) 11.2.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 >>)
>> net/rxrpc/input.c:870:38-39: WARNING opportunity for min()

Please review and possibly fold the followup patch.

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

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

end of thread, other threads:[~2022-04-21 23:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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

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.