Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1169700

Re: [PATCH] lib: test_bpf: purge CPP register redefinitions

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Alexei Starovoitov <alexei.starovoitov@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH] lib: test_bpf: purge CPP register redefinitions
Date Mon, 22 Jun 2015 08:10:01 +0200
Message-ID <pE35D-3Do-1@gated-at.bofh.it> (permalink)
References <pDTpE-6oD-1@gated-at.bofh.it>
X-Original-To Nicolai Stange <nicstange@gmail.com>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=cohXynDePuiOmjfQg9CakvtXmpnEOxUr3D6Y6fjCa8w=; b=DmOJNtp/P1HBMRC6jcRMQhm2Ql6V6Cq9QOallo2dhzs2gEZXyREsDgqEhC99Et202j XqIYV50TNTwON8/I0RzCoFrPemE3RCJo0EEDpUQSCRP+GIhGH03v7Be73Ct669zuMPfr yiW0V1E6hpHrZn3U9VeP7GuQDFgsfViQySdwf7DZwKTSPT8trVx25u+sSfCXxTDONq0K b4xkqTriW01QmhQUYBwzaWe97kMrjp0cPh08Cm2cU+SRJBFn7uuTqT9Iznf23hADF4tC XHIx1p+pYZnbpoIyRSdsJtix7qtA/PVLMfStv7DwSi6o0ziAreSTWndSCRZidLkaDU0e eMsA==
X-Received by 10.180.78.136 with SMTP id b8mr27928311wix.89.1434953130299; Sun, 21 Jun 2015 23:05:30 -0700 (PDT)
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent Mutt/1.5.23 (2014-03-12)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 49
Organization linux.* mail to news gateway
X-Original-Cc "David S. Miller" <davem@davemloft.net>, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Richard Weinberger <richard@nod.at>, daniel@iogearbox.net
X-Original-Date Sun, 21 Jun 2015 23:05:27 -0700
X-Original-Message-ID <20150622060523.GA16156@Alexeis-MacBook-Pro.local>
X-Original-References <87twu0df3k.fsf@gmail.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref aioe.org linux.kernel:1169700

Show key headers only | View raw


On Sun, Jun 21, 2015 at 09:41:03PM +0200, Nicolai Stange wrote:
> Fix compilation failer with allmodconfig on ARCH=um:
>   lib/test_bpf.c:50:0: warning: "R8" redefined
>    #define R8  BPF_REG_8
>    ^
>   In file included from arch/um/include/asm/ptrace-generic.h:11:0,
>                    from arch/x86/um/asm/ptrace.h:8,
>                    from arch/x86/include/asm/alternative.h:8,
>                    from arch/x86/include/asm/bitops.h:16,
>                    from include/linux/bitops.h:36,
>                    from include/linux/kernel.h:10,
>                    from include/linux/list.h:8,
>                    from include/linux/module.h:9,
>                    from lib/test_bpf.c:19:
>   arch/x86/include/uapi/asm/ptrace-abi.h:42:0:
>     note: this is the location of the previous definition
>      #define R8 72
> 
> Get rid of the
>   #define Rx BPF_REG_x
> defines by substituting the Rx macros with their BPF_REG_x expansion
> in test_bpf.c.
> 
> Signed-off-by: Nicolai Stange <nicstange@gmail.com>
> ---
> Tested:
>   - compilation for ARCH=x86_64 and ARCH=um
>   - 'modprobe test_bpf' on ARCH=x86_64
> 
>  lib/test_bpf.c | 2374 ++++++++++++++++++++++++++++----------------------------
>  1 file changed, 1193 insertions(+), 1181 deletions(-)

to get rid of warning you proposing to do 1k line renames?!
Just add:
+#undef R8
+#undef R9
+#undef R10
 #define R0             BPF_REG_0

Though I think the better fix woud be to clean up:
arch/x86/include/uapi/asm/ptrace-abi.h
What's the point of:
#define R8 72
from 'uapi' point of view?
Look like kernel details that shouldn't be exposed in uapi.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH] lib: test_bpf: purge CPP register redefinitions Alexei Starovoitov <alexei.starovoitov@gmail.com> - 2015-06-22 08:10 +0200
  Re: [PATCH] lib: test_bpf: purge CPP register redefinitions Richard Weinberger <richard@nod.at> - 2015-06-22 09:00 +0200

csiph-web