From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46F76C433FE for ; Thu, 10 Mar 2022 22:08:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343769AbiCJWJ4 (ORCPT ); Thu, 10 Mar 2022 17:09:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240075AbiCJWJx (ORCPT ); Thu, 10 Mar 2022 17:09:53 -0500 Received: from www62.your-server.de (www62.your-server.de [213.133.104.62]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C4C65FF0B; Thu, 10 Mar 2022 14:08:50 -0800 (PST) Received: from [78.46.152.42] (helo=sslproxy04.your-server.de) by www62.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.3) (envelope-from ) id 1nSQxd-000Ayr-EU; Thu, 10 Mar 2022 23:08:42 +0100 Received: from [85.1.206.226] (helo=linux.home) by sslproxy04.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nSQxd-000LZN-0J; Thu, 10 Mar 2022 23:08:41 +0100 Subject: Re: [PATCH v2] selftests/bpf: fix array_size.cocci warning To: Guo Zhengkui , Shuah Khan , Alexei Starovoitov , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Yucong Sun , Dave Marchevsky , Christy Lee , =?UTF-8?Q?Toke_H=c3=b8iland-J=c3=b8rgensen?= , Delyan Kratunov , "open list:KERNEL SELFTEST FRAMEWORK" , "open list:BPF (Safe dynamic programs and tools)" , "open list:BPF (Safe dynamic programs and tools)" , open list Cc: zhengkui_guo@outlook.com References: <20220309033518.1743-1-guozhengkui@vivo.com> From: Daniel Borkmann Message-ID: Date: Thu, 10 Mar 2022 23:08:40 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <20220309033518.1743-1-guozhengkui@vivo.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.103.5/26477/Thu Mar 10 10:34:39 2022) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/9/22 4:35 AM, Guo Zhengkui wrote: > Fix the array_size.cocci warning in tools/testing/selftests/bpf/ > > Use `ARRAY_SIZE(arr)` in bpf_util.h instead of forms like > `sizeof(arr)/sizeof(arr[0])`. > > Signed-off-by: Guo Zhengkui BPF CI fails with: https://github.com/kernel-patches/bpf/runs/5498238267?check_suite_focus=true pahole: Multithreading requires elfutils >= 0.178. Continuing with a single thread... In file included from progs/test_rdonly_maps.c:7: /tmp/runner/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/bpf_helpers.h:130:8: error: redefinition of 'bpf_map_def' struct bpf_map_def { ^ /tmp/runner/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/libbpf.h:685:8: note: previous definition is here struct bpf_map_def { ^ In file included from progs/test_rdonly_maps.c:7: /tmp/runner/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/bpf_helpers.h:138:6: error: redefinition of 'libbpf_pin_type' enum libbpf_pin_type { ^ /tmp/runner/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/libbpf.h:191:6: note: previous definition is here enum libbpf_pin_type { ^ In file included from progs/test_rdonly_maps.c:7: /tmp/runner/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/bpf_helpers.h:139:2: error: redefinition of enumerator 'LIBBPF_PIN_NONE' LIBBPF_PIN_NONE, ^ /tmp/runner/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/libbpf.h:192:2: note: previous definition is here LIBBPF_PIN_NONE, ^ In file included from progs/test_rdonly_maps.c:7: /tmp/runner/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/bpf_helpers.h:141:2: error: redefinition of enumerator 'LIBBPF_PIN_BY_NAME' LIBBPF_PIN_BY_NAME, ^ /tmp/runner/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/libbpf.h:194:2: note: previous definition is here LIBBPF_PIN_BY_NAME, ^ In file included from progs/test_rdonly_maps.c:7: /tmp/runner/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/bpf_helpers.h:144:6: error: redefinition of 'libbpf_tristate' enum libbpf_tristate { ^ /tmp/runner/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/libbpf.h:1304:6: note: previous definition is here enum libbpf_tristate { ^ In file included from progs/test_rdonly_maps.c:7: /tmp/runner/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/bpf_helpers.h:145:2: error: redefinition of enumerator 'TRI_NO' TRI_NO = 0, ^ /tmp/runner/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/libbpf.h:1305:2: note: previous definition is here TRI_NO = 0, ^ In file included from progs/test_rdonly_maps.c:7: /tmp/runner/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/bpf_helpers.h:146:2: error: redefinition of enumerator 'TRI_YES' TRI_YES = 1, ^ /tmp/runner/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/libbpf.h:1306:2: note: previous definition is here TRI_YES = 1, ^ In file included from progs/test_rdonly_maps.c:7: /tmp/runner/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/bpf_helpers.h:147:2: error: redefinition of enumerator 'TRI_MODULE' TRI_MODULE = 2, ^ /tmp/runner/work/bpf/bpf/tools/testing/selftests/bpf/tools/include/bpf/libbpf.h:1307:2: note: previous definition is here TRI_MODULE = 2, ^ 8 errors generated. make: *** [Makefile:488: /tmp/runner/work/bpf/bpf/tools/testing/selftests/bpf/test_rdonly_maps.o] Error 1 make: *** Waiting for unfinished jobs.... Error: Process completed with exit code 2.