Skip to contentSkip to conversation

xtensa: fix warning comparing pointer to 0

PATCH Applied Jiapeng Chong 2 participants 2 messages Mar 10, 2021 Tensilica Xtensa port (xtensa)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xtensa: fix warning comparing pointer to 0

Fix the following coccicheck warning:

./arch/xtensa/kernel/pci.c:79:17-18: WARNING comparing pointer to 0.

---
 arch/xtensa/kernel/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/xtensa/kernel/pci.c +1 -1
index 3f32e27..62c900e 100644
@@ -76,7 +76,7 @@ int pci_iobar_pfn(struct pci_dev *pdev, int bar, struct vm_area_struct *vma)
 	struct pci_controller *pci_ctrl = (struct pci_controller*) pdev->sysdata;
 	resource_size_t ioaddr = pci_resource_start(pdev, bar);
 
-	if (pci_ctrl == 0)
+	if (!pci_ctrl)
 		return -EINVAL;		/* should never happen */
 
 	/* Convert to an offset within this PCI controller */
Signature · 1 line
1.8.3.1
maintainer Applied
#1 lore raw
Quoted 10 lines · Jiapeng Chong

Fix the following coccicheck warning:

./arch/xtensa/kernel/pci.c:79:17-18: WARNING comparing pointer to 0.

---
 arch/xtensa/kernel/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Thanks, applied to my xtensa tree.

Signature · 2 lines
Thanks.
-- Max