Repository navigation
Commit 52042e2
scripts: kernel-doc: validate kernel-doc markup with the actual names
Kernel-doc currently expects that the kernel-doc markup to come
just before the function/enum/struct/union/typedef prototype.
Yet, if it find things like:
/**
* refcount_add - add a value to a refcount
* @i: the value to add to the refcount
* @r: the refcount
*/
static inline void __refcount_add(int i, refcount_t *r, int *oldp);
static inline void refcount_add(int i, refcount_t *r);
Kernel-doc will do the wrong thing:
foobar.h:6: warning: Function parameter or member 'oldp' not described in '__refcount_add'
.. c:function:: void __refcount_add (int i, refcount_t *r, int *oldp)
add a value to a refcount
**Parameters**
``int i``
the value to add to the refcount
``refcount_t *r``
the refcount
``int *oldp``
*undescribed*
Basically, it will document "__refcount_add" with the kernel-doc
markup for refcount_add.
If both functions have the same arguments, this won't even
produce any warning!
Add a logic to check if the kernel-doc identifier matches the actual
name of the C function or data structure that will be documented.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/081546f141a496d6cabb99a4adc140444c705e93.1610610937.git.mchehab+huawei@kernel.org
Signed-off-by: Jonathan Corbet <corbet@lwn.net>1 parent 96c0f7c commit 52042e2
1 file changed
Lines changed: 46 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
382 | 382 | | |
383 | 383 | | |
384 | 384 | | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
385 | 388 | | |
386 | 389 | | |
387 | 390 | | |
| |||
1203 | 1206 | | |
1204 | 1207 | | |
1205 | 1208 | | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
1206 | 1214 | | |
1207 | 1215 | | |
1208 | 1216 | | |
| |||
1391 | 1399 | | |
1392 | 1400 | | |
1393 | 1401 | | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
1394 | 1407 | | |
1395 | 1408 | | |
1396 | 1409 | | |
| |||
1451 | 1464 | | |
1452 | 1465 | | |
1453 | 1466 | | |
| 1467 | + | |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
1454 | 1472 | | |
1455 | 1473 | | |
1456 | 1474 | | |
| |||
1477 | 1495 | | |
1478 | 1496 | | |
1479 | 1497 | | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
1480 | 1503 | | |
1481 | 1504 | | |
1482 | 1505 | | |
| |||
1796 | 1819 | | |
1797 | 1820 | | |
1798 | 1821 | | |
| 1822 | + | |
| 1823 | + | |
| 1824 | + | |
| 1825 | + | |
| 1826 | + | |
1799 | 1827 | | |
1800 | 1828 | | |
1801 | 1829 | | |
| |||
1878 | 1906 | | |
1879 | 1907 | | |
1880 | 1908 | | |
| 1909 | + | |
1881 | 1910 | | |
1882 | 1911 | | |
1883 | 1912 | | |
| |||
2041 | 2070 | | |
2042 | 2071 | | |
2043 | 2072 | | |
2044 | | - | |
2045 | 2073 | | |
2046 | 2074 | | |
2047 | 2075 | | |
| |||
2054 | 2082 | | |
2055 | 2083 | | |
2056 | 2084 | | |
2057 | | - | |
2058 | | - | |
| 2085 | + | |
2059 | 2086 | | |
2060 | | - | |
| 2087 | + | |
2061 | 2088 | | |
2062 | 2089 | | |
| 2090 | + | |
| 2091 | + | |
| 2092 | + | |
| 2093 | + | |
| 2094 | + | |
| 2095 | + | |
| 2096 | + | |
| 2097 | + | |
2063 | 2098 | | |
2064 | 2099 | | |
2065 | 2100 | | |
2066 | 2101 | | |
2067 | 2102 | | |
2068 | 2103 | | |
2069 | 2104 | | |
2070 | | - | |
| 2105 | + | |
2071 | 2106 | | |
2072 | 2107 | | |
2073 | 2108 | | |
| |||
2085 | 2120 | | |
2086 | 2121 | | |
2087 | 2122 | | |
2088 | | - | |
2089 | | - | |
2090 | | - | |
2091 | | - | |
2092 | | - | |
2093 | | - | |
2094 | | - | |
2095 | | - | |
2096 | | - | |
2097 | | - | |
| 2123 | + | |
| 2124 | + | |
| 2125 | + | |
| 2126 | + | |
| 2127 | + | |
2098 | 2128 | | |
2099 | 2129 | | |
2100 | 2130 | | |
2101 | | - | |
| 2131 | + | |
2102 | 2132 | | |
2103 | 2133 | | |
2104 | 2134 | | |
| |||
0 commit comments