From: Arnaldo Carvalho de Melo Date: Fri, 15 May 2015 18:32:55 +0000 (-0300) Subject: perf machine: Stop accessing atomic_t::counter directly X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=59a51c1dc9fbb3fb4af928b852d7b35df83edd74;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git perf machine: Stop accessing atomic_t::counter directly Use atomic_read(&counter) instead. Cc: Adrian Hunter Cc: Borislav Petkov Cc: David Ahern Cc: Don Zickus Cc: Frederic Weisbecker Cc: Jiri Olsa Cc: Namhyung Kim Cc: Stephane Eranian Link: http://lkml.kernel.org/n/tip-k3hvfvpaut8wp02lzq27muhb@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index 34bf89f7f4f3..daa55910ff28 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c @@ -1311,7 +1311,7 @@ static void __machine__remove_thread(struct machine *machine, struct thread *th, if (machine->last_match == th) machine->last_match = NULL; - BUG_ON(th->refcnt.counter == 0); + BUG_ON(atomic_read(&th->refcnt) == 0); if (lock) pthread_rwlock_wrlock(&machine->threads_lock); rb_erase(&th->rb_node, &machine->threads);