Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2659076iog; Mon, 20 Jun 2022 01:43:07 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tda7a78pbFzYr87dnVTu5BaJTIX/yXeC0PPSOYEZVXyemjPQEYTdujdYkeP32CeV7VxeF/ X-Received: by 2002:a17:90a:ba07:b0:1ec:a3e7:8b66 with SMTP id s7-20020a17090aba0700b001eca3e78b66mr5489472pjr.108.1655714586864; Mon, 20 Jun 2022 01:43:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655714586; cv=none; d=google.com; s=arc-20160816; b=DUlNIMlBuVz0/FBOj/AF9MasSaMGusGb2jsLnE6AuqFVU6No/QBqh3fOWxOyrdP97L d2g1ZqwxvGjabgm8ycORve0FVBr66tJnCQ5ljpJ8Tia0AZWW+iEMY8g97j4uKq5B7ftv Zk5klcgO3EUc+8AU0Aes8GyCpYmu6L3duyHzDvKDSSRhvhCyP2ujI81ZU9/38dvpSLlg tlWueTN7w+OJ/gt31f7l+6Lqt1QQeRouLj+pjAvgqsg+0yoRzoL45YfPEPEuaNHQP7wJ 1zpR+VHW0C8S1xKCl4BrmpICVoFmI9UTQ7qAAM9i5YxQlgizfk3051+zLqFrqz8o9KhY q6iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=CgeNgkoV6Bqj2VBPemjYPufVub3uOdzNd4hQSPtCEJM=; b=ojrFCMbQ5bS0ONwVbd1dUNlFylTRmvbVTGRmkrhH6r139K7oqnwUCeUlQ2uJBzVIFn ABEQ1uaP5syV8qsLc1hx6crIom8NxiktFrGwfhUey4bCd/Lrv8W3AQyVdQXEg37n5f3r iAU+R7HZJHO/mVVYxJ0aYcLODugEdPqhvYE0GYB46zOVv7Xn9kccbEOXCS4xp8ZEsjpn yVqsvmewI3hLZJv+mJ7c1dOA4RrrTe99tlSynm+UsU66yjB81yTIDn6/Nn1l3D0wjg2n SoxeSjSWN+ngb/F9ixqmR1MmVGhLQMXGmBFut7vY795ovfznIBWnOa3IaIdu8aqpsYym +WPQ== 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:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 141-20020a630093000000b0040c583c37eesi11827250pga.601.2022.06.20.01.42.54; Mon, 20 Jun 2022 01:43:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239618AbiFTH7P (ORCPT + 99 others); Mon, 20 Jun 2022 03:59:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237445AbiFTH7N (ORCPT ); Mon, 20 Jun 2022 03:59:13 -0400 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E41B72DDE; Mon, 20 Jun 2022 00:59:11 -0700 (PDT) Received: from linux.localdomain (unknown [113.200.148.30]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9DxX07GKLBir6JOAA--.21225S2; Mon, 20 Jun 2022 15:59:03 +0800 (CST) From: Tiezhu Yang To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko Cc: Pavel Machek , netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH bpf-next] libbpf: Include linux/log2.h to use is_pow_of_2() Date: Mon, 20 Jun 2022 15:59:02 +0800 Message-Id: <1655711942-6181-1-git-send-email-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.1.0 X-CM-TRANSID: AQAAf9DxX07GKLBir6JOAA--.21225S2 X-Coremail-Antispam: 1UD129KBjvdXoWrKF17WF43Kw1kAF1rKr48Zwb_yoWkCrc_C3 4xJr48Wr9Iyryavw1fAFZ29Fyqqa1ruF18XF1rtwnrGas0kw15GwnrG34kAa4Yg3sayryf WFykXrWfZr1rWjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUb2xYjsxI4VWDJwAYFVCjjxCrM7AC8VAFwI0_Gr0_Xr1l1xkIjI8I 6I8E6xAIw20EY4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l8cAvFVAK0II2c7xJM2 8CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW5JVW7JwA2z4x0Y4vE2Ix0 cI8IcVCY1x0267AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_Cr1j6rxdM28EF7xvwV C2z280aVCY1x0267AKxVW0oVCq3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC 0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUGVWUXwAv7VC2z280aVAFwI0_Gr0_Cr 1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMxkIecxEwVAFwVW8CwCF04k2 0xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI 8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIxkGc2Ij64vIr41l IxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr0_Gr1lIx AIcVCF04k26cxKx2IYs7xG6rW3Jr0E3s1lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2 z280aVCY1x0267AKxVWUJVW8JbIYCTnIWIevJa73UjIFyTuYvjxUcU73DUUUU X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 is_pow_of_2() is already defined in tools/include/linux/log2.h [1], so no need to define it again in tools/lib/bpf/libbpf_internal.h, just include linux/log2.h directly. [1] https://lore.kernel.org/bpf/20220619171248.GC3362@bug/ Suggested-by: Pavel Machek Signed-off-by: Tiezhu Yang --- tools/lib/bpf/libbpf_internal.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tools/lib/bpf/libbpf_internal.h b/tools/lib/bpf/libbpf_internal.h index a1ad145..021946a 100644 --- a/tools/lib/bpf/libbpf_internal.h +++ b/tools/lib/bpf/libbpf_internal.h @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include "libbpf_legacy.h" @@ -582,9 +583,4 @@ struct bpf_link * usdt_manager_attach_usdt(struct usdt_manager *man, const char *usdt_provider, const char *usdt_name, __u64 usdt_cookie); -static inline bool is_pow_of_2(size_t x) -{ - return x && (x & (x - 1)) == 0; -} - #endif /* __LIBBPF_LIBBPF_INTERNAL_H */ -- 2.1.0