2022-10-31 10:51:21

by Yang Jihong

[permalink] [raw]
Subject: [PATCH] uapi: Add missing linux/stddef.h header file to in.h

commit 5854a09b4957 ("net/ipv4: Use __DECLARE_FLEX_ARRAY() helper") does not
include "linux/stddef.h" header file, and tools headers update linux/in.h copy,
BPF prog fails to be compiled:

CLNG-BPF [test_maps] bpf_flow.bpf.o
CLNG-BPF [test_maps] cgroup_skb_sk_lookup_kern.bpf.o
In file included from progs/cgroup_skb_sk_lookup_kern.c:9:
/root/linux/tools/include/uapi/linux/in.h:199:3: error: type name requires a specifier or qualifier
__DECLARE_FLEX_ARRAY(__be32, imsf_slist_flex);
^
/root/linux/tools/include/uapi/linux/in.h:199:32: error: type specifier missing, defaults to 'int' [-Werror,-Wimplicit-int]
__DECLARE_FLEX_ARRAY(__be32, imsf_slist_flex);
^
2 errors generated.

To maintain consistency, add missing header file to kernel.
Fixes: 5854a09b4957 ("net/ipv4: Use __DECLARE_FLEX_ARRAY() helper")

Signed-off-by: Yang Jihong <[email protected]>
---
include/uapi/linux/in.h | 1 +
1 file changed, 1 insertion(+)

diff --git a/include/uapi/linux/in.h b/include/uapi/linux/in.h
index f243ce665f74..79015665daf1 100644
--- a/include/uapi/linux/in.h
+++ b/include/uapi/linux/in.h
@@ -22,6 +22,7 @@
#include <linux/types.h>
#include <linux/libc-compat.h>
#include <linux/socket.h>
+#include <linux/stddef.h>

#if __UAPI_DEF_IN_IPPROTO
/* Standard well-defined IP protocols. */
--
2.30.GIT



2022-11-03 08:50:37

by Paolo Abeni

[permalink] [raw]
Subject: Re: [PATCH] uapi: Add missing linux/stddef.h header file to in.h

On Mon, 2022-10-31 at 17:55 +0800, Yang Jihong wrote:
> commit 5854a09b4957 ("net/ipv4: Use __DECLARE_FLEX_ARRAY() helper") does not
> include "linux/stddef.h" header file, and tools headers update linux/in.h copy,
> BPF prog fails to be compiled:
>
> CLNG-BPF [test_maps] bpf_flow.bpf.o
> CLNG-BPF [test_maps] cgroup_skb_sk_lookup_kern.bpf.o
> In file included from progs/cgroup_skb_sk_lookup_kern.c:9:
> /root/linux/tools/include/uapi/linux/in.h:199:3: error: type name requires a specifier or qualifier
> __DECLARE_FLEX_ARRAY(__be32, imsf_slist_flex);
> ^
> /root/linux/tools/include/uapi/linux/in.h:199:32: error: type specifier missing, defaults to 'int' [-Werror,-Wimplicit-int]
> __DECLARE_FLEX_ARRAY(__be32, imsf_slist_flex);
> ^
> 2 errors generated.
>
> To maintain consistency, add missing header file to kernel.
> Fixes: 5854a09b4957 ("net/ipv4: Use __DECLARE_FLEX_ARRAY() helper")
>
> Signed-off-by: Yang Jihong <[email protected]>

The 'Fixes' tag must be separated by the commit message by a blank
line, and you need to remove the empty line between 'Fixes' and SoB.

Additionally, on repost, please specify the target tree in the patch
subj, and wrap the commit message text to 75 chars per line (that does
not apply to the build output).

Thanks,

Paolo


2022-11-03 09:09:47

by Yang Jihong

[permalink] [raw]
Subject: Re: [PATCH] uapi: Add missing linux/stddef.h header file to in.h

Hello Paolo,

On 2022/11/3 16:25, Paolo Abeni wrote:
> On Mon, 2022-10-31 at 17:55 +0800, Yang Jihong wrote:
>> commit 5854a09b4957 ("net/ipv4: Use __DECLARE_FLEX_ARRAY() helper") does not
>> include "linux/stddef.h" header file, and tools headers update linux/in.h copy,
>> BPF prog fails to be compiled:
>>
>> CLNG-BPF [test_maps] bpf_flow.bpf.o
>> CLNG-BPF [test_maps] cgroup_skb_sk_lookup_kern.bpf.o
>> In file included from progs/cgroup_skb_sk_lookup_kern.c:9:
>> /root/linux/tools/include/uapi/linux/in.h:199:3: error: type name requires a specifier or qualifier
>> __DECLARE_FLEX_ARRAY(__be32, imsf_slist_flex);
>> ^
>> /root/linux/tools/include/uapi/linux/in.h:199:32: error: type specifier missing, defaults to 'int' [-Werror,-Wimplicit-int]
>> __DECLARE_FLEX_ARRAY(__be32, imsf_slist_flex);
>> ^
>> 2 errors generated.
>>
>> To maintain consistency, add missing header file to kernel.
>> Fixes: 5854a09b4957 ("net/ipv4: Use __DECLARE_FLEX_ARRAY() helper")
>>
>> Signed-off-by: Yang Jihong <[email protected]>
>
> The 'Fixes' tag must be separated by the commit message by a blank
> line, and you need to remove the empty line between 'Fixes' and SoB.
>
> Additionally, on repost, please specify the target tree in the patch
> subj, and wrap the commit message text to 75 chars per line (that does
> not apply to the build output).
>
OK, will fix these issues in the next version, thanks for your advice.


Thanks,
Yang
> Thanks,
>
> Paolo
>
>
> .
>