Skip to contentSkip to conversation

0 -> NULL, for arch/m68knommu

PATCH Applied Yoann Padioleau 2 participants 2 messages Jul 27, 2007 – Jul 30, 2007 Kernel janitors

lore
Share & tools
lore
#0 lore raw

PATCH 9/68 0 -> NULL, for arch/m68knommu

When comparing a pointer, it's clearer to compare it to NULL than to 0.

Here is an excerpt of the semantic patch:

@@
expression *E;
@@

E =
- 0
+ NULL

@@
expression *E;
@@

E !- 0
+ NULL

---

 comempci.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/m68knommu/kernel/comempci.c +1 -1
index 6ee00ef..528517e 100644
@@ -736,7 +736,7 @@ #endif
 
 	/* Find a free spot to put this handler */
 	for (i = 0; (i < COMEM_MAXPCI); i++) {
-		if (pci_irqlist[i].handler = 0) {
+		if (pci_irqlist[i].handler = NULL) {
 			pci_irqlist[i].handler = handler;
 			pci_irqlist[i].device = device;
 			pci_irqlist[i].dev_id = dev_id;
Acked-by on v1 9/68
#1 lore raw

Hi Yoann,

Quoted 4 lines · Yoann Padioleau

When comparing a pointer, it's clearer to compare it to NULL than to 0.

Quoted 21 lines

---

 comempci.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/m68knommu/kernel/comempci.c +1 -1
index 6ee00ef..528517e 100644
@@ -736,7 +736,7 @@ #endif
 
 	/* Find a free spot to put this handler */
 	for (i = 0; (i < COMEM_MAXPCI); i++) {
-		if (pci_irqlist[i].handler = 0) {
+		if (pci_irqlist[i].handler = NULL) {
 			pci_irqlist[i].handler = handler;
 			pci_irqlist[i].device = device;
 			pci_irqlist[i].dev_id = dev_id;
Signature · 5 lines
------------------------------------------------------------------------
Greg Ungerer  --  Chief Software Dude       EMAIL:     [email protected]
Secure Computing Corporation                PHONE:       +61 7 3435 2888
825 Stanley St,                             FAX:         +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia         WEB: http://www.SnapGear.com