Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp95105iof; Sun, 5 Jun 2022 22:12:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJdg7QbMQh74QF34Q6IySLl7tMWaJZMT0Lvmaf7vOcq1/0mpc322Jjo2MiGWo57GlJRhIN X-Received: by 2002:aa7:9047:0:b0:519:36a2:9f63 with SMTP id n7-20020aa79047000000b0051936a29f63mr22653144pfo.60.1654492332992; Sun, 05 Jun 2022 22:12:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654492332; cv=none; d=google.com; s=arc-20160816; b=BSVAFDwf/urqOU9uJSbtne8GdO7sYmeMMfsE56zPbUcNNgz9Eyub9s3j0MD93anDMS 8LxVbDPjzpYMwcrbdV8y/ozNmhTjoT1ClA0ajPzOcpwpPs5Di7cOUKdfkAIkcuM8clvu Srx/JtCkh04qNnHRJ6rO4GiR17QGgnu7DMcqtjPVR0zxqI0Nd+PNISrsUcKVDVAQ1azW fxsn+fmUcbTO/D+WW+wuOs/aUZ8vEyiHlCSJjulMqUfEQAtY54Pbh2/WC36dG2t73Wgc iWu1dxrmvdmQhda9z9OQgeKFvwzY/kuWk35RNblzvYYTa9Gkwvl3admWpxzPtYQobvMy nmzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=rdCC350CRfTnlMVl9hZPunLr7i2db8KX60dDtm/jhb4=; b=TJP7VtRsAg3hqbfGARnXt1Es7JgBQ92dUNhgIOH314wc+D365feCPUgdrnsON09T3H XnNKzoYhvf3U/Yfj2dId1d+U2sm3QKhTxR6k3BIBc6mefJQkDTOozR+5V+yB/sYXAKsQ pDHHStxuomhsJPiA9KIXqAHNVKTRdqDNr86EogxTdmZ7ti5lgc+dRGjHhlvWfyO4Jn/b lvsT8yhpddXAZQ1IEmIxmgxl9UTesCYd6Bo49qUfm47MesQGIJoGkjqxma7SmfPYoGgr 2gzXP6CRqWGZVbHprVaDGxNh4HMPmNn3NHiXp0ywh16Nrh5i3fBhQ1kgpaNVkk5aD0rL 386A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="dtlC/kgJ"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id q80-20020a632a53000000b003fd157f7e9dsi14114839pgq.857.2022.06.05.22.12.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 22:12:12 -0700 (PDT) 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; dkim=pass header.i=@gmail.com header.s=20210112 header.b="dtlC/kgJ"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2AC0914B679; Sun, 5 Jun 2022 21:18:18 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348736AbiFCVF0 (ORCPT + 99 others); Fri, 3 Jun 2022 17:05:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231235AbiFCVFY (ORCPT ); Fri, 3 Jun 2022 17:05:24 -0400 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61A8F1D0EE; Fri, 3 Jun 2022 14:05:22 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id l30so14446573lfj.3; Fri, 03 Jun 2022 14:05:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=rdCC350CRfTnlMVl9hZPunLr7i2db8KX60dDtm/jhb4=; b=dtlC/kgJuVZ3CpEdyshW/IR+2qIgLu09prKB5QevJec1hXcL9NpbvvzgNZ71mOaAiZ PftpokKOYCrGeork8uYNkaZozFeRadECDkdIa16Jn4C/UQtALgI6m446ReodOYVPs+Kk Kejoro6Tj3+9RBJ/zDzt6A1+Co7sMDJnAiH3pOJ5YsamY4dDsQYB5nte2cBU8u0S7/GB u4AYa+ZGfS/5XzGXrNdKIn0k1wBWzELkZRwu2sJ+63YdiywR+SyoxwBfilufmJboPU+o caid2AT5hUUlS8YLSUyMINY4lZO28FEotMfq4nVHXqBuFNUVmpLr3MWsHN55PMWHTMAV /M7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=rdCC350CRfTnlMVl9hZPunLr7i2db8KX60dDtm/jhb4=; b=RfDLVmuozmgPtcBS05wywyXpL/qDYL5EJqGUX3HFQ/Y+k9sW9m2THQyrYIS7QspLe/ gmbJHQgbTpLtXaH8/458ZsTfXynWFe3IKHSQ3zgeaeIHdfMN2wd/TsxQaoTTPzPRq9p7 PkZjuVjW3OaYg31+7x+sNqPdaXbfkoWjWVpTMbgt9pRwrWeav6djonF9DEh7My4GXx4Y 8wKy07q1oNpEK/sqPz4+RlwxA/geV6e7UfnYKDZp4a2fmv426zXmp+nANPYRS0PdTwRy c54DgeYjpvz151q3rISSBhhjqQR7Lj7aIf1PCGy9xWNCBR9itmqkameO3B6o9gHCUKoT 5ijw== X-Gm-Message-State: AOAM532QXQCakQ/sLN2urSOFmYTz6co0IGzgc0uwN3q9ejASQZwtnaJv fHXY3IxD1NFJMWKkA3H9Iq0QOsGlaxhZ0fZx2Bs= X-Received: by 2002:a05:6512:2625:b0:478:5a51:7fe3 with SMTP id bt37-20020a056512262500b004785a517fe3mr7697698lfb.158.1654290320714; Fri, 03 Jun 2022 14:05:20 -0700 (PDT) MIME-Version: 1.0 References: <20220530092815.1112406-1-pulehui@huawei.com> <20220530092815.1112406-7-pulehui@huawei.com> In-Reply-To: <20220530092815.1112406-7-pulehui@huawei.com> From: Andrii Nakryiko Date: Fri, 3 Jun 2022 14:05:09 -0700 Message-ID: Subject: Re: [PATCH bpf-next v3 6/6] selftests/bpf: Remove the casting about jited_ksyms and jited_linfo To: Pu Lehui Cc: bpf , linux-riscv@lists.infradead.org, Networking , open list , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , Luke Nelson , Xi Wang , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Paul Walmsley , Palmer Dabbelt , Albert Ou Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,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 Mon, May 30, 2022 at 1:58 AM Pu Lehui wrote: > > We have unified data extension operation of jited_ksyms and jited_linfo > into zero extension, so there's no need to cast u64 memory address to > long data type. > > Signed-off-by: Pu Lehui > --- > tools/testing/selftests/bpf/prog_tests/btf.c | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) > > diff --git a/tools/testing/selftests/bpf/prog_tests/btf.c b/tools/testing/selftests/bpf/prog_tests/btf.c > index e6612f2bd0cf..65bdc4aa0a63 100644 > --- a/tools/testing/selftests/bpf/prog_tests/btf.c > +++ b/tools/testing/selftests/bpf/prog_tests/btf.c > @@ -6599,8 +6599,8 @@ static int test_get_linfo(const struct prog_info_raw_test *test, > } > > if (CHECK(jited_linfo[0] != jited_ksyms[0], > - "jited_linfo[0]:%lx != jited_ksyms[0]:%lx", > - (long)(jited_linfo[0]), (long)(jited_ksyms[0]))) { > + "jited_linfo[0]:%llx != jited_ksyms[0]:%llx", > + jited_linfo[0], jited_ksyms[0])) { __u64 is not always printed with %lld, on some platforms it is actually %ld, so to avoid compiler warnings we just cast them to long long or unsigned long long (and then %lld or %llu is fine). So please update this part here and below. > err = -1; > goto done; > } > @@ -6618,16 +6618,16 @@ static int test_get_linfo(const struct prog_info_raw_test *test, > } > > if (CHECK(jited_linfo[i] <= jited_linfo[i - 1], > - "jited_linfo[%u]:%lx <= jited_linfo[%u]:%lx", > - i, (long)jited_linfo[i], > - i - 1, (long)(jited_linfo[i - 1]))) { > + "jited_linfo[%u]:%llx <= jited_linfo[%u]:%llx", > + i, jited_linfo[i], > + i - 1, jited_linfo[i - 1])) { > err = -1; > goto done; > } > > if (CHECK(jited_linfo[i] - cur_func_ksyms > cur_func_len, > - "jited_linfo[%u]:%lx - %lx > %u", > - i, (long)jited_linfo[i], (long)cur_func_ksyms, > + "jited_linfo[%u]:%llx - %llx > %u", > + i, jited_linfo[i], cur_func_ksyms, > cur_func_len)) { > err = -1; > goto done; > -- > 2.25.1 >