Re: [PATCH] net: kdoc struct net_device flags and priv_flags

From: Ben Hutchings
Date: Mon Feb 24 2014 - 21:11:20 EST


On Mon, 2014-02-24 at 16:14 -0800, Luis R. Rodriguez wrote:
> From: "Luis R. Rodriguez" <mcgrof@xxxxxxxx>
>
> We have documentation for these flags but they're scattered
> all over the place. #defines don't allow documentation to be
> written easily so to help to start bringing some documentation
> together use the enums kdoc practice but keep the defines to
> allow userspace to be able to #ifdef them.
>
> I've verified the same values are assigned before and after
> with a simple userspace test program [0] and checksumming the
> output.
>
> [0] http://drvbp1.linux-foundation.org/~mcgrof/kdoc/netdev_flags/
>
> mcgrof@gnat ~/tmp $ ./check-flags | sha1sum
> 0ec5b6b1840aa3bb9ce464e61c564820871c92c3 -
>
> Cc: netdev@xxxxxxxxxxxxxxx
> Cc: linux-kernel@xxxxxxxxxxxxxxx
> Signed-off-by: Luis R. Rodriguez <mcgrof@xxxxxxxx>
> ---
> include/uapi/linux/if.h | 201 +++++++++++++++++++++++++++++++++++-------------
> 1 file changed, 149 insertions(+), 52 deletions(-)
>
> diff --git a/include/uapi/linux/if.h b/include/uapi/linux/if.h
> index d758163..1555623 100644
> --- a/include/uapi/linux/if.h
> +++ b/include/uapi/linux/if.h
[...]
> +/**
> + * enum net_device_priv_flags - &struct net_device priv_flags
> + *
> + * These are the &struct net_device, they are only set internally
> + * by drivers and used in the kernel but are invisible to userspace.
[...]

Indeed, I wonder why they are in the UAPI header. As userland doesn't
have a legitimate use for them, maybe you could move them back to
include/linux/if.h instead of bothering with adding macros?

Ben.

--
Ben Hutchings
Everything should be made as simple as possible, but not simpler.
- Albert Einstein

Attachment: signature.asc
Description: This is a digitally signed message part