Skip to contentSkip to conversation

docs: ignore __counted_by attribute in structure definitions

PATCH New Jonathan Corbet 1 participant 1 message Dec 19, 2023 Documentation

lore
Share & tools
lore

Jonathan Corbet

author maintainer
#0 lore raw

PATCH 1/1 docs: ignore __counted_by attribute in structure definitions

kernel-doc appeared to ignore __counted_by, but appearances can be deceiving; it caused member names to not be recognized, which manifested as a number of spurious "Excess struct member" warnings. Filter that attribute out and reduce the warning onslaught slightly.

---
 scripts/kernel-doc | 1 +
 1 file changed, 1 insertion(+)
scripts/kernel-doc +1 -0
index df158c3a9abc..6acc39c56ac3 100755
@@ -1143,6 +1143,7 @@ sub dump_struct($$) {
 	# strip attributes
 	$members =~ s/\s*$attribute/ /gi;
 	$members =~ s/\s*__aligned\s*\([^;]*\)/ /gos;
+	$members =~ s/\s*__counted_by\s*\([^;]*\)/ /gos;
 	$members =~ s/\s*__packed\s*/ /gos;
 	$members =~ s/\s*CRYPTO_MINALIGN_ATTR/ /gos;
 	$members =~ s/\s*____cacheline_aligned_in_smp/ /gos;
Signature · 1 line
2.43.0