netlink: hide validation union fields from kdoc
authorJakub Kicinski <kuba@kernel.org>
Thu, 27 Oct 2022 21:21:07 +0000 (14:21 -0700)
committerJakub Kicinski <kuba@kernel.org>
Sat, 29 Oct 2022 03:19:15 +0000 (20:19 -0700)
Mark the validation fields as private, users shouldn't set
them directly and they are too complicated to explain in
a more succinct way (there's already a long explanation
in the comment above).

The strict_start_type field is set directly and has a dedicated
comment so move that above the "private" section.

Link: https://lore.kernel.org/r/20221027212107.2639255-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/netlink.h

index 4418b1981e318d7dd9118091004c1e760b660f7e..7db13b3261fc2904b6f807e687cd937b8df12140 100644 (file)
@@ -317,19 +317,10 @@ struct nla_policy {
        u8              validation_type;
        u16             len;
        union {
-               const u32 bitfield32_valid;
-               const u32 mask;
-               const char *reject_message;
-               const struct nla_policy *nested_policy;
-               struct netlink_range_validation *range;
-               struct netlink_range_validation_signed *range_signed;
-               struct {
-                       s16 min, max;
-                       u8 network_byte_order:1;
-               };
-               int (*validate)(const struct nlattr *attr,
-                               struct netlink_ext_ack *extack);
-               /* This entry is special, and used for the attribute at index 0
+               /**
+                * @strict_start_type: first attribute to validate strictly
+                *
+                * This entry is special, and used for the attribute at index 0
                 * only, and specifies special data about the policy, namely it
                 * specifies the "boundary type" where strict length validation
                 * starts for any attribute types >= this value, also, strict
@@ -348,6 +339,20 @@ struct nla_policy {
                 * was added to enforce strict validation from thereon.
                 */
                u16 strict_start_type;
+
+               /* private: use NLA_POLICY_*() to set */
+               const u32 bitfield32_valid;
+               const u32 mask;
+               const char *reject_message;
+               const struct nla_policy *nested_policy;
+               struct netlink_range_validation *range;
+               struct netlink_range_validation_signed *range_signed;
+               struct {
+                       s16 min, max;
+                       u8 network_byte_order:1;
+               };
+               int (*validate)(const struct nlattr *attr,
+                               struct netlink_ext_ack *extack);
        };
 };