Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp773909pxp; Fri, 11 Mar 2022 14:46:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJwcaxB4+Jd5H6Sn90DwszNDr07zOnPBcBB9/G/tPZbtLxV7WCfh5CD1K5IfYfE+xihcSsGb X-Received: by 2002:a63:5d5b:0:b0:375:983d:7c9d with SMTP id o27-20020a635d5b000000b00375983d7c9dmr10196999pgm.595.1647038817954; Fri, 11 Mar 2022 14:46:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1647038817; cv=none; d=google.com; s=arc-20160816; b=hfZ8QsJTVwT4NPLiVs4gRgA5VZHuy0mFh97eWhQwv8JeF8fwJI/3+Ty5Xtnsc8h0sV b5ys9pQut01IMuEfXoxmDc4/6eu8C/P9FtHg6epujOH2IQ/oeTsTxipDgs74WALs8c3n sfQ3+JLEfdnqUd/oH3tOR+Be9aRn+dKhH6ah6zMQWPabXVlhPhOrmd61/eRRH90gXOfF Yp3lf08MW1Dr+unAnEcmfQnFXYgthYkccc60HHrcC3BdRY5VZ5k5LpPeZ5BWTccCM6Xm TUpNqbHASboyBtKiVP/E0cK2EFLVgxQ45D+DANeM8t0PC0NzWPQzJKY/iLyJr0k64KMR 13AA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=60rBKD2lCwRb51eRJ3L+hpmElKKtSuvNqcLTxoXZIEY=; b=QOQlgaTFT6M/yE5SRQ7iycvPHZE8k2TqpyPVwHzPdL1NpfP9Rjm8HC/DucEpnTN2ul up5X1Hm9asmagok02GvSJ1hpNTBgJI8ziqH+jm3yjayGv7yx2W8zWq4NKdr3KctKu3mu cjVBFw+QWinxfJWWsAkrOo+PRVwZNiVDFkT6aJNjdbqdalsORxJkS3lhOZcNqfuon7cZ wetC+kMBIl15kTIMqCtZlDqboJ6lilZu/kcY4n1/nSNJI28X1scnWke8E8+yUNWyN95z ZBMVsDKDLt3BFubxKcseKNgkBTely3gnrGPnfCNdyJweA5U5klxkcW4WgUB/LSwqEylL w+oA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id m4-20020a056a00080400b004f75f7635e5si8310333pfk.361.2022.03.11.14.46.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 14:46:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 07DDB38B135; Fri, 11 Mar 2022 14:01:40 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245656AbiCJWJy (ORCPT + 99 others); Thu, 10 Mar 2022 17:09:54 -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) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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.