Sparse reports several uses of 0 for pointer arguments and comparisons.
Replace with NULL to better convey the intent. Remove entirely if a
comparison to follow the kernel style of implicit boolean conversions.
Signed-off-by: Benjamin Gray <bgray@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20231011053711.93427-5-bgray@linux.ibm.com
         */
        initialise_paca(&boot_paca, 0);
        fixup_boot_paca(&boot_paca);
-       WARN_ON(local_paca != 0);
+       WARN_ON(local_paca);
        setup_paca(&boot_paca); /* install the paca into registers */
 
        /* -------- printk is now safe to use ------- */
 
        u8 priority;
        struct kvm_ppc_xive_eq kvm_eq;
        int rc;
-       __be32 *qaddr = 0;
+       __be32 *qaddr = NULL;
        struct page *page;
        struct xive_q *q;
        gfn_t gfn;
 
         * update ctgtx.idx as it pretends to output instructions, then we can
         * calculate total size from idx.
         */
-       bpf_jit_build_prologue(0, &cgctx);
+       bpf_jit_build_prologue(NULL, &cgctx);
        addrs[fp->len] = cgctx.idx * 4;
-       bpf_jit_build_epilogue(0, &cgctx);
+       bpf_jit_build_epilogue(NULL, &cgctx);
 
        fixup_len = fp->aux->num_exentries * BPF_FIXUP_LEN * 4;
        extable_len = fp->aux->num_exentries * sizeof(struct exception_table_entry);
 
                        break;
                }
                pcni++;
-       } while (pcni->vbase != 0);
+       } while (pcni->vbase);
 
        if (!flag)
                return -ENODEV;
 
        }
 
        /* Install error handler */
-       if (request_irq(irq, l2c_error_handler, 0, "L2C", 0) < 0) {
+       if (request_irq(irq, l2c_error_handler, 0, "L2C", NULL) < 0) {
                printk(KERN_ERR "Cannot install L2C error handler"
                       ", cache is not enabled\n");
                of_node_put(np);
 
                        continue;
                kmem_cache_free(dtl_cache, pp->dispatch_log);
                pp->dtl_ridx = 0;
-               pp->dispatch_log = 0;
-               pp->dispatch_log_end = 0;
-               pp->dtl_curr = 0;
+               pp->dispatch_log = NULL;
+               pp->dispatch_log_end = NULL;
+               pp->dtl_curr = NULL;
 
                if (time_limit && time_after(jiffies, *time_limit)) {
                        cond_resched();
 {
        kfree(vcpu_associativity);
        kfree(pcpu_associativity);
-       vcpu_associativity = pcpu_associativity = 0;
+       vcpu_associativity = pcpu_associativity = NULL;
 }
 
 static __be32 *__get_cpu_associativity(int cpu, __be32 *cpu_assoc, int flag)