On Thu, Mar 31, 2022 at 02:56:28PM -0700, Saul Wold wrote:
This adds support to depmod to enable a new exclude directive in the depmod.d/*.conf configuration file. Currently depmod already excludes directories named source or build. This change will allow additional directories like .debug to be excluded also via a new exclude directive. depmod.d/exclude.conf example: exclude .debug Upstream-Status: Submitted Signed-off-by: Saul Wold <saul.wold@xxxxxxxxxxxxx>
tools/depmod.c: In function ‘depmod_modules_search_dir’: tools/depmod.c:1302:46: warning: passing argument 1 of ‘should_exclude_dir’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] 1302 | if (should_exclude_dir(depmod->cfg, name)) | ~~~~~~^~~~~ tools/depmod.c:1273:43: note: expected ‘struct cfg *’ but argument is of type ‘const struct cfg *’ 1273 | static int should_exclude_dir(struct cfg *cfg, char *name) | ~~~~~~~~~~~~^~~ tools/depmod.c:1302:53: warning: passing argument 2 of ‘should_exclude_dir’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] 1302 | if (should_exclude_dir(depmod->cfg, name)) | ^~~~ tools/depmod.c:1273:54: note: expected ‘char *’ but argument is of type ‘const char *’ 1273 | static int should_exclude_dir(struct cfg *cfg, char *name) | ~~~~~~^~~~ I fixed the warnings and changed should_exclude_dir() to return bool. Applied, thanks. Lucas De Marchi