• Randy Dunlap's avatar
    kernel-doc: fix declaration type determination · cf419d54
    Randy Dunlap authored
    Make declaration type determination more robust.
    
    When scripts/kernel-doc is deciding if some kernel-doc notation
    contains an enum, a struct, a union, a typedef, or a function,
    it does a pattern match on the beginning of the string, looking
    for a match with one of "struct", "union", "enum", or "typedef",
    and otherwise defaults to a function declaration type.
    However, if a function or a function-like macro has a name that
    begins with "struct" (e.g., struct_size()), then kernel-doc
    incorrectly decides that this is a struct declaration.
    
    Fix this by looking for the declaration type keywords having an
    ending word boundary (\b), so that "struct_size" will not match
    a struct declaration.
    
    I compared lots of html before/after output from core-api, driver-api,
    and networking.  There were no differences in any of the files that
    I checked.
    Signed-off-by: 's avatarRandy Dunlap <rdunlap@infradead.org>
    Acked-by: 's avatarJani Nikula <jani.nikula@intel.com>
    Tested-by: 's avatarKees Cook <keescook@chromium.org>
    Signed-off-by: 's avatarJonathan Corbet <corbet@lwn.net>
    cf419d54
kernel-doc 60.6 KB