Skip to content

Commit a1cc5bc

Browse files
Peter Zijlstraingomolnar
authored andcommitted
locking/atomics: Flip atomic_fetch_or() arguments
All the atomic operations have their arguments the wrong way around; make atomic_fetch_or() consistent and flip them. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent b96bbdd commit a1cc5bc

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎include/linux/atomic.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -560,11 +560,11 @@ static inline int atomic_dec_if_positive(atomic_t *v)
560560

561561
/**
562562
* atomic_fetch_or - perform *p |= mask and return old value of *p
563-
* @p: pointer to atomic_t
564563
* @mask: mask to OR on the atomic_t
564+
* @p: pointer to atomic_t
565565
*/
566566
#ifndef atomic_fetch_or
567-
static inline int atomic_fetch_or(atomic_t *p, int mask)
567+
static inline int atomic_fetch_or(int mask, atomic_t *p)
568568
{
569569
int old, val = atomic_read(p);
570570

‎kernel/time/tick-sched.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ static void tick_nohz_dep_set_all(atomic_t *dep,
262262
{
263263
int prev;
264264

265-
prev = atomic_fetch_or(dep, BIT(bit));
265+
prev = atomic_fetch_or(BIT(bit), dep);
266266
if (!prev)
267267
tick_nohz_full_kick_all();
268268
}
@@ -292,7 +292,7 @@ void tick_nohz_dep_set_cpu(int cpu, enum tick_dep_bits bit)
292292

293293
ts = per_cpu_ptr(&tick_cpu_sched, cpu);
294294

295-
prev = atomic_fetch_or(&ts->tick_dep_mask, BIT(bit));
295+
prev = atomic_fetch_or(BIT(bit), &ts->tick_dep_mask);
296296
if (!prev) {
297297
preempt_disable();
298298
/* Perf needs local kick that is NMI safe */

0 commit comments

Comments
 (0)