[rcu:rcu/next 116/116] kernel/cpu.c:1833: warning: unused variable 'cpu'

From: kbuild test robot
Date: Wed Jun 21 2017 - 00:07:28 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git rcu/next
head: faeb334286b762ba6b829ad62e3d39a97674bb56
commit: faeb334286b762ba6b829ad62e3d39a97674bb56 [116/116] rcu: Migrate callbacks earlier in the CPU-offline timeline
config: x86_64-randconfig-b0-06210849 (attached as .config)
compiler: gcc-4.4 (Debian 4.4.7-8) 4.4.7
reproduce:
git checkout faeb334286b762ba6b829ad62e3d39a97674bb56
# save the attached .config to linux build tree
make ARCH=x86_64

All warnings (new ones prefixed by >>):

kernel/cpu.c: In function 'boot_cpu_state_init':
>> kernel/cpu.c:1833: warning: unused variable 'cpu'

vim +/cpu +1833 kernel/cpu.c

1817 /* Mark the boot cpu "present", "online" etc for SMP and UP case */
1818 set_cpu_online(cpu, true);
1819 set_cpu_active(cpu, true);
1820 set_cpu_present(cpu, true);
1821 set_cpu_possible(cpu, true);
1822
1823 #ifdef CONFIG_SMP
1824 __boot_cpu_id = cpu;
1825 #endif
1826 }
1827
1828 /*
1829 * Must be called _AFTER_ setting up the per_cpu areas
1830 */
1831 void __init boot_cpu_state_init(void)
1832 {
> 1833 int cpu;
1834
1835 per_cpu_ptr(&cpuhp_state, smp_processor_id())->state = CPUHP_ONLINE;
1836 #ifdef CONFIG_SMP
1837 for_each_possible_cpu(cpu)
1838 per_cpu_ptr(&cpuhp_state, cpu)->cpu = cpu;
1839 #endif
1840 }

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

Attachment: .config.gz
Description: application/gzip