Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • L linux
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • linux
  • Repository
  • linux
  • scripts
  • kernel-doc
Find file BlameHistoryPermalink
  • Jonathan Neuschäfer's avatar
    scripts/kernel-doc: Add support for named variable macro arguments · 43756e34
    Jonathan Neuschäfer authored Nov 07, 2019
    Currently, when kernel-doc encounters a macro with a named variable
    argument[1], such as this:
    
       #define hlist_for_each_entry_rcu(pos, head, member, cond...)
    
    ... it expects the variable argument to be documented as `cond...`,
    rather than `cond`. This is semantically wrong, because the name (as
    used in the macro body) is actually `cond`.
    
    With this patch, kernel-doc will accept the name without dots (`cond`
    in the example above) in doc comments, and warn if the name with dots
    (`cond...`) is used and verbose mode[2] is enabled.
    
    The support for the `cond...` syntax can be removed later, when the
    documentation of all such macros has been switched to the new syntax.
    
    Testing this patch on top of v5.4-rc6, `make htmldocs` shows a few
    changes in log output and HTML output:
    
     1) The following warnings[3] are eliminated:
    
       ./include/linux/rculist.h:374: warning:
            Excess function parameter 'cond' description in 'list_for_each_entry_rcu'
       ./include/linux/rculist.h:651: warning:
            Excess function parameter 'cond' description in 'hlist_for_each_entry_rcu'
    
     2) For list_for_each_entry_rcu and hlist_for_each_entry_rcu, the
        correct description is shown
    
     3) Named variable arguments are shown without dots
    
    [1]: https://gcc.gnu.org/onlinedocs/cpp/Variadic-Macros.html
    [2]: scripts/kernel-doc -v
    [3]: See also https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git/commit/?h=dev&id=5bc4bc0d6153617eabde275285b7b5a8137fdf3c
    
    
    
    Signed-off-by: default avatarJonathan Neuschäfer <j.neuschaefer@gmx.net>
    Tested-by: default avatarPaul E. McKenney <paulmck@kernel.org>
    Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
    43756e34
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7