Re: [PATCH v2] net: introduce helper macro for_each_cmsghdr

From: Gu Zheng
Date: Wed Dec 10 2014 - 20:21:52 EST


Hi David,
On 12/11/2014 03:44 AM, David Miller wrote:

> From: David Miller <davem@xxxxxxxxxxxxx>
> Date: Wed, 10 Dec 2014 13:48:04 -0500 (EST)
>
>> From: Gu Zheng <guz.fnst@xxxxxxxxxxxxxx>
>> Date: Wed, 10 Dec 2014 13:36:25 +0800
>>
>>> Introduce helper macro for_each_cmsghdr as a wrapper of the enumerating
>>> cmsghdr from msghdr, just cleanup.
>>>
>>> Signed-off-by: Gu Zheng <guz.fnst@xxxxxxxxxxxxxx>
>>
>> Applied, thanks.
>
> This breaks the build, I'm reverting.

I'm very sorry.

>
> You cannot use your new macros in
> Documentation/networking/timestamping/txtimestamp.c, that is a
> userland program and the header you are adding your helper to is not
> available to userspace.

IMO, the user-land programs need to be build with the matched headers separately.
I split the kernel codes and the user-land programs, build and install the kernel first,
and then build the user-land ones.

>
> This also means you didn't sufficiently test the build of your
> changes.

To be honest, I do the test as I mentioned above.

Thanks,
Gu

>
> Documentation/networking/timestamping/timestamping.c: In function ʽprintpacketʼ:
> Documentation/networking/timestamping/timestamping.c:172:2: warning: implicit declaration of function ʽfor_each_cmsghdrʼ [-Wimplicit-function-declaration]
> Documentation/networking/timestamping/timestamping.c:172:30: error: expected ʽ;ʼ before ʽ{ʼ token
> Documentation/networking/timestamping/timestamping.c:161:18: warning: unused variable ʽtsʼ [-Wunused-variable]
> Documentation/networking/timestamping/timestamping.c:160:17: warning: unused variable ʽtvʼ [-Wunused-variable]
> make[3]: *** [Documentation/networking/timestamping/timestamping] Error 1
> make[3]: *** Waiting for unfinished jobs....
> Documentation/networking/timestamping/txtimestamp.c: In function ʽ__recv_errmsg_cmsgʼ:
> Documentation/networking/timestamping/txtimestamp.c:187:2: warning: implicit declaration of function ʽfor_each_cmsghdrʼ [-Wimplicit-function-declaration]
> Documentation/networking/timestamping/txtimestamp.c:187:19: error: ʽcmsgʼ undeclared (first use in this function)
> Documentation/networking/timestamping/txtimestamp.c:187:19: note: each undeclared identifier is reported only once for each function it appears in
> Documentation/networking/timestamping/txtimestamp.c:187:30: error: expected ʽ;ʼ before ʽ{ʼ token
> Documentation/networking/timestamping/txtimestamp.c:185:18: warning: unused variable ʽcmʼ [-Wunused-variable]
> Documentation/networking/timestamping/txtimestamp.c:184:27: warning: unused variable ʽtssʼ [-Wunused-variable]
> Documentation/networking/timestamping/txtimestamp.c:183:28: warning: unused variable ʽserrʼ [-Wunused-variable]
> Documentation/networking/timestamping/txtimestamp.c: At top level:
> Documentation/networking/timestamping/txtimestamp.c:123:13: warning: ʽprint_timestampʼ defined but not used [-Wunused-function]
> Documentation/networking/timestamping/txtimestamp.c:159:13: warning: ʽprint_pktinfoʼ defined but not used [-Wunused-function]
>


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/