* net/netfilter/nf_conntrack_expect.c:669:30-31: WARNING opportunity for max()
@ 2026-07-02 3:43 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-07-02 3:43 UTC (permalink / raw)
To: oe-kbuild; +Cc: lkp, Julia Lawall
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: Pablo Neira Ayuso <pablo@netfilter.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 4a50a141f05a8d1737661b19ee22ff8455b94409
commit: b8b09dc2bf35a00d4e0556b5d6308c7b917ebda2 netfilter: nf_conntrack_expect: use conntrack GC to reap expectations
date: 11 days ago
:::::: branch date: 3 hours ago
:::::: commit date: 11 days ago
config: i386-randconfig-053-20260702 (https://download.01.org/0day-ci/archive/20260702/202607021136.LkMhwGNv-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Fixes: b8b09dc2bf35 ("netfilter: nf_conntrack_expect: use conntrack GC to reap expectations")
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Julia Lawall <julia.lawall@inria.fr>
| Closes: https://lore.kernel.org/r/202607021136.LkMhwGNv-lkp@intel.com/
cocci warnings: (new ones prefixed by >>)
>> net/netfilter/nf_conntrack_expect.c:669:30-31: WARNING opportunity for max()
vim +669 net/netfilter/nf_conntrack_expect.c
77ab9cff0f4112 Martin Josefsson 2006-11-29 651
77ab9cff0f4112 Martin Josefsson 2006-11-29 652 static int exp_seq_show(struct seq_file *s, void *v)
77ab9cff0f4112 Martin Josefsson 2006-11-29 653 {
5d08ad440feae1 Patrick McHardy 2007-07-07 654 struct nf_conntrack_expect *expect;
b87921bdf25485 Patrick McHardy 2010-02-11 655 struct nf_conntrack_helper *helper;
3db5647984de03 Pablo Neira Ayuso 2026-03-25 656 struct net *net = seq_file_net(s);
5d08ad440feae1 Patrick McHardy 2007-07-07 657 struct hlist_node *n = v;
359b9ab614aba7 Patrick McHardy 2008-03-25 658 char *delim = "";
b8b09dc2bf35a0 Pablo Neira Ayuso 2026-06-18 659 __s32 timeout;
5d08ad440feae1 Patrick McHardy 2007-07-07 660
5d08ad440feae1 Patrick McHardy 2007-07-07 661 expect = hlist_entry(n, struct nf_conntrack_expect, hnode);
77ab9cff0f4112 Martin Josefsson 2006-11-29 662
3db5647984de03 Pablo Neira Ayuso 2026-03-25 663 if (!net_eq(nf_ct_exp_net(expect), net))
3db5647984de03 Pablo Neira Ayuso 2026-03-25 664 return 0;
b8b09dc2bf35a0 Pablo Neira Ayuso 2026-06-18 665 if (nf_ct_exp_is_expired(expect))
b8b09dc2bf35a0 Pablo Neira Ayuso 2026-06-18 666 return 0;
3db5647984de03 Pablo Neira Ayuso 2026-03-25 667
b8b09dc2bf35a0 Pablo Neira Ayuso 2026-06-18 668 timeout = (__s32)(READ_ONCE(expect->timeout) - nfct_time_stamp) / HZ;
b8b09dc2bf35a0 Pablo Neira Ayuso 2026-06-18 @669 seq_printf(s, "%d ", timeout > 0 ? timeout : 0);
77ab9cff0f4112 Martin Josefsson 2006-11-29 670 seq_printf(s, "l3proto = %u proto=%u ",
77ab9cff0f4112 Martin Josefsson 2006-11-29 671 expect->tuple.src.l3num,
77ab9cff0f4112 Martin Josefsson 2006-11-29 672 expect->tuple.dst.protonum);
77ab9cff0f4112 Martin Josefsson 2006-11-29 673 print_tuple(s, &expect->tuple,
4a60dc748d121b Florian Westphal 2019-01-15 674 nf_ct_l4proto_find(expect->tuple.dst.protonum));
4bb119eab7b724 Patrick McHardy 2008-03-25 675
359b9ab614aba7 Patrick McHardy 2008-03-25 676 if (expect->flags & NF_CT_EXPECT_PERMANENT) {
cdec26858e7bd9 simran singhal 2017-03-29 677 seq_puts(s, "PERMANENT");
359b9ab614aba7 Patrick McHardy 2008-03-25 678 delim = ",";
359b9ab614aba7 Patrick McHardy 2008-03-25 679 }
bc01befdcf3e40 Pablo Neira Ayuso 2010-09-28 680 if (expect->flags & NF_CT_EXPECT_INACTIVE) {
359b9ab614aba7 Patrick McHardy 2008-03-25 681 seq_printf(s, "%sINACTIVE", delim);
bc01befdcf3e40 Pablo Neira Ayuso 2010-09-28 682 delim = ",";
bc01befdcf3e40 Pablo Neira Ayuso 2010-09-28 683 }
bc01befdcf3e40 Pablo Neira Ayuso 2010-09-28 684 if (expect->flags & NF_CT_EXPECT_USERSPACE)
bc01befdcf3e40 Pablo Neira Ayuso 2010-09-28 685 seq_printf(s, "%sUSERSPACE", delim);
4bb119eab7b724 Patrick McHardy 2008-03-25 686
f01794106042ee Pablo Neira Ayuso 2026-03-25 687 helper = rcu_dereference(expect->helper);
b87921bdf25485 Patrick McHardy 2010-02-11 688 if (helper) {
b87921bdf25485 Patrick McHardy 2010-02-11 689 seq_printf(s, "%s%s", expect->flags ? " " : "", helper->name);
b173a28f62cf92 Liping Zhang 2016-08-08 690 if (helper->expect_policy[expect->class].name[0])
b87921bdf25485 Patrick McHardy 2010-02-11 691 seq_printf(s, "/%s",
b87921bdf25485 Patrick McHardy 2010-02-11 692 helper->expect_policy[expect->class].name);
b87921bdf25485 Patrick McHardy 2010-02-11 693 }
b87921bdf25485 Patrick McHardy 2010-02-11 694
1ca9e41770cba4 Joe Perches 2015-03-16 695 seq_putc(s, '\n');
1ca9e41770cba4 Joe Perches 2015-03-16 696
1ca9e41770cba4 Joe Perches 2015-03-16 697 return 0;
77ab9cff0f4112 Martin Josefsson 2006-11-29 698 }
77ab9cff0f4112 Martin Josefsson 2006-11-29 699
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-07-02 3:44 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-02 3:43 net/netfilter/nf_conntrack_expect.c:669:30-31: WARNING opportunity for max() 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.