Skip to content

Commit

Permalink
gcov-clang-support-checkpatch-fixes
Browse files Browse the repository at this point in the history
WARNING: Non-standard signature: Co-authored-by:
torvalds#31:
Co-authored-by: Nick Desaulniers <ndesaulniers@google.com>

WARNING: Non-standard signature: Co-authored-by:
torvalds#32:
Co-authored-by: Tri Vo <trong@android.com>

WARNING: Possible unnecessary 'out of memory' message
torvalds#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
torvalds#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
torvalds#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 <danielmentz@google.com>
Cc: Greg Hackmann <ghackmann@android.com>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Peter Oberparleiter <oberpar@linux.ibm.com>
Cc: Petri Gynther <pgynther@google.com>
Cc: Prasad Sodagudi <psodagud@quicinc.com>
Cc: Trilok Soni <tsoni@quicinc.com>
Cc: Tri Vo <trong@android.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
  • Loading branch information
akpm00 authored and sfrothwell committed May 15, 2019
1 parent c5b1cc0 commit f69918d
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions kernel/gcov/clang.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit f69918d

Please sign in to comment.