diff options
author | Sean Anderson <seanga2@gmail.com> | 2020-10-27 19:55:24 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-10-30 10:55:26 -0400 |
commit | 3102c1d2c21762889e90ec68fd0b3ce5209528a6 (patch) | |
tree | 0552360a844afea05747f7c269a9a67f19f03a53 /common | |
parent | c3a5459985ae7bbb73626d3914dbda63554e777f (diff) | |
download | u-boot-3102c1d2c21762889e90ec68fd0b3ce5209528a6.tar.gz |
log: Expose some helper functions
These functions are required by "cmd: log: Add commands to manipulate
filters" and "test: Add a test for log filter-*".
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common')
-rw-r--r-- | common/log.c | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/common/log.c b/common/log.c index 47bb9b544e..c5de99a8d1 100644 --- a/common/log.c +++ b/common/log.c @@ -99,7 +99,7 @@ enum log_level_t log_get_level_by_name(const char *name) return LOGL_NONE; } -static struct log_device *log_device_find_by_name(const char *drv_name) +struct log_device *log_device_find_by_name(const char *drv_name) { struct log_device *ldev; @@ -111,15 +111,7 @@ static struct log_device *log_device_find_by_name(const char *drv_name) return NULL; } -/** - * log_has_cat() - check if a log category exists within a list - * - * @cat_list: List of categories to check, at most LOGF_MAX_CATEGORIES entries - * long, terminated by LC_END if fewer - * @cat: Category to search for - * @return true if @cat is in @cat_list, else false - */ -static bool log_has_cat(enum log_category_t cat_list[], enum log_category_t cat) +bool log_has_cat(enum log_category_t cat_list[], enum log_category_t cat) { int i; @@ -131,16 +123,7 @@ static bool log_has_cat(enum log_category_t cat_list[], enum log_category_t cat) return false; } -/** - * log_has_file() - check if a file is with a list - * - * @file_list: List of files to check, separated by comma - * @file: File to check for. This string is matched against the end of each - * file in the list, i.e. ignoring any preceding path. The list is - * intended to consist of relative pathnames, e.g. common/main.c,cmd/log.c - * @return true if @file is in @file_list, else false - */ -static bool log_has_file(const char *file_list, const char *file) +bool log_has_file(const char *file_list, const char *file) { int file_len = strlen(file); const char *s, *p; |