mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: Nicolai Stange <nicstange@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Richard Weinberger <richard@nod.at>,
	daniel@iogearbox.net
Subject: Re: [PATCH] lib: test_bpf: purge CPP register redefinitions
Date: Sun, 21 Jun 2015 23:05:27 -0700	[thread overview]
Message-ID: <20150622060523.GA16156@Alexeis-MacBook-Pro.local> (raw)
In-Reply-To: <87twu0df3k.fsf@gmail.com>

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/

  reply	other threads:[~2015-06-22  6:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-21 19:41 Nicolai Stange
2015-06-22  6:05 ` Alexei Starovoitov [this message]
2015-06-22  6:52   ` Richard Weinberger
2015-06-22  7:10     ` Richard Weinberger
2015-06-22 13:47       ` Nicolai Stange
2015-06-23 13:47         ` David Miller
2015-06-23 13:47 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150622060523.GA16156@Alexeis-MacBook-Pro.local \
    --to=alexei.starovoitov@gmail.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nicstange@gmail.com \
    --cc=richard@nod.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®