Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'for-4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/dennis/percpu

Pull percpu fixes from Dennis Zhou:
"Two small things for v4.20.

The first fixes a clang uninitialized variable warning for arm64 in
the default path calls BUILD_BUG(). The second removes an unnecessary
unlikely() in a WARN_ON() use"

* 'for-4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/dennis/percpu:
arm64: percpu: Initialize ret in the default case
mm: percpu: remove unnecessary unlikely()

+4 -1
+3
arch/arm64/include/asm/percpu.h
··· 96 96 : [val] "Ir" (val)); \ 97 97 break; \ 98 98 default: \ 99 + ret = 0; \ 99 100 BUILD_BUG(); \ 100 101 } \ 101 102 \ ··· 126 125 ret = READ_ONCE(*(u64 *)ptr); 127 126 break; 128 127 default: 128 + ret = 0; 129 129 BUILD_BUG(); 130 130 } 131 131 ··· 196 194 : [val] "r" (val)); 197 195 break; 198 196 default: 197 + ret = 0; 199 198 BUILD_BUG(); 200 199 } 201 200
+1 -1
mm/percpu.c
··· 2591 2591 BUG_ON(ai->nr_groups != 1); 2592 2592 upa = ai->alloc_size/ai->unit_size; 2593 2593 nr_g0_units = roundup(num_possible_cpus(), upa); 2594 - if (unlikely(WARN_ON(ai->groups[0].nr_units != nr_g0_units))) { 2594 + if (WARN_ON(ai->groups[0].nr_units != nr_g0_units)) { 2595 2595 pcpu_free_alloc_info(ai); 2596 2596 return -EINVAL; 2597 2597 }