Skip to contentSkip to conversation

kernel-doc: Add support for __deprecated

PATCH Applied Matthew Wilcox 2 participants 2 messages Apr 27, 2021 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kernel-doc: Add support for __deprecated

The current linux-next tree has a new error:

./Documentation/gpu/drm-mm:445: ./drivers/gpu/drm/drm_prime.c:994: WARNING: Error in declarator or parameters Invalid C declaration: Expecting "(" in parameters. [error at 17]
int __deprecated drm_prime_sg_to_page_array (struct sg_table *sgt, struct page **pages, int max_entries) -----------------^

While we might consider that documenting a deprecated interface is not necessarily best practice, removing the error is easy.

scripts/kernel-doc +1 -0
index 2a85d34fdcd0..4840e748fca8 100755
@@ -1777,6 +1777,7 @@ sub dump_function($$) {
     $prototype =~ s/^noinline +//;
     $prototype =~ s/__init +//;
     $prototype =~ s/__init_or_module +//;
+    $prototype =~ s/__deprecated +//;
     $prototype =~ s/__flatten +//;
     $prototype =~ s/__meminit +//;
     $prototype =~ s/__must_check +//;
maintainer Applied
#1 lore raw
Quoted 17 lines · Matthew Wilcox

The current linux-next tree has a new error:

./Documentation/gpu/drm-mm:445: ./drivers/gpu/drm/drm_prime.c:994: WARNING: Error in declarator or parameters Invalid C declaration: Expecting "(" in parameters. [error at 17]
int __deprecated drm_prime_sg_to_page_array (struct sg_table *sgt, struct page **pages, int max_entries) -----------------^

While we might consider that documenting a deprecated interface is not necessarily best practice, removing the error is easy.

scripts/kernel-doc +0 -0
index 2a85d34fdcd0..4840e748fca8 100755

scripts/kernel-doc sub dump_function($$) { · line 1783

Quoted 7 lines
scripts/kernel-doc +1 -0
@@ -1777,6 +1777,7 @@ sub dump_function($$) {
     $prototype =~ s/^noinline +//;
     $prototype =~ s/__init +//;
     $prototype =~ s/__init_or_module +//;
+    $prototype =~ s/__deprecated +//;
     $prototype =~ s/__flatten +//;
     $prototype =~ s/__meminit +//;
     $prototype =~ s/__must_check +//;

Applied, thanks.

jon