CC: [email protected]
TO: Huacai Chen <[email protected]>
CC: Thomas Bogendoerfer <[email protected]>
CC: [email protected]
CC: [email protected]

From: kernel test robot <[email protected]>

arch/mips/kernel/topology.c:23:22-23: ERROR: iterator variable bound on line 20 
cannot be NULL

 Many iterators have the property that the first argument is always bound
 to a real list element, never NULL.

Semantic patch information:
 False positives arise for some iterators that do not have this property,
 or in cases when the loop cursor is reassigned.  The latter should only
 happen when the matched code is on the way to a loop exit (break, goto,
 or return).

Generated by: scripts/coccinelle/iterators/itnull.cocci

Fixes: 9cce844abf07 ("MIPS: CPU#0 is not hotpluggable")
CC: Huacai Chen <[email protected]>
Signed-off-by: kernel test robot <[email protected]>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 
master
head:   04b4571786305a76ad81757bbec78eb16a5de582
commit: 9cce844abf07b683cff5f0273977d5f8d0af94c7 [10966/12711] MIPS: CPU#0 is 
not hotpluggable
:::::: branch date: 14 hours ago
:::::: commit date: 4 days ago

Please take the patch only if it's a positive warning. Thanks!

 topology.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/mips/kernel/topology.c
+++ b/arch/mips/kernel/topology.c
@@ -20,7 +20,7 @@ static int __init topology_init(void)
        for_each_present_cpu(i) {
                struct cpu *c = &per_cpu(cpu_devices, i);
 
-               c->hotpluggable = !!i;
+               c->hotpluggable = !BAD(!i);
                ret = register_cpu(c, i);
                if (ret)
                        printk(KERN_WARNING "topology_init: register_cpu %d "
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to