* [PATCH bpf] selftests/bpf: fix bpf_target_sparc check
@ 2019-07-09 15:21 Ilya Leoshkevich
2019-07-09 17:56 ` Andrii Nakryiko
0 siblings, 1 reply; 3+ messages in thread
From: Ilya Leoshkevich @ 2019-07-09 15:21 UTC (permalink / raw)
To: bpf, netdev; +Cc: Ilya Leoshkevich
bpf_helpers.h fails to compile on sparc: the code should be checking
for defined(bpf_target_sparc), but checks simply for bpf_target_sparc.
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
---
tools/testing/selftests/bpf/bpf_helpers.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/bpf/bpf_helpers.h b/tools/testing/selftests/bpf/bpf_helpers.h
index 5f6f9e7aba2a..a8fea087aa90 100644
--- a/tools/testing/selftests/bpf/bpf_helpers.h
+++ b/tools/testing/selftests/bpf/bpf_helpers.h
@@ -443,7 +443,7 @@ static int (*bpf_skb_adjust_room)(void *ctx, __s32 len_diff, __u32 mode,
#ifdef bpf_target_powerpc
#define BPF_KPROBE_READ_RET_IP(ip, ctx) ({ (ip) = (ctx)->link; })
#define BPF_KRETPROBE_READ_RET_IP BPF_KPROBE_READ_RET_IP
-#elif bpf_target_sparc
+#elif defined(bpf_target_sparc)
#define BPF_KPROBE_READ_RET_IP(ip, ctx) ({ (ip) = PT_REGS_RET(ctx); })
#define BPF_KRETPROBE_READ_RET_IP BPF_KPROBE_READ_RET_IP
#else
--
2.21.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH bpf] selftests/bpf: fix bpf_target_sparc check
2019-07-09 15:21 [PATCH bpf] selftests/bpf: fix bpf_target_sparc check Ilya Leoshkevich
@ 2019-07-09 17:56 ` Andrii Nakryiko
2019-07-10 8:59 ` Ilya Leoshkevich
0 siblings, 1 reply; 3+ messages in thread
From: Andrii Nakryiko @ 2019-07-09 17:56 UTC (permalink / raw)
To: Ilya Leoshkevich; +Cc: bpf, Networking
On Tue, Jul 9, 2019 at 8:22 AM Ilya Leoshkevich <iii@linux.ibm.com> wrote:
>
> bpf_helpers.h fails to compile on sparc: the code should be checking
> for defined(bpf_target_sparc), but checks simply for bpf_target_sparc.
>
> Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
> ---
> tools/testing/selftests/bpf/bpf_helpers.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/bpf/bpf_helpers.h b/tools/testing/selftests/bpf/bpf_helpers.h
> index 5f6f9e7aba2a..a8fea087aa90 100644
> --- a/tools/testing/selftests/bpf/bpf_helpers.h
> +++ b/tools/testing/selftests/bpf/bpf_helpers.h
> @@ -443,7 +443,7 @@ static int (*bpf_skb_adjust_room)(void *ctx, __s32 len_diff, __u32 mode,
> #ifdef bpf_target_powerpc
While at it, can you please also fix this one?
> #define BPF_KPROBE_READ_RET_IP(ip, ctx) ({ (ip) = (ctx)->link; })
> #define BPF_KRETPROBE_READ_RET_IP BPF_KPROBE_READ_RET_IP
> -#elif bpf_target_sparc
> +#elif defined(bpf_target_sparc)
> #define BPF_KPROBE_READ_RET_IP(ip, ctx) ({ (ip) = PT_REGS_RET(ctx); })
> #define BPF_KRETPROBE_READ_RET_IP BPF_KPROBE_READ_RET_IP
> #else
> --
> 2.21.0
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH bpf] selftests/bpf: fix bpf_target_sparc check
2019-07-09 17:56 ` Andrii Nakryiko
@ 2019-07-10 8:59 ` Ilya Leoshkevich
0 siblings, 0 replies; 3+ messages in thread
From: Ilya Leoshkevich @ 2019-07-10 8:59 UTC (permalink / raw)
To: Andrii Nakryiko; +Cc: bpf, Networking
> Am 09.07.2019 um 19:56 schrieb Andrii Nakryiko <andrii.nakryiko@gmail.com>:
>
> On Tue, Jul 9, 2019 at 8:22 AM Ilya Leoshkevich <iii@linux.ibm.com> wrote:
>>
>> bpf_helpers.h fails to compile on sparc: the code should be checking
>> for defined(bpf_target_sparc), but checks simply for bpf_target_sparc.
>>
>> Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
>> ---
>> tools/testing/selftests/bpf/bpf_helpers.h | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/tools/testing/selftests/bpf/bpf_helpers.h b/tools/testing/selftests/bpf/bpf_helpers.h
>> index 5f6f9e7aba2a..a8fea087aa90 100644
>> --- a/tools/testing/selftests/bpf/bpf_helpers.h
>> +++ b/tools/testing/selftests/bpf/bpf_helpers.h
>> @@ -443,7 +443,7 @@ static int (*bpf_skb_adjust_room)(void *ctx, __s32 len_diff, __u32 mode,
>> #ifdef bpf_target_powerpc
>
> While at it, can you please also fix this one?
Do you mean #ifdef bpf_target_powerpc? I think it’s correct, because it’s #ifdef, not #if.
But I could change it to #if defined() for consistency.
Best regards,
Ilya
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-07-10 9:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-09 15:21 [PATCH bpf] selftests/bpf: fix bpf_target_sparc check Ilya Leoshkevich
2019-07-09 17:56 ` Andrii Nakryiko
2019-07-10 8:59 ` Ilya Leoshkevich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).