From f69918d99389ac54d44947948cd66388befd40b1 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Fri, 26 Apr 2019 10:28:12 +1000 Subject: [PATCH] gcov-clang-support-checkpatch-fixes WARNING: Non-standard signature: Co-authored-by: #31: Co-authored-by: Nick Desaulniers WARNING: Non-standard signature: Co-authored-by: #32: Co-authored-by: Tri Vo WARNING: Possible unnecessary 'out of memory' message #158: FILE: kernel/gcov/clang.c:90: + if (!info) { + pr_warn_ratelimited("failed to allocate gcov info\n"); WARNING: Possible unnecessary 'out of memory' message #193: FILE: kernel/gcov/clang.c:125: + if (!info) { + pr_warn_ratelimited("failed to allocate gcov function info for %s\n", WARNING: line over 80 characters #546: FILE: kernel/gcov/clang.c:478: + pos += store_gcov_u32(buffer, pos, fi_ptr->cfg_checksum); total: 0 errors, 5 warnings, 663 lines checked NOTE: For some of the reported defects, checkpatch may be able to mechanically convert to the typical style using --fix or --fix-inplace. ./patches/gcov-clang-support.patch has style problems, please review. NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. Please run checkpatch prior to sending patches Cc: Daniel Mentz Cc: Greg Hackmann Cc: Nick Desaulniers Cc: Peter Oberparleiter Cc: Petri Gynther Cc: Prasad Sodagudi Cc: Trilok Soni Cc: Tri Vo Signed-off-by: Andrew Morton Signed-off-by: Stephen Rothwell --- kernel/gcov/clang.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/kernel/gcov/clang.c b/kernel/gcov/clang.c index 125c50397ba243..c94b820a1b62c5 100644 --- a/kernel/gcov/clang.c +++ b/kernel/gcov/clang.c @@ -86,10 +86,8 @@ void llvm_gcov_init(llvm_gcov_callback writeout, llvm_gcov_callback flush) { struct gcov_info *info = kzalloc(sizeof(*info), GFP_KERNEL); - if (!info) { - pr_warn_ratelimited("failed to allocate gcov info\n"); + if (!info) return; - } INIT_LIST_HEAD(&info->head); INIT_LIST_HEAD(&info->functions); @@ -121,11 +119,8 @@ void llvm_gcda_emit_function(u32 ident, const char *function_name, { struct gcov_fn_info *info = kzalloc(sizeof(*info), GFP_KERNEL); - if (!info) { - pr_warn_ratelimited("failed to allocate gcov function info for %s\n", - function_name ?: "UNKNOWN"); + if (!info) return; - } INIT_LIST_HEAD(&info->head); info->ident = ident;