Skip to content

Commit

Permalink
lib/percpu-refcount.c: use a more common logging style
Browse files Browse the repository at this point in the history
Remove the trailing newline from the used-once pr_fmt and add it to the
single use of pr_<level> in this code to use a more common logging style.

Miscellanea:

o Use %lu in the pr_debug format and remove the unnecessary cast

Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Cc: Christophe JAILLET <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
JoePerches authored and torvalds committed Jun 5, 2020
1 parent acaab73 commit a818e52
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/percpu-refcount.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-2.0-only
#define pr_fmt(fmt) "%s: " fmt "\n", __func__
#define pr_fmt(fmt) "%s: " fmt, __func__

#include <linux/kernel.h>
#include <linux/sched.h>
Expand Down Expand Up @@ -141,8 +141,8 @@ static void percpu_ref_switch_to_atomic_rcu(struct rcu_head *rcu)
for_each_possible_cpu(cpu)
count += *per_cpu_ptr(percpu_count, cpu);

pr_debug("global %ld percpu %ld",
atomic_long_read(&ref->count), (long)count);
pr_debug("global %lu percpu %lu\n",
atomic_long_read(&ref->count), count);

/*
* It's crucial that we sum the percpu counters _before_ adding the sum
Expand Down

0 comments on commit a818e52

Please sign in to comment.