Commit e9a58c69 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] NULL noise removal on ppc

0->NULL in arch/ppc and include/asm-ppc.

[That's it for this series - there's still ~200Kb to merge, but I'd rather
take a break for a couple of hours before dealing with the rest]
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent ee9522f4
...@@ -221,7 +221,7 @@ decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum) ...@@ -221,7 +221,7 @@ decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum)
puts("\n"); puts("\n");
puts("Uncompressing Linux..."); puts("Uncompressing Linux...");
gunzip(0, 0x400000, zimage_start, &zimage_size); gunzip(NULL, 0x400000, zimage_start, &zimage_size);
puts("done.\n"); puts("done.\n");
/* get the bi_rec address */ /* get the bi_rec address */
......
...@@ -106,7 +106,7 @@ void *irq_kmalloc(size_t size, int pri) ...@@ -106,7 +106,7 @@ void *irq_kmalloc(size_t size, int pri)
cache_bitmask |= (1<<i); cache_bitmask |= (1<<i);
return (void *)(&malloc_cache[i]); return (void *)(&malloc_cache[i]);
} }
return 0; return NULL;
} }
void irq_kfree(void *ptr) void irq_kfree(void *ptr)
...@@ -676,7 +676,7 @@ void init_irq_proc (void) ...@@ -676,7 +676,7 @@ void init_irq_proc (void)
int i; int i;
/* create /proc/irq */ /* create /proc/irq */
root_irq_dir = proc_mkdir("irq", 0); root_irq_dir = proc_mkdir("irq", NULL);
/* create /proc/irq/prof_cpu_mask */ /* create /proc/irq/prof_cpu_mask */
entry = create_proc_entry("prof_cpu_mask", 0600, root_irq_dir); entry = create_proc_entry("prof_cpu_mask", 0600, root_irq_dir);
......
...@@ -671,11 +671,11 @@ make_one_node_map(struct device_node* node, u8 pci_bus) ...@@ -671,11 +671,11 @@ make_one_node_map(struct device_node* node, u8 pci_bus)
struct pci_dev* dev; struct pci_dev* dev;
unsigned int *class_code, *reg; unsigned int *class_code, *reg;
class_code = (unsigned int *) get_property(node, "class-code", 0); class_code = (unsigned int *) get_property(node, "class-code", NULL);
if (!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI && if (!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI &&
(*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS)) (*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS))
continue; continue;
reg = (unsigned int *)get_property(node, "reg", 0); reg = (unsigned int *)get_property(node, "reg", NULL);
if (!reg) if (!reg)
continue; continue;
dev = pci_find_slot(pci_bus, ((reg[0] >> 8) & 0xff)); dev = pci_find_slot(pci_bus, ((reg[0] >> 8) & 0xff));
...@@ -712,7 +712,7 @@ pcibios_make_OF_bus_map(void) ...@@ -712,7 +712,7 @@ pcibios_make_OF_bus_map(void)
continue; continue;
make_one_node_map(node, hose->first_busno); make_one_node_map(node, hose->first_busno);
} }
of_prop_map = get_property(find_path_device("/"), "pci-OF-bus-map", 0); of_prop_map = get_property(find_path_device("/"), "pci-OF-bus-map", NULL);
if (of_prop_map) if (of_prop_map)
memcpy(of_prop_map, pci_to_OF_bus_map, pci_bus_count); memcpy(of_prop_map, pci_to_OF_bus_map, pci_bus_count);
#ifdef DEBUG #ifdef DEBUG
...@@ -743,7 +743,7 @@ scan_OF_pci_childs(struct device_node* node, pci_OF_scan_iterator filter, void* ...@@ -743,7 +743,7 @@ scan_OF_pci_childs(struct device_node* node, pci_OF_scan_iterator filter, void*
* a fake root for all functions of a multi-function device, * a fake root for all functions of a multi-function device,
* we go down them as well. * we go down them as well.
*/ */
class_code = (unsigned int *) get_property(node, "class-code", 0); class_code = (unsigned int *) get_property(node, "class-code", NULL);
if ((!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI && if ((!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI &&
(*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS)) && (*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS)) &&
strcmp(node->name, "multifunc-device")) strcmp(node->name, "multifunc-device"))
...@@ -761,7 +761,7 @@ scan_OF_pci_childs_iterator(struct device_node* node, void* data) ...@@ -761,7 +761,7 @@ scan_OF_pci_childs_iterator(struct device_node* node, void* data)
unsigned int *reg; unsigned int *reg;
u8* fdata = (u8*)data; u8* fdata = (u8*)data;
reg = (unsigned int *) get_property(node, "reg", 0); reg = (unsigned int *) get_property(node, "reg", NULL);
if (reg && ((reg[0] >> 8) & 0xff) == fdata[1] if (reg && ((reg[0] >> 8) & 0xff) == fdata[1]
&& ((reg[0] >> 16) & 0xff) == fdata[0]) && ((reg[0] >> 16) & 0xff) == fdata[0])
return 1; return 1;
...@@ -874,7 +874,7 @@ pci_device_from_OF_node(struct device_node* node, u8* bus, u8* devfn) ...@@ -874,7 +874,7 @@ pci_device_from_OF_node(struct device_node* node, u8* bus, u8* devfn)
if (!scan_OF_pci_childs(((struct device_node*)hose->arch_data)->child, if (!scan_OF_pci_childs(((struct device_node*)hose->arch_data)->child,
find_OF_pci_device_filter, (void *)node)) find_OF_pci_device_filter, (void *)node))
return -ENODEV; return -ENODEV;
reg = (unsigned int *) get_property(node, "reg", 0); reg = (unsigned int *) get_property(node, "reg", NULL);
if (!reg) if (!reg)
return -ENODEV; return -ENODEV;
*bus = (reg[0] >> 16) & 0xff; *bus = (reg[0] >> 16) & 0xff;
......
...@@ -234,7 +234,7 @@ mem2hex(const char *mem, char *buf, int count) ...@@ -234,7 +234,7 @@ mem2hex(const char *mem, char *buf, int count)
} else { } else {
/* error condition */ /* error condition */
} }
debugger_fault_handler = 0; debugger_fault_handler = NULL;
*buf = 0; *buf = 0;
return buf; return buf;
} }
...@@ -300,7 +300,7 @@ hex2mem(char *buf, char *mem, int count) ...@@ -300,7 +300,7 @@ hex2mem(char *buf, char *mem, int count)
} else { } else {
/* error condition */ /* error condition */
} }
debugger_fault_handler = 0; debugger_fault_handler = NULL;
return mem; return mem;
} }
...@@ -331,7 +331,7 @@ hexToInt(char **ptr, int *intValue) ...@@ -331,7 +331,7 @@ hexToInt(char **ptr, int *intValue)
} else { } else {
/* error condition */ /* error condition */
} }
debugger_fault_handler = 0; debugger_fault_handler = NULL;
return (numChars); return (numChars);
} }
......
...@@ -479,9 +479,9 @@ void start_thread(struct pt_regs *regs, unsigned long nip, unsigned long sp) ...@@ -479,9 +479,9 @@ void start_thread(struct pt_regs *regs, unsigned long nip, unsigned long sp)
regs->gpr[1] = sp; regs->gpr[1] = sp;
regs->msr = MSR_USER; regs->msr = MSR_USER;
if (last_task_used_math == current) if (last_task_used_math == current)
last_task_used_math = 0; last_task_used_math = NULL;
if (last_task_used_altivec == current) if (last_task_used_altivec == current)
last_task_used_altivec = 0; last_task_used_altivec = NULL;
memset(current->thread.fpr, 0, sizeof(current->thread.fpr)); memset(current->thread.fpr, 0, sizeof(current->thread.fpr));
current->thread.fpscr = 0; current->thread.fpscr = 0;
#ifdef CONFIG_ALTIVEC #ifdef CONFIG_ALTIVEC
......
...@@ -693,7 +693,7 @@ void __init setup_arch(char **cmdline_p) ...@@ -693,7 +693,7 @@ void __init setup_arch(char **cmdline_p)
#ifdef CONFIG_XMON #ifdef CONFIG_XMON
xmon_map_scc(); xmon_map_scc();
if (strstr(cmd_line, "xmon")) if (strstr(cmd_line, "xmon"))
xmon(0); xmon(NULL);
#endif /* CONFIG_XMON */ #endif /* CONFIG_XMON */
if ( ppc_md.progress ) ppc_md.progress("setup_arch: enter", 0x3eab); if ( ppc_md.progress ) ppc_md.progress("setup_arch: enter", 0x3eab);
......
...@@ -72,7 +72,7 @@ fixup_one_level_bus_range(struct device_node *node, int higher) ...@@ -72,7 +72,7 @@ fixup_one_level_bus_range(struct device_node *node, int higher)
int len; int len;
/* For PCI<->PCI bridges or CardBus bridges, we go down */ /* For PCI<->PCI bridges or CardBus bridges, we go down */
class_code = (unsigned int *) get_property(node, "class-code", 0); class_code = (unsigned int *) get_property(node, "class-code", NULL);
if (!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI && if (!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI &&
(*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS)) (*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS))
continue; continue;
...@@ -509,7 +509,7 @@ fixup_nec_usb2(void) ...@@ -509,7 +509,7 @@ fixup_nec_usb2(void)
continue; continue;
if (0x0035 != *prop) if (0x0035 != *prop)
continue; continue;
prop = (u32 *)get_property(nec, "reg", 0); prop = (u32 *)get_property(nec, "reg", NULL);
if (prop == NULL) if (prop == NULL)
continue; continue;
devfn = (prop[0] >> 8) & 0xff; devfn = (prop[0] >> 8) & 0xff;
......
...@@ -444,7 +444,7 @@ void __init pmac_pic_init(void) ...@@ -444,7 +444,7 @@ void __init pmac_pic_init(void)
nmi_irq = pswitch->intrs[0].line; nmi_irq = pswitch->intrs[0].line;
openpic_init_nmi_irq(nmi_irq); openpic_init_nmi_irq(nmi_irq);
request_irq(nmi_irq, xmon_irq, 0, request_irq(nmi_irq, xmon_irq, 0,
"NMI - XMON", 0); "NMI - XMON", NULL);
} }
} }
#endif /* CONFIG_XMON */ #endif /* CONFIG_XMON */
...@@ -542,7 +542,7 @@ void __init pmac_pic_init(void) ...@@ -542,7 +542,7 @@ void __init pmac_pic_init(void)
for ( i = max_real_irqs ; i < max_irqs ; i++ ) for ( i = max_real_irqs ; i < max_irqs ; i++ )
irq_desc[i].handler = &gatwick_pic; irq_desc[i].handler = &gatwick_pic;
request_irq( irq_cascade, gatwick_action, SA_INTERRUPT, request_irq( irq_cascade, gatwick_action, SA_INTERRUPT,
"cascade", 0 ); "cascade", NULL );
} }
printk("System has %d possible interrupts\n", max_irqs); printk("System has %d possible interrupts\n", max_irqs);
if (max_irqs != max_real_irqs) if (max_irqs != max_real_irqs)
...@@ -550,7 +550,7 @@ void __init pmac_pic_init(void) ...@@ -550,7 +550,7 @@ void __init pmac_pic_init(void)
max_real_irqs); max_real_irqs);
#ifdef CONFIG_XMON #ifdef CONFIG_XMON
request_irq(20, xmon_irq, 0, "NMI - XMON", 0); request_irq(20, xmon_irq, 0, "NMI - XMON", NULL);
#endif /* CONFIG_XMON */ #endif /* CONFIG_XMON */
} }
......
...@@ -421,7 +421,7 @@ static void __init smp_psurge_setup_cpu(int cpu_nr) ...@@ -421,7 +421,7 @@ static void __init smp_psurge_setup_cpu(int cpu_nr)
/* reset the entry point so if we get another intr we won't /* reset the entry point so if we get another intr we won't
* try to startup again */ * try to startup again */
out_be32(psurge_start, 0x100); out_be32(psurge_start, 0x100);
if (request_irq(30, psurge_primary_intr, SA_INTERRUPT, "primary IPI", 0)) if (request_irq(30, psurge_primary_intr, SA_INTERRUPT, "primary IPI", NULL))
printk(KERN_ERR "Couldn't get primary IPI interrupt"); printk(KERN_ERR "Couldn't get primary IPI interrupt");
} }
......
...@@ -741,7 +741,7 @@ raven_init(void) ...@@ -741,7 +741,7 @@ raven_init(void)
} }
/* Check the first PCI device to see if it is a Raven. */ /* Check the first PCI device to see if it is a Raven. */
early_read_config_dword(0, 0, 0, PCI_VENDOR_ID, &devid); early_read_config_dword(NULL, 0, 0, PCI_VENDOR_ID, &devid);
switch (devid & 0xffff0000) { switch (devid & 0xffff0000) {
case MPIC_RAVEN_ID: case MPIC_RAVEN_ID:
...@@ -757,7 +757,7 @@ raven_init(void) ...@@ -757,7 +757,7 @@ raven_init(void)
/* Read the memory base register. */ /* Read the memory base register. */
early_read_config_dword(0, 0, 0, PCI_BASE_ADDRESS_1, &pci_membase); early_read_config_dword(NULL, 0, 0, PCI_BASE_ADDRESS_1, &pci_membase);
if (pci_membase == 0) { if (pci_membase == 0) {
OpenPIC_Addr = NULL; OpenPIC_Addr = NULL;
......
...@@ -865,7 +865,7 @@ prep_init_IRQ(void) ...@@ -865,7 +865,7 @@ prep_init_IRQ(void)
irq_desc[i].handler = &i8259_pic; irq_desc[i].handler = &i8259_pic;
/* If we have a Raven PCI bridge or a Hawk PCI bridge / Memory /* If we have a Raven PCI bridge or a Hawk PCI bridge / Memory
* controller, we poll (as they have a different int-ack address). */ * controller, we poll (as they have a different int-ack address). */
early_read_config_dword(0, 0, 0, PCI_VENDOR_ID, &pci_viddid); early_read_config_dword(NULL, 0, 0, PCI_VENDOR_ID, &pci_viddid);
pci_did = (pci_viddid & 0xffff0000) >> 16; pci_did = (pci_viddid & 0xffff0000) >> 16;
if (((pci_viddid & 0xffff) == PCI_VENDOR_ID_MOTOROLA) if (((pci_viddid & 0xffff) == PCI_VENDOR_ID_MOTOROLA)
&& ((pci_did == PCI_DEVICE_ID_MOTOROLA_RAVEN) && ((pci_did == PCI_DEVICE_ID_MOTOROLA_RAVEN)
......
...@@ -802,7 +802,7 @@ PPC_DEVICE __init *residual_find_device(unsigned long BusMask, ...@@ -802,7 +802,7 @@ PPC_DEVICE __init *residual_find_device(unsigned long BusMask,
!(n--) ) return res->Devices+i; !(n--) ) return res->Devices+i;
#undef Dev #undef Dev
} }
return 0; return NULL;
} }
PPC_DEVICE __init *residual_find_device_id(unsigned long BusMask, PPC_DEVICE __init *residual_find_device_id(unsigned long BusMask,
...@@ -824,7 +824,7 @@ PPC_DEVICE __init *residual_find_device_id(unsigned long BusMask, ...@@ -824,7 +824,7 @@ PPC_DEVICE __init *residual_find_device_id(unsigned long BusMask,
!(n--) ) return res->Devices+i; !(n--) ) return res->Devices+i;
#undef Dev #undef Dev
} }
return 0; return NULL;
} }
PnP_TAG_PACKET *PnP_find_packet(unsigned char *p, PnP_TAG_PACKET *PnP_find_packet(unsigned char *p,
...@@ -832,7 +832,7 @@ PnP_TAG_PACKET *PnP_find_packet(unsigned char *p, ...@@ -832,7 +832,7 @@ PnP_TAG_PACKET *PnP_find_packet(unsigned char *p,
int n) int n)
{ {
unsigned mask, masked_tag, size; unsigned mask, masked_tag, size;
if(!p) return 0; if(!p) return NULL;
if (tag_type(packet_tag)) mask=0xff; else mask=0xF8; if (tag_type(packet_tag)) mask=0xff; else mask=0xF8;
masked_tag = packet_tag&mask; masked_tag = packet_tag&mask;
for(; *p != END_TAG; p+=size) { for(; *p != END_TAG; p+=size) {
...@@ -843,7 +843,7 @@ PnP_TAG_PACKET *PnP_find_packet(unsigned char *p, ...@@ -843,7 +843,7 @@ PnP_TAG_PACKET *PnP_find_packet(unsigned char *p,
else else
size=tag_small_count(*p)+1; size=tag_small_count(*p)+1;
} }
return 0; /* not found */ return NULL; /* not found */
} }
PnP_TAG_PACKET __init *PnP_find_small_vendor_packet(unsigned char *p, PnP_TAG_PACKET __init *PnP_find_small_vendor_packet(unsigned char *p,
...@@ -857,7 +857,7 @@ PnP_TAG_PACKET __init *PnP_find_small_vendor_packet(unsigned char *p, ...@@ -857,7 +857,7 @@ PnP_TAG_PACKET __init *PnP_find_small_vendor_packet(unsigned char *p,
return (PnP_TAG_PACKET *) p; return (PnP_TAG_PACKET *) p;
next = 1; next = 1;
}; };
return 0; /* not found */ return NULL; /* not found */
} }
PnP_TAG_PACKET __init *PnP_find_large_vendor_packet(unsigned char *p, PnP_TAG_PACKET __init *PnP_find_large_vendor_packet(unsigned char *p,
...@@ -871,7 +871,7 @@ PnP_TAG_PACKET __init *PnP_find_large_vendor_packet(unsigned char *p, ...@@ -871,7 +871,7 @@ PnP_TAG_PACKET __init *PnP_find_large_vendor_packet(unsigned char *p,
return (PnP_TAG_PACKET *) p; return (PnP_TAG_PACKET *) p;
next = 1; next = 1;
}; };
return 0; /* not found */ return NULL; /* not found */
} }
#ifdef CONFIG_PROC_PREPRESIDUAL #ifdef CONFIG_PROC_PREPRESIDUAL
......
...@@ -579,16 +579,16 @@ void openpic_request_IPIs(void) ...@@ -579,16 +579,16 @@ void openpic_request_IPIs(void)
/* IPIs are marked SA_INTERRUPT as they must run with irqs disabled */ /* IPIs are marked SA_INTERRUPT as they must run with irqs disabled */
request_irq(OPENPIC_VEC_IPI+open_pic_irq_offset, request_irq(OPENPIC_VEC_IPI+open_pic_irq_offset,
openpic_ipi_action, SA_INTERRUPT, openpic_ipi_action, SA_INTERRUPT,
"IPI0 (call function)", 0); "IPI0 (call function)", NULL);
request_irq(OPENPIC_VEC_IPI+open_pic_irq_offset+1, request_irq(OPENPIC_VEC_IPI+open_pic_irq_offset+1,
openpic_ipi_action, SA_INTERRUPT, openpic_ipi_action, SA_INTERRUPT,
"IPI1 (reschedule)", 0); "IPI1 (reschedule)", NULL);
request_irq(OPENPIC_VEC_IPI+open_pic_irq_offset+2, request_irq(OPENPIC_VEC_IPI+open_pic_irq_offset+2,
openpic_ipi_action, SA_INTERRUPT, openpic_ipi_action, SA_INTERRUPT,
"IPI2 (invalidate tlb)", 0); "IPI2 (invalidate tlb)", NULL);
request_irq(OPENPIC_VEC_IPI+open_pic_irq_offset+3, request_irq(OPENPIC_VEC_IPI+open_pic_irq_offset+3,
openpic_ipi_action, SA_INTERRUPT, openpic_ipi_action, SA_INTERRUPT,
"IPI3 (xmon break)", 0); "IPI3 (xmon break)", NULL);
for ( i = 0; i < OPENPIC_NUM_IPI ; i++ ) for ( i = 0; i < OPENPIC_NUM_IPI ; i++ )
openpic_enable_ipi(OPENPIC_VEC_IPI+open_pic_irq_offset+i); openpic_enable_ipi(OPENPIC_VEC_IPI+open_pic_irq_offset+i);
......
...@@ -126,7 +126,7 @@ finish_device_tree(void) ...@@ -126,7 +126,7 @@ finish_device_tree(void)
/* All newworld pmac machines and CHRPs now use the interrupt tree */ /* All newworld pmac machines and CHRPs now use the interrupt tree */
for (np = allnodes; np != NULL; np = np->allnext) { for (np = allnodes; np != NULL; np = np->allnext) {
if (get_property(np, "interrupt-parent", 0)) { if (get_property(np, "interrupt-parent", NULL)) {
use_of_interrupt_tree = 1; use_of_interrupt_tree = 1;
break; break;
} }
...@@ -181,8 +181,8 @@ finish_node(struct device_node *np, unsigned long mem_start, ...@@ -181,8 +181,8 @@ finish_node(struct device_node *np, unsigned long mem_start,
struct device_node *child; struct device_node *child;
int *ip; int *ip;
np->name = get_property(np, "name", 0); np->name = get_property(np, "name", NULL);
np->type = get_property(np, "device_type", 0); np->type = get_property(np, "device_type", NULL);
if (!np->name) if (!np->name)
np->name = "<NULL>"; np->name = "<NULL>";
...@@ -197,10 +197,10 @@ finish_node(struct device_node *np, unsigned long mem_start, ...@@ -197,10 +197,10 @@ finish_node(struct device_node *np, unsigned long mem_start,
mem_start = finish_node_interrupts(np, mem_start); mem_start = finish_node_interrupts(np, mem_start);
/* Look for #address-cells and #size-cells properties. */ /* Look for #address-cells and #size-cells properties. */
ip = (int *) get_property(np, "#address-cells", 0); ip = (int *) get_property(np, "#address-cells", NULL);
if (ip != NULL) if (ip != NULL)
naddrc = *ip; naddrc = *ip;
ip = (int *) get_property(np, "#size-cells", 0); ip = (int *) get_property(np, "#size-cells", NULL);
if (ip != NULL) if (ip != NULL)
nsizec = *ip; nsizec = *ip;
...@@ -501,7 +501,7 @@ prom_n_addr_cells(struct device_node* np) ...@@ -501,7 +501,7 @@ prom_n_addr_cells(struct device_node* np)
do { do {
if (np->parent) if (np->parent)
np = np->parent; np = np->parent;
ip = (int *) get_property(np, "#address-cells", 0); ip = (int *) get_property(np, "#address-cells", NULL);
if (ip != NULL) if (ip != NULL)
return *ip; return *ip;
} while (np->parent); } while (np->parent);
...@@ -516,7 +516,7 @@ prom_n_size_cells(struct device_node* np) ...@@ -516,7 +516,7 @@ prom_n_size_cells(struct device_node* np)
do { do {
if (np->parent) if (np->parent)
np = np->parent; np = np->parent;
ip = (int *) get_property(np, "#size-cells", 0); ip = (int *) get_property(np, "#size-cells", NULL);
if (ip != NULL) if (ip != NULL)
return *ip; return *ip;
} while (np->parent); } while (np->parent);
...@@ -836,7 +836,7 @@ find_devices(const char *name) ...@@ -836,7 +836,7 @@ find_devices(const char *name)
prevp = &np->next; prevp = &np->next;
} }
} }
*prevp = 0; *prevp = NULL;
return head; return head;
} }
...@@ -855,7 +855,7 @@ find_type_devices(const char *type) ...@@ -855,7 +855,7 @@ find_type_devices(const char *type)
prevp = &np->next; prevp = &np->next;
} }
} }
*prevp = 0; *prevp = NULL;
return head; return head;
} }
...@@ -872,7 +872,7 @@ find_all_nodes(void) ...@@ -872,7 +872,7 @@ find_all_nodes(void)
*prevp = np; *prevp = np;
prevp = &np->next; prevp = &np->next;
} }
*prevp = 0; *prevp = NULL;
return head; return head;
} }
...@@ -934,7 +934,7 @@ find_compatible_devices(const char *type, const char *compat) ...@@ -934,7 +934,7 @@ find_compatible_devices(const char *type, const char *compat)
prevp = &np->next; prevp = &np->next;
} }
} }
*prevp = 0; *prevp = NULL;
return head; return head;
} }
...@@ -1159,7 +1159,7 @@ get_property(struct device_node *np, const char *name, int *lenp) ...@@ -1159,7 +1159,7 @@ get_property(struct device_node *np, const char *name, int *lenp)
*lenp = pp->length; *lenp = pp->length;
return pp->value; return pp->value;
} }
return 0; return NULL;
} }
/* /*
......
...@@ -111,15 +111,15 @@ static void prom_instantiate_rtas(void); ...@@ -111,15 +111,15 @@ static void prom_instantiate_rtas(void);
static void * early_get_property(unsigned long base, unsigned long node, static void * early_get_property(unsigned long base, unsigned long node,
char *prop); char *prop);
prom_entry prom __initdata = 0; prom_entry prom __initdata;
ihandle prom_chosen __initdata = 0; ihandle prom_chosen __initdata;
ihandle prom_stdout __initdata = 0; ihandle prom_stdout __initdata;
char *prom_display_paths[FB_MAX] __initdata = { 0, }; char *prom_display_paths[FB_MAX] __initdata;
phandle prom_display_nodes[FB_MAX] __initdata; phandle prom_display_nodes[FB_MAX] __initdata;
unsigned int prom_num_displays __initdata = 0; unsigned int prom_num_displays __initdata;
char *of_stdout_device __initdata = 0; char *of_stdout_device __initdata;
static ihandle prom_disp_node __initdata = 0; static ihandle prom_disp_node __initdata;
unsigned int rtas_data; /* physical pointer */ unsigned int rtas_data; /* physical pointer */
unsigned int rtas_entry; /* physical pointer */ unsigned int rtas_entry; /* physical pointer */
...@@ -161,7 +161,7 @@ call_prom(const char *service, int nargs, int nret, ...) ...@@ -161,7 +161,7 @@ call_prom(const char *service, int nargs, int nret, ...)
prom_args.args[i] = va_arg(list, void *); prom_args.args[i] = va_arg(list, void *);
va_end(list); va_end(list);
for (i = 0; i < nret; ++i) for (i = 0; i < nret; ++i)
prom_args.args[i + nargs] = 0; prom_args.args[i + nargs] = NULL;
prom(&prom_args); prom(&prom_args);
return prom_args.args[nargs]; return prom_args.args[nargs];
} }
...@@ -181,7 +181,7 @@ call_prom_ret(const char *service, int nargs, int nret, void **rets, ...) ...@@ -181,7 +181,7 @@ call_prom_ret(const char *service, int nargs, int nret, void **rets, ...)
prom_args.args[i] = va_arg(list, void *); prom_args.args[i] = va_arg(list, void *);
va_end(list); va_end(list);
for (i = 0; i < nret; ++i) for (i = 0; i < nret; ++i)
prom_args.args[i + nargs] = 0; prom_args.args[i + nargs] = NULL;
prom(&prom_args); prom(&prom_args);
for (i = 1; i < nret; ++i) for (i = 1; i < nret; ++i)
rets[i-1] = prom_args.args[nargs + i]; rets[i-1] = prom_args.args[nargs + i];
...@@ -363,9 +363,9 @@ check_display(unsigned long mem) ...@@ -363,9 +363,9 @@ check_display(unsigned long mem)
}; };
const unsigned char *clut; const unsigned char *clut;
prom_disp_node = 0; prom_disp_node = NULL;
for (node = 0; prom_next_node(&node); ) { for (node = NULL; prom_next_node(&node); ) {
type[0] = 0; type[0] = 0;
call_prom("getprop", 4, 1, node, "device_type", call_prom("getprop", 4, 1, node, "device_type",
type, sizeof(type)); type, sizeof(type));
...@@ -546,8 +546,8 @@ copy_device_tree(unsigned long mem_start, unsigned long mem_end) ...@@ -546,8 +546,8 @@ copy_device_tree(unsigned long mem_start, unsigned long mem_end)
} }
allnextp = &allnodes; allnextp = &allnodes;
mem_start = ALIGNUL(mem_start); mem_start = ALIGNUL(mem_start);
new_start = inspect_node(root, 0, mem_start, mem_end, &allnextp); new_start = inspect_node(root, NULL, mem_start, mem_end, &allnextp);
*allnextp = 0; *allnextp = NULL;
return new_start; return new_start;
} }
...@@ -695,7 +695,7 @@ prom_hold_cpus(unsigned long mem) ...@@ -695,7 +695,7 @@ prom_hold_cpus(unsigned long mem)
/* look for cpus */ /* look for cpus */
*(unsigned long *)(0x0) = 0; *(unsigned long *)(0x0) = 0;
asm volatile("dcbf 0,%0": : "r" (0) : "memory"); asm volatile("dcbf 0,%0": : "r" (0) : "memory");
for (node = 0; prom_next_node(&node); ) { for (node = NULL; prom_next_node(&node); ) {
type[0] = 0; type[0] = 0;
call_prom("getprop", 4, 1, node, "device_type", call_prom("getprop", 4, 1, node, "device_type",
type, sizeof(type)); type, sizeof(type));
...@@ -888,7 +888,7 @@ prom_init(int r3, int r4, prom_entry pp) ...@@ -888,7 +888,7 @@ prom_init(int r3, int r4, prom_entry pp)
prom_print("returning 0x"); prom_print("returning 0x");
prom_print_hex(phys); prom_print_hex(phys);
prom_print("from prom_init\n"); prom_print("from prom_init\n");
prom_stdout = 0; prom_stdout = NULL;
return phys; return phys;
} }
...@@ -910,7 +910,7 @@ early_get_property(unsigned long base, unsigned long node, char *prop) ...@@ -910,7 +910,7 @@ early_get_property(unsigned long base, unsigned long node, char *prop)
return (void *)((unsigned long)pp->value + base); return (void *)((unsigned long)pp->value + base);
} }
} }
return 0; return NULL;
} }
/* Is boot-info compatible ? */ /* Is boot-info compatible ? */
...@@ -928,7 +928,7 @@ bootx_init(unsigned long r4, unsigned long phys) ...@@ -928,7 +928,7 @@ bootx_init(unsigned long r4, unsigned long phys)
boot_infos = PTRUNRELOC(bi); boot_infos = PTRUNRELOC(bi);
if (!BOOT_INFO_IS_V2_COMPATIBLE(bi)) if (!BOOT_INFO_IS_V2_COMPATIBLE(bi))
bi->logicalDisplayBase = 0; bi->logicalDisplayBase = NULL;
#ifdef CONFIG_BOOTX_TEXT #ifdef CONFIG_BOOTX_TEXT
btext_init(bi); btext_init(bi);
......
...@@ -82,12 +82,12 @@ const struct powerpc_operand powerpc_operands[] = ...@@ -82,12 +82,12 @@ const struct powerpc_operand powerpc_operands[] =
/* The zero index is used to indicate the end of the list of /* The zero index is used to indicate the end of the list of
operands. */ operands. */
#define UNUSED (0) #define UNUSED (0)
{ 0, 0, 0, 0, 0 }, { 0, 0, NULL, NULL, 0 },
/* The BA field in an XL form instruction. */ /* The BA field in an XL form instruction. */
#define BA (1) #define BA (1)
#define BA_MASK (0x1f << 16) #define BA_MASK (0x1f << 16)
{ 5, 16, 0, 0, PPC_OPERAND_CR }, { 5, 16, NULL, NULL, PPC_OPERAND_CR },
/* The BA field in an XL form instruction when it must be the same /* The BA field in an XL form instruction when it must be the same
as the BT field in the same instruction. */ as the BT field in the same instruction. */
...@@ -97,7 +97,7 @@ const struct powerpc_operand powerpc_operands[] = ...@@ -97,7 +97,7 @@ const struct powerpc_operand powerpc_operands[] =
/* The BB field in an XL form instruction. */ /* The BB field in an XL form instruction. */
#define BB (3) #define BB (3)
#define BB_MASK (0x1f << 11) #define BB_MASK (0x1f << 11)
{ 5, 11, 0, 0, PPC_OPERAND_CR }, { 5, 11, NULL, NULL, PPC_OPERAND_CR },
/* The BB field in an XL form instruction when it must be the same /* The BB field in an XL form instruction when it must be the same
as the BA field in the same instruction. */ as the BA field in the same instruction. */
...@@ -140,21 +140,21 @@ const struct powerpc_operand powerpc_operands[] = ...@@ -140,21 +140,21 @@ const struct powerpc_operand powerpc_operands[] =
/* The BF field in an X or XL form instruction. */ /* The BF field in an X or XL form instruction. */
#define BF (11) #define BF (11)
{ 3, 23, 0, 0, PPC_OPERAND_CR }, { 3, 23, NULL, NULL, PPC_OPERAND_CR },
/* An optional BF field. This is used for comparison instructions, /* An optional BF field. This is used for comparison instructions,
in which an omitted BF field is taken as zero. */ in which an omitted BF field is taken as zero. */
#define OBF (12) #define OBF (12)
{ 3, 23, 0, 0, PPC_OPERAND_CR | PPC_OPERAND_OPTIONAL }, { 3, 23, NULL, NULL, PPC_OPERAND_CR | PPC_OPERAND_OPTIONAL },
/* The BFA field in an X or XL form instruction. */ /* The BFA field in an X or XL form instruction. */
#define BFA (13) #define BFA (13)
{ 3, 18, 0, 0, PPC_OPERAND_CR }, { 3, 18, NULL, NULL, PPC_OPERAND_CR },
/* The BI field in a B form or XL form instruction. */ /* The BI field in a B form or XL form instruction. */
#define BI (14) #define BI (14)
#define BI_MASK (0x1f << 16) #define BI_MASK (0x1f << 16)
{ 5, 16, 0, 0, PPC_OPERAND_CR }, { 5, 16, NULL, NULL, PPC_OPERAND_CR },
/* The BO field in a B form instruction. Certain values are /* The BO field in a B form instruction. Certain values are
illegal. */ illegal. */
...@@ -169,20 +169,20 @@ const struct powerpc_operand powerpc_operands[] = ...@@ -169,20 +169,20 @@ const struct powerpc_operand powerpc_operands[] =
/* The BT field in an X or XL form instruction. */ /* The BT field in an X or XL form instruction. */
#define BT (17) #define BT (17)
{ 5, 21, 0, 0, PPC_OPERAND_CR }, { 5, 21, NULL, NULL, PPC_OPERAND_CR },
/* The condition register number portion of the BI field in a B form /* The condition register number portion of the BI field in a B form
or XL form instruction. This is used for the extended or XL form instruction. This is used for the extended
conditional branch mnemonics, which set the lower two bits of the conditional branch mnemonics, which set the lower two bits of the
BI field. This field is optional. */ BI field. This field is optional. */
#define CR (18) #define CR (18)
{ 3, 18, 0, 0, PPC_OPERAND_CR | PPC_OPERAND_OPTIONAL }, { 3, 18, NULL, NULL, PPC_OPERAND_CR | PPC_OPERAND_OPTIONAL },
/* The D field in a D form instruction. This is a displacement off /* The D field in a D form instruction. This is a displacement off
a register, and implies that the next operand is a register in a register, and implies that the next operand is a register in
parentheses. */ parentheses. */
#define D (19) #define D (19)
{ 16, 0, 0, 0, PPC_OPERAND_PARENS | PPC_OPERAND_SIGNED }, { 16, 0, NULL, NULL, PPC_OPERAND_PARENS | PPC_OPERAND_SIGNED },
/* The DS field in a DS form instruction. This is like D, but the /* The DS field in a DS form instruction. This is like D, but the
lower two bits are forced to zero. */ lower two bits are forced to zero. */
...@@ -191,49 +191,49 @@ const struct powerpc_operand powerpc_operands[] = ...@@ -191,49 +191,49 @@ const struct powerpc_operand powerpc_operands[] =
/* The FL1 field in a POWER SC form instruction. */ /* The FL1 field in a POWER SC form instruction. */
#define FL1 (21) #define FL1 (21)
{ 4, 12, 0, 0, 0 }, { 4, 12, NULL, NULL, 0 },
/* The FL2 field in a POWER SC form instruction. */ /* The FL2 field in a POWER SC form instruction. */
#define FL2 (22) #define FL2 (22)
{ 3, 2, 0, 0, 0 }, { 3, 2, NULL, NULL, 0 },
/* The FLM field in an XFL form instruction. */ /* The FLM field in an XFL form instruction. */
#define FLM (23) #define FLM (23)
{ 8, 17, 0, 0, 0 }, { 8, 17, NULL, NULL, 0 },
/* The FRA field in an X or A form instruction. */ /* The FRA field in an X or A form instruction. */
#define FRA (24) #define FRA (24)
#define FRA_MASK (0x1f << 16) #define FRA_MASK (0x1f << 16)
{ 5, 16, 0, 0, PPC_OPERAND_FPR }, { 5, 16, NULL, NULL, PPC_OPERAND_FPR },
/* The FRB field in an X or A form instruction. */ /* The FRB field in an X or A form instruction. */
#define FRB (25) #define FRB (25)
#define FRB_MASK (0x1f << 11) #define FRB_MASK (0x1f << 11)
{ 5, 11, 0, 0, PPC_OPERAND_FPR }, { 5, 11, NULL, NULL, PPC_OPERAND_FPR },
/* The FRC field in an A form instruction. */ /* The FRC field in an A form instruction. */
#define FRC (26) #define FRC (26)
#define FRC_MASK (0x1f << 6) #define FRC_MASK (0x1f << 6)
{ 5, 6, 0, 0, PPC_OPERAND_FPR }, { 5, 6, NULL, NULL, PPC_OPERAND_FPR },
/* The FRS field in an X form instruction or the FRT field in a D, X /* The FRS field in an X form instruction or the FRT field in a D, X
or A form instruction. */ or A form instruction. */
#define FRS (27) #define FRS (27)
#define FRT (FRS) #define FRT (FRS)
{ 5, 21, 0, 0, PPC_OPERAND_FPR }, { 5, 21, NULL, NULL, PPC_OPERAND_FPR },
/* The FXM field in an XFX instruction. */ /* The FXM field in an XFX instruction. */
#define FXM (28) #define FXM (28)
#define FXM_MASK (0xff << 12) #define FXM_MASK (0xff << 12)
{ 8, 12, 0, 0, 0 }, { 8, 12, NULL, NULL, 0 },
/* The L field in a D or X form instruction. */ /* The L field in a D or X form instruction. */
#define L (29) #define L (29)
{ 1, 21, 0, 0, PPC_OPERAND_OPTIONAL }, { 1, 21, NULL, NULL, PPC_OPERAND_OPTIONAL },
/* The LEV field in a POWER SC form instruction. */ /* The LEV field in a POWER SC form instruction. */
#define LEV (30) #define LEV (30)
{ 7, 5, 0, 0, 0 }, { 7, 5, NULL, NULL, 0 },
/* The LI field in an I form instruction. The lower two bits are /* The LI field in an I form instruction. The lower two bits are
forced to zero. */ forced to zero. */
...@@ -248,19 +248,19 @@ const struct powerpc_operand powerpc_operands[] = ...@@ -248,19 +248,19 @@ const struct powerpc_operand powerpc_operands[] =
/* The MB field in an M form instruction. */ /* The MB field in an M form instruction. */
#define MB (33) #define MB (33)
#define MB_MASK (0x1f << 6) #define MB_MASK (0x1f << 6)
{ 5, 6, 0, 0, 0 }, { 5, 6, NULL, NULL, 0 },
/* The ME field in an M form instruction. */ /* The ME field in an M form instruction. */
#define ME (34) #define ME (34)
#define ME_MASK (0x1f << 1) #define ME_MASK (0x1f << 1)
{ 5, 1, 0, 0, 0 }, { 5, 1, NULL, NULL, 0 },
/* The MB and ME fields in an M form instruction expressed a single /* The MB and ME fields in an M form instruction expressed a single
operand which is a bitmask indicating which bits to select. This operand which is a bitmask indicating which bits to select. This
is a two operand form using PPC_OPERAND_NEXT. See the is a two operand form using PPC_OPERAND_NEXT. See the
description in opcode/ppc.h for what this means. */ description in opcode/ppc.h for what this means. */
#define MBE (35) #define MBE (35)
{ 5, 6, 0, 0, PPC_OPERAND_OPTIONAL | PPC_OPERAND_NEXT }, { 5, 6, NULL, NULL, PPC_OPERAND_OPTIONAL | PPC_OPERAND_NEXT },
{ 32, 0, insert_mbe, extract_mbe, 0 }, { 32, 0, insert_mbe, extract_mbe, 0 },
/* The MB or ME field in an MD or MDS form instruction. The high /* The MB or ME field in an MD or MDS form instruction. The high
...@@ -284,29 +284,29 @@ const struct powerpc_operand powerpc_operands[] = ...@@ -284,29 +284,29 @@ const struct powerpc_operand powerpc_operands[] =
/* The RA field in an D, DS, X, XO, M, or MDS form instruction. */ /* The RA field in an D, DS, X, XO, M, or MDS form instruction. */
#define RA (40) #define RA (40)
#define RA_MASK (0x1f << 16) #define RA_MASK (0x1f << 16)
{ 5, 16, 0, 0, PPC_OPERAND_GPR }, { 5, 16, NULL, NULL, PPC_OPERAND_GPR },
/* The RA field in a D or X form instruction which is an updating /* The RA field in a D or X form instruction which is an updating
load, which means that the RA field may not be zero and may not load, which means that the RA field may not be zero and may not
equal the RT field. */ equal the RT field. */
#define RAL (41) #define RAL (41)
{ 5, 16, insert_ral, 0, PPC_OPERAND_GPR }, { 5, 16, insert_ral, NULL, PPC_OPERAND_GPR },
/* The RA field in an lmw instruction, which has special value /* The RA field in an lmw instruction, which has special value
restrictions. */ restrictions. */
#define RAM (42) #define RAM (42)
{ 5, 16, insert_ram, 0, PPC_OPERAND_GPR }, { 5, 16, insert_ram, NULL, PPC_OPERAND_GPR },
/* The RA field in a D or X form instruction which is an updating /* The RA field in a D or X form instruction which is an updating
store or an updating floating point load, which means that the RA store or an updating floating point load, which means that the RA
field may not be zero. */ field may not be zero. */
#define RAS (43) #define RAS (43)
{ 5, 16, insert_ras, 0, PPC_OPERAND_GPR }, { 5, 16, insert_ras, NULL, PPC_OPERAND_GPR },
/* The RB field in an X, XO, M, or MDS form instruction. */ /* The RB field in an X, XO, M, or MDS form instruction. */
#define RB (44) #define RB (44)
#define RB_MASK (0x1f << 11) #define RB_MASK (0x1f << 11)
{ 5, 11, 0, 0, PPC_OPERAND_GPR }, { 5, 11, NULL, NULL, PPC_OPERAND_GPR },
/* The RB field in an X form instruction when it must be the same as /* The RB field in an X form instruction when it must be the same as
the RS field in the instruction. This is used for extended the RS field in the instruction. This is used for extended
...@@ -320,12 +320,12 @@ const struct powerpc_operand powerpc_operands[] = ...@@ -320,12 +320,12 @@ const struct powerpc_operand powerpc_operands[] =
#define RS (46) #define RS (46)
#define RT (RS) #define RT (RS)
#define RT_MASK (0x1f << 21) #define RT_MASK (0x1f << 21)
{ 5, 21, 0, 0, PPC_OPERAND_GPR }, { 5, 21, NULL, NULL, PPC_OPERAND_GPR },
/* The SH field in an X or M form instruction. */ /* The SH field in an X or M form instruction. */
#define SH (47) #define SH (47)
#define SH_MASK (0x1f << 11) #define SH_MASK (0x1f << 11)
{ 5, 11, 0, 0, 0 }, { 5, 11, NULL, NULL, 0 },
/* The SH field in an MD form instruction. This is split. */ /* The SH field in an MD form instruction. This is split. */
#define SH6 (48) #define SH6 (48)
...@@ -334,12 +334,12 @@ const struct powerpc_operand powerpc_operands[] = ...@@ -334,12 +334,12 @@ const struct powerpc_operand powerpc_operands[] =
/* The SI field in a D form instruction. */ /* The SI field in a D form instruction. */
#define SI (49) #define SI (49)
{ 16, 0, 0, 0, PPC_OPERAND_SIGNED }, { 16, 0, NULL, NULL, PPC_OPERAND_SIGNED },
/* The SI field in a D form instruction when we accept a wide range /* The SI field in a D form instruction when we accept a wide range
of positive values. */ of positive values. */
#define SISIGNOPT (50) #define SISIGNOPT (50)
{ 16, 0, 0, 0, PPC_OPERAND_SIGNED | PPC_OPERAND_SIGNOPT }, { 16, 0, NULL, NULL, PPC_OPERAND_SIGNED | PPC_OPERAND_SIGNOPT },
/* The SPR field in an XFX form instruction. This is flipped--the /* The SPR field in an XFX form instruction. This is flipped--the
lower 5 bits are stored in the upper 5 and vice- versa. */ lower 5 bits are stored in the upper 5 and vice- versa. */
...@@ -350,20 +350,20 @@ const struct powerpc_operand powerpc_operands[] = ...@@ -350,20 +350,20 @@ const struct powerpc_operand powerpc_operands[] =
/* The BAT index number in an XFX form m[ft]ibat[lu] instruction. */ /* The BAT index number in an XFX form m[ft]ibat[lu] instruction. */
#define SPRBAT (52) #define SPRBAT (52)
#define SPRBAT_MASK (0x3 << 17) #define SPRBAT_MASK (0x3 << 17)
{ 2, 17, 0, 0, 0 }, { 2, 17, NULL, NULL, 0 },
/* The SPRG register number in an XFX form m[ft]sprg instruction. */ /* The SPRG register number in an XFX form m[ft]sprg instruction. */
#define SPRG (53) #define SPRG (53)
#define SPRG_MASK (0x3 << 16) #define SPRG_MASK (0x3 << 16)
{ 2, 16, 0, 0, 0 }, { 2, 16, NULL, NULL, 0 },
/* The SR field in an X form instruction. */ /* The SR field in an X form instruction. */
#define SR (54) #define SR (54)
{ 4, 16, 0, 0, 0 }, { 4, 16, NULL, NULL, 0 },
/* The SV field in a POWER SC form instruction. */ /* The SV field in a POWER SC form instruction. */
#define SV (55) #define SV (55)
{ 14, 2, 0, 0, 0 }, { 14, 2, NULL, NULL, 0 },
/* The TBR field in an XFX form instruction. This is like the SPR /* The TBR field in an XFX form instruction. This is like the SPR
field, but it is optional. */ field, but it is optional. */
...@@ -373,15 +373,15 @@ const struct powerpc_operand powerpc_operands[] = ...@@ -373,15 +373,15 @@ const struct powerpc_operand powerpc_operands[] =
/* The TO field in a D or X form instruction. */ /* The TO field in a D or X form instruction. */
#define TO (57) #define TO (57)
#define TO_MASK (0x1f << 21) #define TO_MASK (0x1f << 21)
{ 5, 21, 0, 0, 0 }, { 5, 21, NULL, NULL, 0 },
/* The U field in an X form instruction. */ /* The U field in an X form instruction. */
#define U (58) #define U (58)
{ 4, 12, 0, 0, 0 }, { 4, 12, NULL, NULL, 0 },
/* The UI field in a D form instruction. */ /* The UI field in a D form instruction. */
#define UI (59) #define UI (59)
{ 16, 0, 0, 0, 0 }, { 16, 0, NULL, NULL, 0 },
}; };
/* The functions used to insert and extract complicated operands. */ /* The functions used to insert and extract complicated operands. */
......
...@@ -448,13 +448,13 @@ xmon_init_scc(void) ...@@ -448,13 +448,13 @@ xmon_init_scc(void)
scc_initialized = 1; scc_initialized = 1;
if (via_modem) { if (via_modem) {
for (;;) { for (;;) {
xmon_write(0, "ATE1V1\r", 7); xmon_write(NULL, "ATE1V1\r", 7);
if (xmon_expect("OK", 5)) { if (xmon_expect("OK", 5)) {
xmon_write(0, "ATA\r", 4); xmon_write(NULL, "ATA\r", 4);
if (xmon_expect("CONNECT", 40)) if (xmon_expect("CONNECT", 40))
break; break;
} }
xmon_write(0, "+++", 3); xmon_write(NULL, "+++", 3);
xmon_expect("OK", 3); xmon_expect("OK", 3);
} }
} }
...@@ -618,7 +618,7 @@ xmon_fgets(char *str, int nb, void *f) ...@@ -618,7 +618,7 @@ xmon_fgets(char *str, int nb, void *f)
c = xmon_getchar(); c = xmon_getchar();
if (c == -1) { if (c == -1) {
if (p == str) if (p == str)
return 0; return NULL;
break; break;
} }
*p++ = c; *p++ = c;
......
...@@ -239,7 +239,7 @@ xmon(struct pt_regs *excp) ...@@ -239,7 +239,7 @@ xmon(struct pt_regs *excp)
set_backlight_level(BACKLIGHT_MAX); set_backlight_level(BACKLIGHT_MAX);
sync(); sync();
} }
debugger_fault_handler = 0; debugger_fault_handler = NULL;
#endif /* CONFIG_PMAC_BACKLIGHT */ #endif /* CONFIG_PMAC_BACKLIGHT */
cmd = cmds(excp); cmd = cmds(excp);
if (cmd == 's') { if (cmd == 's') {
...@@ -253,7 +253,7 @@ xmon(struct pt_regs *excp) ...@@ -253,7 +253,7 @@ xmon(struct pt_regs *excp)
insert_bpts(); insert_bpts();
} }
xmon_leave(); xmon_leave();
xmon_regs[smp_processor_id()] = 0; xmon_regs[smp_processor_id()] = NULL;
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
clear_bit(0, &got_xmon); clear_bit(0, &got_xmon);
clear_bit(smp_processor_id(), &cpus_in_xmon); clear_bit(smp_processor_id(), &cpus_in_xmon);
...@@ -352,7 +352,7 @@ at_breakpoint(unsigned pc) ...@@ -352,7 +352,7 @@ at_breakpoint(unsigned pc)
for (i = 0; i < NBPTS; ++i, ++bp) for (i = 0; i < NBPTS; ++i, ++bp)
if (bp->enabled && pc == bp->address) if (bp->enabled && pc == bp->address)
return bp; return bp;
return 0; return NULL;
} }
static void static void
...@@ -962,7 +962,7 @@ print_sysmap(void) ...@@ -962,7 +962,7 @@ print_sysmap(void)
xmon_puts(sysmap); xmon_puts(sysmap);
sync(); sync();
} }
debugger_fault_handler = 0; debugger_fault_handler = NULL;
} }
else else
printf("No System.map\n"); printf("No System.map\n");
...@@ -1203,7 +1203,7 @@ mread(unsigned adrs, void *buf, int size) ...@@ -1203,7 +1203,7 @@ mread(unsigned adrs, void *buf, int size)
__delay(200); __delay(200);
n = size; n = size;
} }
debugger_fault_handler = 0; debugger_fault_handler = NULL;
return n; return n;
} }
...@@ -1233,7 +1233,7 @@ mwrite(unsigned adrs, void *buf, int size) ...@@ -1233,7 +1233,7 @@ mwrite(unsigned adrs, void *buf, int size)
} else { } else {
printf("*** Error writing address %x\n", adrs + n); printf("*** Error writing address %x\n", adrs + n);
} }
debugger_fault_handler = 0; debugger_fault_handler = NULL;
return n; return n;
} }
...@@ -1673,7 +1673,7 @@ void proccall(void) ...@@ -1673,7 +1673,7 @@ void proccall(void)
} else { } else {
printf("*** %x exception occurred\n", fault_except); printf("*** %x exception occurred\n", fault_except);
} }
debugger_fault_handler = 0; debugger_fault_handler = NULL;
} }
/* Input scanning routines */ /* Input scanning routines */
...@@ -1886,7 +1886,7 @@ sysmap_lookup(void) ...@@ -1886,7 +1886,7 @@ sysmap_lookup(void)
} while (cur); } while (cur);
sync(); sync();
} }
debugger_fault_handler = 0; debugger_fault_handler = NULL;
termch = 0; termch = 0;
break; break;
} }
...@@ -1939,7 +1939,7 @@ xmon_find_symbol(unsigned long addr, unsigned long* saddr) ...@@ -1939,7 +1939,7 @@ xmon_find_symbol(unsigned long addr, unsigned long* saddr)
*(ep++) = 0; *(ep++) = 0;
if (saddr) if (saddr)
*saddr = prev; *saddr = prev;
debugger_fault_handler = 0; debugger_fault_handler = NULL;
return rbuffer; return rbuffer;
} }
prev = next; prev = next;
...@@ -1951,7 +1951,7 @@ xmon_find_symbol(unsigned long addr, unsigned long* saddr) ...@@ -1951,7 +1951,7 @@ xmon_find_symbol(unsigned long addr, unsigned long* saddr)
bail: bail:
sync(); sync();
} }
debugger_fault_handler = 0; debugger_fault_handler = NULL;
return NULL; return NULL;
} }
...@@ -2003,6 +2003,6 @@ xmon_symbol_to_addr(char* symbol) ...@@ -2003,6 +2003,6 @@ xmon_symbol_to_addr(char* symbol)
} }
sync(); sync();
} }
debugger_fault_handler = 0; debugger_fault_handler = NULL;
return result; return result;
} }
...@@ -91,7 +91,7 @@ static inline void *kmap_atomic(struct page *page, enum km_type type) ...@@ -91,7 +91,7 @@ static inline void *kmap_atomic(struct page *page, enum km_type type)
BUG_ON(!pte_none(*(kmap_pte+idx))); BUG_ON(!pte_none(*(kmap_pte+idx)));
#endif #endif
set_pte(kmap_pte+idx, mk_pte(page, kmap_prot)); set_pte(kmap_pte+idx, mk_pte(page, kmap_prot));
flush_tlb_page(0, vaddr); flush_tlb_page(NULL, vaddr);
return (void*) vaddr; return (void*) vaddr;
} }
...@@ -115,7 +115,7 @@ static inline void kunmap_atomic(void *kvaddr, enum km_type type) ...@@ -115,7 +115,7 @@ static inline void kunmap_atomic(void *kvaddr, enum km_type type)
* this pte without first remap it * this pte without first remap it
*/ */
pte_clear(kmap_pte+idx); pte_clear(kmap_pte+idx);
flush_tlb_page(0, vaddr); flush_tlb_page(NULL, vaddr);
#endif #endif
dec_preempt_count(); dec_preempt_count();
preempt_check_resched(); preempt_check_resched();
......
...@@ -237,7 +237,7 @@ extern inline void * bus_to_virt(unsigned long address) ...@@ -237,7 +237,7 @@ extern inline void * bus_to_virt(unsigned long address)
{ {
#ifndef CONFIG_APUS #ifndef CONFIG_APUS
if (address == 0) if (address == 0)
return 0; return NULL;
return (void *)(address - PCI_DRAM_OFFSET + KERNELBASE); return (void *)(address - PCI_DRAM_OFFSET + KERNELBASE);
#else #else
return (void*) mm_ptov (address); return (void*) mm_ptov (address);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment