if ( (long)phb_node <= 0) 
if (phb_node == 0) 
static void __init prom_initialize_tce_table(void){	phandle node;	ihandle phb_node;	unsigned long offset = reloc_offset();	char compatible[64], type[64], model[64];	char *path = RELOC(prom_scratch);	u64 base, align;	u32 minalign, minsize;	u64 tce_entry, *tce_entryp;	u64 local_alloc_top, local_alloc_bottom;	u64 i;	if (RELOC(ppc64_iommu_off))		return;	prom_debug("starting prom_initialize_tce_table\n");	/* Cache current top of allocs so we reserve a single block */	local_alloc_top = RELOC(alloc_top_high);	local_alloc_bottom = local_alloc_top;	/* Search all nodes looking for PHBs. */	for (node = 0; prom_next_node(&node); ) {		compatible[0] = 0;		type[0] = 0;		model[0] = 0;		prom_getprop(node, "compatible",			     compatible, sizeof(compatible));		prom_getprop(node, "device_type", type, sizeof(type));		prom_getprop(node, "model", model, sizeof(model));		if ((type[0] == 0) || (strstr(type, RELOC("pci")) == NULL))			continue;		/* Keep the old logic in tack to avoid regression. */		if (compatible[0] != 0) {			if ((strstr(compatible, RELOC("python")) == NULL) &&			    (strstr(compatible, RELOC("Speedwagon")) == NULL) &&			    (strstr(compatible, RELOC("Winnipeg")) == NULL))				continue;		} else if (model[0] != 0) {			if ((strstr(model, RELOC("ython")) == NULL) &&			    (strstr(model, RELOC("peedwagon")) == NULL) &&			    (strstr(model, RELOC("innipeg")) == NULL))				continue;		}		if (prom_getprop(node, "tce-table-minalign", &minalign,				 sizeof(minalign)) == PROM_ERROR)			minalign = 0;		if (prom_getprop(node, "tce-table-minsize", &minsize,				 sizeof(minsize)) == PROM_ERROR)			minsize = 4UL << 20;		/*		 * Even though we read what OF wants, we just set the table		 * size to 4 MB.  This is enough to map 2GB of PCI DMA space.		 * By doing this, we avoid the pitfalls of trying to DMA to		 * MMIO space and the DMA alias hole.		 *		 * On POWER4, firmware sets the TCE region by assuming		 * each TCE table is 8MB. Using this memory for anything		 * else will impact performance, so we always allocate 8MB.		 * Anton		 */		if (__is_processor(PV_POWER4) || __is_processor(PV_POWER4p))			minsize = 8UL << 20;		else			minsize = 4UL << 20;		/* Align to the greater of the align or size */		align = max(minalign, minsize);		base = alloc_down(minsize, align, 1);		if (base == 0)			prom_panic("ERROR, cannot find space for TCE table.\n");		if (base < local_alloc_bottom)			local_alloc_bottom = base;		/* Save away the TCE table attributes for later use. */		prom_setprop(node, "linux,tce-base", &base, sizeof(base));		prom_setprop(node, "linux,tce-size", &minsize, sizeof(minsize));		/* It seems OF doesn't null-terminate the path :-( */		memset(path, 0, sizeof(path));		/* Call OF to setup the TCE hardware */		if (call_prom("package-to-path", 3, 1, node,			      path, PROM_SCRATCH_SIZE-1) == PROM_ERROR) {			prom_printf("package-to-path failed\n");		}		prom_debug("TCE table: %s\n", path);		prom_debug("\tnode = 0x%x\n", node);		prom_debug("\tbase = 0x%x\n", base);		prom_debug("\tsize = 0x%x\n", minsize);		/* Initialize the table to have a one-to-one mapping		 * over the allocated size.		 */		tce_entryp = (unsigned long *)base;		for (i = 0; i < (minsize >> 3) ;tce_entryp++, i++) {			tce_entry = (i << PAGE_SHIFT);			tce_entry |= 0x3;			*tce_entryp = tce_entry;		}		prom_printf("opening PHB %s", path);		phb_node = call_prom("open", 1, 1, path);		if ( (long)phb_node <= 0)			prom_printf("... failed\n");		else			prom_printf("... done\n");		call_prom("call-method", 6, 0, ADDR("set-64-bit-addressing"),			  phb_node, -1, minsize,			  (u32) base, (u32) (base >> 32));		call_prom("close", 1, 0, phb_node);	}	reserve_mem(local_alloc_bottom, local_alloc_top - local_alloc_bottom);	if (RELOC(prom_memory_limit)) {		/*		 * We align the start to a 16MB boundary so we can map the TCE area		 * using large pages if possible. The end should be the top of RAM		 * so no need to align it.		 */		RELOC(prom_tce_alloc_start) = _ALIGN_DOWN(local_alloc_bottom, 0x1000000);		RELOC(prom_tce_alloc_end) = local_alloc_top;	}	/* Flag the first invalid entry */	prom_debug("ending prom_initialize_tce_table\n");}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/1e86d1c648508fd50e6c9960576b87906a7906ad/prom_init.c/buggy/arch/ppc64/kernel/prom_init.c