]> pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[MIPS] 0 -> NULL
authorYoann Padioleau <padator@wanadoo.fr>
Fri, 27 Jul 2007 09:45:00 +0000 (11:45 +0200)
committerRalf Baechle <ralf@linux-mips.org>
Tue, 31 Jul 2007 20:35:22 +0000 (21:35 +0100)
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

Signed-off-by: Yoann Padioleau <padator@wanadoo.fr>
Cc: ralf@linux-mips.org
Cc: linux-mips@linux-mips.org
Cc: akpm@linux-foundation.org
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/pci/ops-emma2rh.c
arch/mips/pci/ops-pnx8550.c

index 38f181625e109715bc1fed265a23de95ae8d4577..d31bfc6d4150fd43195345d258147e3f5f6c849e 100644 (file)
@@ -45,7 +45,7 @@ static int check_args(struct pci_bus *bus, u32 devfn, u32 * bus_num)
        /* check if the bus is top-level */
        if (bus->parent != NULL) {
                *bus_num = bus->number;
-               db_assert(bus_num != 0);
+               db_assert(bus_num != NULL);
        } else
                *bus_num = 0;
 
index f556b7a8dccdd29318aaaedf855f2704a7ca90bf..d6106465249830907fdff82239f25dc388b9ba8e 100644 (file)
@@ -117,7 +117,7 @@ read_config_byte(struct pci_bus *bus, unsigned int devfn, int where, u8 * val)
        unsigned int data = 0;
        int err;
 
-       if (bus == 0)
+       if (bus == NULL)
                return -1;
 
        err = config_access(PCI_CMD_CONFIG_READ, bus, devfn, where, ~(1 << (where & 3)), &data);
@@ -145,7 +145,7 @@ read_config_word(struct pci_bus *bus, unsigned int devfn, int where, u16 * val)
        unsigned int data = 0;
        int err;
 
-       if (bus == 0)
+       if (bus == NULL)
                return -1;
 
        if (where & 0x01)
@@ -168,7 +168,7 @@ static int
 read_config_dword(struct pci_bus *bus, unsigned int devfn, int where, u32 * val)
 {
        int err;
-       if (bus == 0)
+       if (bus == NULL)
                return -1;
 
        if (where & 0x03)
@@ -185,7 +185,7 @@ write_config_byte(struct pci_bus *bus, unsigned int devfn, int where, u8 val)
        unsigned int data = (unsigned int)val;
        int err;
 
-       if (bus == 0)
+       if (bus == NULL)
                return -1;
 
        switch (where & 0x03) {
@@ -213,7 +213,7 @@ write_config_word(struct pci_bus *bus, unsigned int devfn, int where, u16 val)
        unsigned int data = (unsigned int)val;
        int err;
 
-       if (bus == 0)
+       if (bus == NULL)
                return -1;
 
        if (where & 0x01)
@@ -235,7 +235,7 @@ static int
 write_config_dword(struct pci_bus *bus, unsigned int devfn, int where, u32 val)
 {
        int err;
-       if (bus == 0)
+       if (bus == NULL)
                return -1;
 
        if (where & 0x03)