linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next] bpf: hide the unused 'off' variable
@ 2018-05-29  2:40 YueHaibing
  2018-05-29 10:35 ` Arnd Bergmann
  0 siblings, 1 reply; 5+ messages in thread
From: YueHaibing @ 2018-05-29  2:40 UTC (permalink / raw)
  To: davem, ast, daniel; +Cc: netdev, linux-kernel, YueHaibing

The local variable is only used while CONFIG_IPV6 enabled

net/core/filter.c: In function ‘sk_msg_convert_ctx_access’:
net/core/filter.c:6489:6: warning: unused variable ‘off’ [-Wunused-variable]
  int off;
      ^
This puts it into #ifdef.

Fixes: 303def35f64e ("bpf: allow sk_msg programs to read sock fields")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 net/core/filter.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/core/filter.c b/net/core/filter.c
index 24e6ce8..0ce93ed 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -6486,7 +6486,9 @@ static u32 sk_msg_convert_ctx_access(enum bpf_access_type type,
 				     struct bpf_prog *prog, u32 *target_size)
 {
 	struct bpf_insn *insn = insn_buf;
+#if IS_ENABLED(CONFIG_IPV6)
 	int off;
+#endif
 
 	switch (si->off) {
 	case offsetof(struct sk_msg_md, data):
-- 
2.7.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH bpf-next] bpf: hide the unused 'off' variable
  2018-05-29  2:40 [PATCH bpf-next] bpf: hide the unused 'off' variable YueHaibing
@ 2018-05-29 10:35 ` Arnd Bergmann
  2018-05-29 15:53   ` John Fastabend
  0 siblings, 1 reply; 5+ messages in thread
From: Arnd Bergmann @ 2018-05-29 10:35 UTC (permalink / raw)
  To: YueHaibing
  Cc: David Miller, Alexei Starovoitov, Daniel Borkmann, Networking,
	Linux Kernel Mailing List

On Tue, May 29, 2018 at 4:40 AM, YueHaibing <yuehaibing@huawei.com> wrote:
> The local variable is only used while CONFIG_IPV6 enabled
>
> net/core/filter.c: In function ‘sk_msg_convert_ctx_access’:
> net/core/filter.c:6489:6: warning: unused variable ‘off’ [-Wunused-variable]
>   int off;
>       ^
> This puts it into #ifdef.
>
> Fixes: 303def35f64e ("bpf: allow sk_msg programs to read sock fields")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

I was about to send the same patch and found you had already sent one.

Acked-by: Arnd Bergmann <arnd@arndb.de>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH bpf-next] bpf: hide the unused 'off' variable
  2018-05-29 10:35 ` Arnd Bergmann
@ 2018-05-29 15:53   ` John Fastabend
  2018-05-29 18:18     ` Song Liu
  0 siblings, 1 reply; 5+ messages in thread
From: John Fastabend @ 2018-05-29 15:53 UTC (permalink / raw)
  To: Arnd Bergmann, YueHaibing
  Cc: David Miller, Alexei Starovoitov, Daniel Borkmann, Networking,
	Linux Kernel Mailing List

On 05/29/2018 03:35 AM, Arnd Bergmann wrote:
> On Tue, May 29, 2018 at 4:40 AM, YueHaibing <yuehaibing@huawei.com> wrote:
>> The local variable is only used while CONFIG_IPV6 enabled
>>
>> net/core/filter.c: In function ‘sk_msg_convert_ctx_access’:
>> net/core/filter.c:6489:6: warning: unused variable ‘off’ [-Wunused-variable]
>>   int off;
>>       ^
>> This puts it into #ifdef.
>>
>> Fixes: 303def35f64e ("bpf: allow sk_msg programs to read sock fields")
>> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> 
> I was about to send the same patch and found you had already sent one.
> 
> Acked-by: Arnd Bergmann <arnd@arndb.de>
> 

Thanks! I'm curious why kbuild bot didn't catch this. Will
try to dig into that in a bit.

Acked-by: John Fastabend <john.fastabend@gmail.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH bpf-next] bpf: hide the unused 'off' variable
  2018-05-29 15:53   ` John Fastabend
@ 2018-05-29 18:18     ` Song Liu
  2018-05-29 19:50       ` Daniel Borkmann
  0 siblings, 1 reply; 5+ messages in thread
From: Song Liu @ 2018-05-29 18:18 UTC (permalink / raw)
  To: John Fastabend
  Cc: Arnd Bergmann, YueHaibing, David Miller, Alexei Starovoitov,
	Daniel Borkmann, Networking, Linux Kernel Mailing List

On Tue, May 29, 2018 at 8:53 AM, John Fastabend
<john.fastabend@gmail.com> wrote:
> On 05/29/2018 03:35 AM, Arnd Bergmann wrote:
>> On Tue, May 29, 2018 at 4:40 AM, YueHaibing <yuehaibing@huawei.com> wrote:
>>> The local variable is only used while CONFIG_IPV6 enabled
>>>
>>> net/core/filter.c: In function ‘sk_msg_convert_ctx_access’:
>>> net/core/filter.c:6489:6: warning: unused variable ‘off’ [-Wunused-variable]
>>>   int off;
>>>       ^
>>> This puts it into #ifdef.
>>>
>>> Fixes: 303def35f64e ("bpf: allow sk_msg programs to read sock fields")
>>> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
>>
>> I was about to send the same patch and found you had already sent one.
>>
>> Acked-by: Arnd Bergmann <arnd@arndb.de>
>>
>
> Thanks! I'm curious why kbuild bot didn't catch this. Will
> try to dig into that in a bit.
>
> Acked-by: John Fastabend <john.fastabend@gmail.com>

Acked-by: Song Liu <songliubraving@fb.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH bpf-next] bpf: hide the unused 'off' variable
  2018-05-29 18:18     ` Song Liu
@ 2018-05-29 19:50       ` Daniel Borkmann
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel Borkmann @ 2018-05-29 19:50 UTC (permalink / raw)
  To: Song Liu, John Fastabend
  Cc: Arnd Bergmann, YueHaibing, David Miller, Alexei Starovoitov,
	Networking, Linux Kernel Mailing List

On 05/29/2018 08:18 PM, Song Liu wrote:
> On Tue, May 29, 2018 at 8:53 AM, John Fastabend
> <john.fastabend@gmail.com> wrote:
>> On 05/29/2018 03:35 AM, Arnd Bergmann wrote:
>>> On Tue, May 29, 2018 at 4:40 AM, YueHaibing <yuehaibing@huawei.com> wrote:
>>>> The local variable is only used while CONFIG_IPV6 enabled
>>>>
>>>> net/core/filter.c: In function ‘sk_msg_convert_ctx_access’:
>>>> net/core/filter.c:6489:6: warning: unused variable ‘off’ [-Wunused-variable]
>>>>   int off;
>>>>       ^
>>>> This puts it into #ifdef.
>>>>
>>>> Fixes: 303def35f64e ("bpf: allow sk_msg programs to read sock fields")
>>>> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
>>>
>>> I was about to send the same patch and found you had already sent one.
>>>
>>> Acked-by: Arnd Bergmann <arnd@arndb.de>
>>
>> Thanks! I'm curious why kbuild bot didn't catch this. Will
>> try to dig into that in a bit.
>>
>> Acked-by: John Fastabend <john.fastabend@gmail.com>
> 
> Acked-by: Song Liu <songliubraving@fb.com>

Applied to bpf-next, thanks Yue!

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-05-29 19:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-29  2:40 [PATCH bpf-next] bpf: hide the unused 'off' variable YueHaibing
2018-05-29 10:35 ` Arnd Bergmann
2018-05-29 15:53   ` John Fastabend
2018-05-29 18:18     ` Song Liu
2018-05-29 19:50       ` Daniel Borkmann

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).