[openeuler:OLK-6.6 2658/2658] net/ipv4/tcp_comp.c:740:6: warning: no previous prototype for function 'comp_stream_read'

tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: 8551213150db5f8eebd27273dae93f6fe258d63a commit: c31dcf6c5ab41f07da38d3f270987807735ec93e [2658/2658] tcp_comp: implement tcp compression config: loongarch-randconfig-2005-20250806 (https://download.01.org/0day-ci/archive/20250806/202508061529.suELGrA5-lkp@i...) compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project faa4c4c2dc804c31845d8f036345fac00e016f2d) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250806/202508061529.suELGrA5-lkp@i...) 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 | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202508061529.suELGrA5-lkp@intel.com/ All warnings (new ones prefixed by >>): In file included from net/ipv4/tcp_comp.c:8: In file included from include/linux/skmsg.h:7: In file included from include/linux/bpf.h:20: In file included from include/linux/module.h:19: In file included from include/linux/elf.h:6: In file included from arch/loongarch/include/asm/elf.h:13: In file included from arch/loongarch/include/asm/vdso.h:10: In file included from include/linux/mm.h:2181: include/linux/vmstat.h:508:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 508 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~ ^ 509 | item]; | ~~~~ include/linux/vmstat.h:515:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 515 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~ ^ 516 | NR_VM_NUMA_EVENT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~~ include/linux/vmstat.h:522:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion] 522 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_" | ~~~~~~~~~~~ ^ ~~~ include/linux/vmstat.h:527:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 527 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~ ^ 528 | NR_VM_NUMA_EVENT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~~ In file included from net/ipv4/tcp_comp.c:8: In file included from include/linux/skmsg.h:13: In file included from include/net/tcp.h:32: In file included from include/net/inet_hashtables.h:26: include/net/ip.h:463:14: warning: default initialization of an object of type 'typeof (rt->dst.expires)' (aka 'const unsigned long') leaves the object uninitialized [-Wdefault-const-init-var-unsafe] 463 | if (mtu && time_before(jiffies, rt->dst.expires)) | ^ include/linux/jiffies.h:135:26: note: expanded from macro 'time_before' 135 | #define time_before(a,b) time_after(b,a) | ^ include/linux/jiffies.h:125:3: note: expanded from macro 'time_after' 125 | (typecheck(unsigned long, a) && \ | ^ include/linux/typecheck.h:11:12: note: expanded from macro 'typecheck' 11 | typeof(x) __dummy2; \ | ^
net/ipv4/tcp_comp.c:740:6: warning: no previous prototype for function 'comp_stream_read' [-Wmissing-prototypes] 740 | bool comp_stream_read(struct sock *sk) | ^ net/ipv4/tcp_comp.c:740:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 740 | bool comp_stream_read(struct sock *sk) | ^ | static net/ipv4/tcp_comp.c:779:6: warning: no previous prototype for function 'comp_setup_strp' [-Wmissing-prototypes] 779 | void comp_setup_strp(struct sock *sk, struct tcp_comp_context *ctx) | ^ net/ipv4/tcp_comp.c:779:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 779 | void comp_setup_strp(struct sock *sk, struct tcp_comp_context *ctx) | ^ | static 7 warnings generated.
vim +/comp_stream_read +740 net/ipv4/tcp_comp.c 739
740 bool comp_stream_read(struct sock *sk) 741 { 742 struct tcp_comp_context *ctx = comp_get_ctx(sk); 743 744 if (!ctx) 745 return false; 746 747 if (ctx->rx.pkt || ctx->rx.dpkt) 748 return true; 749 750 return false; 751 } 752 753 static void comp_data_ready(struct sock *sk) 754 { 755 struct tcp_comp_context *ctx = comp_get_ctx(sk); 756 757 strp_data_ready(&ctx->rx.strp); 758 } 759 760 static void comp_queue(struct strparser *strp, struct sk_buff *skb) 761 { 762 struct tcp_comp_context *ctx = comp_get_ctx(strp->sk); 763 764 ctx->rx.pkt = skb; 765 strp_pause(strp); 766 ctx->rx.saved_data_ready(strp->sk); 767 } 768 769 static int comp_read_size(struct strparser *strp, struct sk_buff *skb) 770 { 771 struct strp_msg *rxm = strp_msg(skb); 772 773 if (rxm->offset > skb->len) 774 return 0; 775 776 return skb->len - rxm->offset; 777 } 778 779 void comp_setup_strp(struct sock *sk, struct tcp_comp_context *ctx) 780 { 781 struct strp_callbacks cb; 782 783 memset(&cb, 0, sizeof(cb)); 784 cb.rcv_msg = comp_queue; 785 cb.parse_msg = comp_read_size; 786 strp_init(&ctx->rx.strp, sk, &cb); 787 788 write_lock_bh(&sk->sk_callback_lock); 789 ctx->rx.saved_data_ready = sk->sk_data_ready; 790 sk->sk_data_ready = comp_data_ready; 791 write_unlock_bh(&sk->sk_callback_lock); 792 793 strp_check_rcv(&ctx->rx.strp); 794 } 795
-- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
participants (1)
-
kernel test robot