From a35e2ad0a3527fa6a25c4303868d0a9a2efc7b90 Mon Sep 17 00:00:00 2001 From: roger Date: Tue, 1 Mar 2022 14:56:21 +0800 Subject: [PATCH] blackbox: fix build warning for allmodconfig compile ohos inclusion category: bugfix issue: #I4Q6AR CVE: NA ------------------------------- Signed-off-by: roger --- drivers/staging/blackbox/blackbox_core.c | 18 ------------------ fs/pstore/platform.c | 15 +++++++++------ include/linux/blackbox_storage.h | 2 ++ 3 files changed, 11 insertions(+), 24 deletions(-) diff --git a/drivers/staging/blackbox/blackbox_core.c b/drivers/staging/blackbox/blackbox_core.c index 95ff9dc0231a..a9f0f0cba691 100644 --- a/drivers/staging/blackbox/blackbox_core.c +++ b/drivers/staging/blackbox/blackbox_core.c @@ -467,21 +467,6 @@ static int save_error_log(void *pparam) return 0; } -#ifdef CONFIG_BLACKBOX_DEBUG -static void print_module_ops(void) -{ - struct bbox_ops *temp = NULL; - - bbox_print_info("The following modules have been registered!\n"); - list_for_each_entry(temp, &ops_list, list) { - bbox_print_info("module: %s, dump: %p, reset: %p, get_last_log_info: %p, - save_last_log: %p\n", - temp->ops.module, temp->ops.dump, temp->ops.reset, temp->ops.get_last_log_info, - temp->ops.save_last_log); - } -} -#endif - int bbox_register_module_ops(struct module_ops *ops) { struct bbox_ops *new_ops = NULL; @@ -518,9 +503,6 @@ int bbox_register_module_ops(struct module_ops *ops) bbox_print_info("[%s] is registered successfully!\n", ops->module); list_add_tail(&new_ops->list, &ops_list); spin_unlock_irqrestore(&ops_list_lock, flags); -#ifdef CONFIG_BLACKBOX_DEBUG - print_module_ops(); -#endif return 0; } diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c index 7cb499250c5a..8c1464540c88 100644 --- a/fs/pstore/platform.c +++ b/fs/pstore/platform.c @@ -389,6 +389,7 @@ void pstore_record_init(struct pstore_record *record, #ifdef CONFIG_PSTORE_BLACKBOX #define PSTORE_FLAG "PSTORE" #define CALLSTACK_MAX_ENTRIES 20 +#if defined(CONFIG_PSTORE_BLK) static void dump_stacktrace(char *pbuf, size_t buf_size, bool is_panic) { int i; @@ -427,13 +428,18 @@ static void dump_stacktrace(char *pbuf, size_t buf_size, bool is_panic) memcpy(pbuf + com_len, tmp_buf, stack_len); *(pbuf + buf_size - 1) = '\0'; } +#endif void pstore_blackbox_dump(struct kmsg_dumper *dumper, enum kmsg_dump_reason reason) { #if defined(CONFIG_PSTORE_BLK) - const char *why; - int ret; + const char *why; + int ret; + char *dst; + size_t dst_size; + struct pstore_record record; + struct fault_log_info *pfault_log_info; if (!pstore_blk_ready) return; @@ -453,10 +459,7 @@ void pstore_blackbox_dump(struct kmsg_dumper *dumper, } } - char *dst; - size_t dst_size; - struct pstore_record record; - struct fault_log_info *pfault_log_info = (struct fault_log_info *)psinfo->buf; + pfault_log_info = (struct fault_log_info *)psinfo->buf; memset(pfault_log_info, 0, sizeof(*pfault_log_info)); diff --git a/include/linux/blackbox_storage.h b/include/linux/blackbox_storage.h index ee4e699b07f7..52d67523d71c 100644 --- a/include/linux/blackbox_storage.h +++ b/include/linux/blackbox_storage.h @@ -6,6 +6,8 @@ #ifndef BLACKBOX_STORAGE_H #define BLACKBOX_STORAGE_H +#include + struct reboot_crashlog_storage { int (*storage_log)(void *out, unsigned int outlen); int (*get_log)(void *in, unsigned int inlen); -- Gitee