From patchwork Tue Jun 28 16:01:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Daniel_M=C3=BCller?= X-Patchwork-Id: 12898502 X-Patchwork-Delegate: bpf@iogearbox.net 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 4C101C43334 for ; Tue, 28 Jun 2022 16:02:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348251AbiF1QCn (ORCPT ); Tue, 28 Jun 2022 12:02:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348324AbiF1QC1 (ORCPT ); Tue, 28 Jun 2022 12:02:27 -0400 Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.66]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98906377FF for ; Tue, 28 Jun 2022 09:01:53 -0700 (PDT) Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 046FF240111 for ; Tue, 28 Jun 2022 18:01:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1656432112; bh=Z2ghHnHk0epn5n04c6qY1QFCK7go3+8p1lg5DfFcm4M=; h=From:To:Cc:Subject:Date:From; b=ecFg9Hpyu1BNQJwNAU2hZANwFJET0DUOVr3JKSOmIAFOFzriujgUYPLzPwHSbzwWq WLtf7OJwZWeSPKJCBC1R9l0eY/+faZsCjDQidnOg1eokhsJdi1YBZz7HP4Zfc89AoM mGqU+FPehoeV1DlWwbEJ7OsAHKTOhHuH0GrFjufNA++yVfoExYVJMGVSR3hfcZK9nY k47Zs+NWCq3/uPsqEPsbTvmegAR9T8/lMZs+mv3bcdM4iqXeepL/a7zZIu9kYjL6KT L0omLCRxBfJcm6762nDBbFKZ+6W1gJIhEXR5KTDr+h3y3vJTD71ndpydk1FdmJRVDo yUDjniok43lSA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4LXTqg1yHVz6tmf; Tue, 28 Jun 2022 18:01:51 +0200 (CEST) From: =?utf-8?q?Daniel_M=C3=BCller?= To: bpf@vger.kernel.org, ast@kernel.org, andrii@kernel.org, daniel@iogearbox.net, kernel-team@fb.com Cc: joannelkoong@gmail.com Subject: [PATCH bpf-next v3 03/10] bpf: Introduce btf_int_bits() function Date: Tue, 28 Jun 2022 16:01:20 +0000 Message-Id: <20220628160127.607834-4-deso@posteo.net> In-Reply-To: <20220628160127.607834-1-deso@posteo.net> References: <20220628160127.607834-1-deso@posteo.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net This change adds the btf_int_bits() function to include/linux/btf.h. It mirrors what already exists in user space and will be required by follow on changes. Signed-off-by: Daniel Müller --- include/linux/btf.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/btf.h b/include/linux/btf.h index 1bfed7..54a65a 100644 --- a/include/linux/btf.h +++ b/include/linux/btf.h @@ -242,6 +242,11 @@ static inline u8 btf_int_offset(const struct btf_type *t) return BTF_INT_OFFSET(*(u32 *)(t + 1)); } +static inline u8 btf_int_bits(const struct btf_type *t) +{ + return BTF_INT_BITS(*(u32 *)(t + 1)); +} + static inline u8 btf_int_encoding(const struct btf_type *t) { return BTF_INT_ENCODING(*(u32 *)(t + 1));