if (!(cpuaddr = (void *)__get_free_pages(GFP_ATOMIC, get_order(size)))) 
node = pcibus_to_node(pdev->bus); if (likely(node >=0)) { struct page *p = alloc_pages_node(node, GFP_ATOMIC, get_order(size));  if (likely(p)) cpuaddr = page_address(p); else return NULL; } else cpuaddr = (void *)__get_free_pages(GFP_ATOMIC, get_order(size));  if (unlikely(!cpuaddr)) 
void *sn_dma_alloc_coherent(struct device *dev, size_t size,			    dma_addr_t * dma_handle, int flags){	void *cpuaddr;	unsigned long phys_addr;	struct pci_dev *pdev = to_pci_dev(dev);	struct sn_pcibus_provider *provider = SN_PCIDEV_BUSPROVIDER(pdev);	BUG_ON(dev->bus != &pci_bus_type);	/*	 * Allocate the memory.	 * FIXME: We should be doing alloc_pages_node for the node closest	 *        to the PCI device.	 */	if (!(cpuaddr = (void *)__get_free_pages(GFP_ATOMIC, get_order(size))))		return NULL;	memset(cpuaddr, 0x0, size);	/* physical addr. of the memory we just got */	phys_addr = __pa(cpuaddr);	/*	 * 64 bit address translations should never fail.	 * 32 bit translations can fail if there are insufficient mapping	 * resources.	 */	*dma_handle = provider->dma_map_consistent(pdev, phys_addr, size);	if (!*dma_handle) {		printk(KERN_ERR "%s: out of ATEs\n", __FUNCTION__);		free_pages((unsigned long)cpuaddr, get_order(size));		return NULL;	}	return cpuaddr;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/7c2a6c62c013a4ea57243536fc7f3987e4ba04bc/pci_dma.c/clean/arch/ia64/sn/pci/pci_dma.c