[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZwaHF8ZEEHXV7yCE@nanopsycho.orion>
Date: Wed, 9 Oct 2024 15:37:27 +0200
From: Jiri Pirko <jiri@...nulli.us>
To: Antonio Quartulli <a@...table.cc>
Cc: kuba@...nel.org, netdev@...r.kernel.org, donald.hunter@...il.com,
pabeni@...hat.com, davem@...emloft.net, edumazet@...gle.com
Subject: Re: [PATCH] tools: ynl-gen: include auto-generated uAPI header only
once
Wed, Oct 09, 2024 at 03:00:42PM CEST, a@...table.cc wrote:
>On 09/10/2024 14:50, Jiri Pirko wrote:
>> Wed, Oct 09, 2024 at 02:12:35PM CEST, a@...table.cc wrote:
>> > The auto-generated uAPI file is currently included in both the
>> > .h and .c netlink stub files.
>> > However, the .c file already includes its .h counterpart, thus
>> > leading to a double inclusion of the uAPI header.
>> >
>> > Prevent the double inclusion by including the uAPI header in the
>> > .h stub file only.
>> >
>> > Signed-off-by: Antonio Quartulli <a@...table.cc>
>> > ---
>> > drivers/dpll/dpll_nl.c | 2 --
>> > drivers/net/team/team_nl.c | 2 --
>> > fs/nfsd/netlink.c | 2 --
>> > net/core/netdev-genl-gen.c | 1 -
>> > net/devlink/netlink_gen.c | 2 --
>> > net/handshake/genl.c | 2 --
>> > net/ipv4/fou_nl.c | 2 --
>> > net/mptcp/mptcp_pm_gen.c | 2 --
>> > tools/net/ynl/ynl-gen-c.py | 4 +++-
>> > 9 files changed, 3 insertions(+), 16 deletions(-)
>> >
>> > diff --git a/drivers/dpll/dpll_nl.c b/drivers/dpll/dpll_nl.c
>> > index fe9b6893d261..9a739d9dcfbd 100644
>> > --- a/drivers/dpll/dpll_nl.c
>> > +++ b/drivers/dpll/dpll_nl.c
>> > @@ -8,8 +8,6 @@
>> >
>> > #include "dpll_nl.h"
>> >
>> > -#include <uapi/linux/dpll.h>
>>
>> What seems to be the problem? The uapi headers are protected for double
>> inclusion, no?
>> #ifndef _UAPI_LINUX_DPLL_H
>> #define _UAPI_LINUX_DPLL_H
>
>There is no problem to fix, this is just a compile-time micro-optimization by
>reducing the number of includes to follow.
>
>I was recently told there is ongoing effort to reduce the amount of useless
>includes in order to speed up the compilation process.
Do you have some numbers?
So far I had impression that the common practise is to include header
directly when needed and not to depend on indirect include.
>
>I thought this was an easy fix in this direction :)
>
>Regards,
>
>--
>Antonio Quartulli
Powered by blists - more mailing lists