From patchwork Mon May 13 09:11:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gary Lin X-Patchwork-Id: 1098733 Return-Path: X-Original-To: incoming-bpf@patchwork.ozlabs.org Delivered-To: patchwork-incoming-bpf@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=bpf-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 452Zp75R6Qz9sBb for ; Mon, 13 May 2019 19:12:15 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726218AbfEMJMO (ORCPT ); Mon, 13 May 2019 05:12:14 -0400 Received: from smtp.nue.novell.com ([195.135.221.5]:52127 "EHLO smtp.nue.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726132AbfEMJMO (ORCPT ); Mon, 13 May 2019 05:12:14 -0400 Received: from GaryWorkstation.suse.de (unknown.telstraglobal.net [202.47.205.198]) by smtp.nue.novell.com with ESMTP (NOT encrypted); Mon, 13 May 2019 11:12:11 +0200 From: Gary Lin To: bpf@vger.kernel.org, Alexei Starovoitov Cc: Martin KaFai Lau Subject: [PATCH bpf-next 1/2] bpf: btf: fix the brackets of BTF_INT_OFFSET() Date: Mon, 13 May 2019 17:11:57 +0800 Message-Id: <20190513091158.6200-1-glin@suse.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Sender: bpf-owner@vger.kernel.org Precedence: bulk List-Id: netdev.vger.kernel.org 'VAL' should be protected by the brackets. Fixes: 69b693f0aefa ("bpf: btf: Introduce BPF Type Format (BTF)") Signed-off-by: Gary Lin --- include/uapi/linux/btf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/uapi/linux/btf.h b/include/uapi/linux/btf.h index 9310652ca4f9..63ae4a39e58b 100644 --- a/include/uapi/linux/btf.h +++ b/include/uapi/linux/btf.h @@ -83,7 +83,7 @@ struct btf_type { * is the 32 bits arrangement: */ #define BTF_INT_ENCODING(VAL) (((VAL) & 0x0f000000) >> 24) -#define BTF_INT_OFFSET(VAL) (((VAL & 0x00ff0000)) >> 16) +#define BTF_INT_OFFSET(VAL) (((VAL) & 0x00ff0000) >> 16) #define BTF_INT_BITS(VAL) ((VAL) & 0x000000ff) /* Attributes stored in the BTF_INT_ENCODING */ From patchwork Mon May 13 09:11:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gary Lin X-Patchwork-Id: 1098734 Return-Path: X-Original-To: incoming-bpf@patchwork.ozlabs.org Delivered-To: patchwork-incoming-bpf@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=bpf-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 452ZpB3WBKz9sD4 for ; Mon, 13 May 2019 19:12:18 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726132AbfEMJMR (ORCPT ); Mon, 13 May 2019 05:12:17 -0400 Received: from smtp.nue.novell.com ([195.135.221.5]:48534 "EHLO smtp.nue.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727742AbfEMJMQ (ORCPT ); Mon, 13 May 2019 05:12:16 -0400 Received: from GaryWorkstation.suse.de (unknown.telstraglobal.net [202.47.205.198]) by smtp.nue.novell.com with ESMTP (NOT encrypted); Mon, 13 May 2019 11:12:13 +0200 From: Gary Lin To: bpf@vger.kernel.org, Alexei Starovoitov Cc: Martin KaFai Lau Subject: [PATCH bpf-next 2/2] docs/btf: update BTF_INT_OFFSET() Date: Mon, 13 May 2019 17:11:58 +0800 Message-Id: <20190513091158.6200-2-glin@suse.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190513091158.6200-1-glin@suse.com> References: <20190513091158.6200-1-glin@suse.com> MIME-Version: 1.0 Sender: bpf-owner@vger.kernel.org Precedence: bulk List-Id: netdev.vger.kernel.org Fix BTF_INT_OFFSET() in the document Signed-off-by: Gary Lin --- Documentation/bpf/btf.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/bpf/btf.rst b/Documentation/bpf/btf.rst index 8820360d00da..35d83e24dbdb 100644 --- a/Documentation/bpf/btf.rst +++ b/Documentation/bpf/btf.rst @@ -131,7 +131,7 @@ The following sections detail encoding of each kind. ``btf_type`` is followed by a ``u32`` with the following bits arrangement:: #define BTF_INT_ENCODING(VAL) (((VAL) & 0x0f000000) >> 24) - #define BTF_INT_OFFSET(VAL) (((VAL & 0x00ff0000)) >> 16) + #define BTF_INT_OFFSET(VAL) (((VAL) & 0x00ff0000) >> 16) #define BTF_INT_BITS(VAL) ((VAL) & 0x000000ff) The ``BTF_INT_ENCODING`` has the following attributes::