Skip to contentSkip to conversation

landlock: Fix kernel-doc warning for pointer-to-array parameters

PATCH In review Mickaël Salaün 2 participants 2 messages Mar 10

Subsystems (2)
lore
Share & tools
lore

Mickaël Salaün

author maintainer
#0 lore raw

PATCH v2 1/1 landlock: Fix kernel-doc warning for pointer-to-array parameters

The insert_rule() and create_rule() functions take a pointer-to-flexible-array parameter declared as:

const struct landlock_layer (*const layers)[]

The kernel-doc parser cannot handle a qualifier between * and the parameter name in this syntax, producing spurious "Invalid param" and "not described" warnings.

Remove the const qualifier of the "layers" argument to avoid this parsing issue.

Cc Günther Noack <[email protected]>
Cc Jonathan Corbet <[email protected]>

---

Changes since v1:
https://lore.kernel.org/r/[email protected]
- Remove const instead of using a typedef (suggested by Günther).

---
 security/landlock/ruleset.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
security/landlock/ruleset.c +2 -2
index 3234a5bc11ff..181df7736bb9 100644
@@ -107,7 +107,7 @@ static bool is_object_pointer(const enum landlock_key_type key_type)
 
 static struct landlock_rule *
 create_rule(const struct landlock_id id,
-	    const struct landlock_layer (*const layers)[], const u32 num_layers,
+	    const struct landlock_layer (*layers)[], const u32 num_layers,
 	    const struct landlock_layer *const new_layer)
 {
 	struct landlock_rule *new_rule;
@@ -206,7 +206,7 @@ static void build_check_ruleset(void)
  */
 static int insert_rule(struct landlock_ruleset *const ruleset,
 		       const struct landlock_id id,
-		       const struct landlock_layer (*const layers)[],
+		       const struct landlock_layer (*layers)[],
 		       const size_t num_layers)
 {
 	struct rb_node **walker_node;
Signature · 1 line
2.53.0
Reviewed-by on v2 1/1
#1 lore raw
Quoted 49 lines · Mickaël Salaün

The insert_rule() and create_rule() functions take a pointer-to-flexible-array parameter declared as:

const struct landlock_layer (*const layers)[]

The kernel-doc parser cannot handle a qualifier between * and the parameter name in this syntax, producing spurious "Invalid param" and "not described" warnings.

Remove the const qualifier of the "layers" argument to avoid this parsing issue.

Cc Günther Noack <[email protected]>
Cc Jonathan Corbet <[email protected]>

---

Changes since v1:
https://lore.kernel.org/r/[email protected]
- Remove const instead of using a typedef (suggested by Günther).

---
 security/landlock/ruleset.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
security/landlock/ruleset.c +2 -2
index 3234a5bc11ff..181df7736bb9 100644
@@ -107,7 +107,7 @@ static bool is_object_pointer(const enum landlock_key_type key_type)
 
 static struct landlock_rule *
 create_rule(const struct landlock_id id,
-	    const struct landlock_layer (*const layers)[], const u32 num_layers,
+	    const struct landlock_layer (*layers)[], const u32 num_layers,
 	    const struct landlock_layer *const new_layer)
 {
 	struct landlock_rule *new_rule;
@@ -206,7 +206,7 @@ static void build_check_ruleset(void)
  */
 static int insert_rule(struct landlock_ruleset *const ruleset,
 		       const struct landlock_id id,
-		       const struct landlock_layer (*const layers)[],
+		       const struct landlock_layer (*layers)[],
 		       const size_t num_layers)
 {
 	struct rb_node **walker_node;
Signature · 1 line
2.53.0