if ((up = (unsigned *) get_property(dp, "address", &len)) != NULL && len == sizeof(unsigned)) 
 rsize = (unsigned long)pitch * (unsigned long)height * (unsigned long)(depth / 8);  /* Try to match device to a PCI device in order to get a properly * translated address rather then trying to decode the open firmware * stuff in various incorrect ways */ #ifdef CONFIG_PCI /* First try to locate the PCI device if any */ { struct pci_dev *pdev = NULL;  for_each_pci_dev(pdev) { if (dp == pci_device_to_OF_node(pdev)) break; } if (pdev) { for (i = 0; i < 6 && address == 0; i++) { if ((pci_resource_flags(pdev, i) & IORESOURCE_MEM) && (pci_resource_len(pdev, i) >= rsize)) address = pci_resource_start(pdev, i); } pci_dev_put(pdev); } } #endif /* CONFIG_PCI */  if (address == 0 && (up = (unsigned *) get_property(dp, "address", &len)) != NULL && len == sizeof(unsigned)) 
static void __init offb_init_nodriver(struct device_node *dp){	int *pp, i;	unsigned int len;	int width = 640, height = 480, depth = 8, pitch;	unsigned *up;	unsigned long address;	if ((pp = (int *) get_property(dp, "depth", &len)) != NULL	    && len == sizeof(int))		depth = *pp;	if ((pp = (int *) get_property(dp, "width", &len)) != NULL	    && len == sizeof(int))		width = *pp;	if ((pp = (int *) get_property(dp, "height", &len)) != NULL	    && len == sizeof(int))		height = *pp;	if ((pp = (int *) get_property(dp, "linebytes", &len)) != NULL	    && len == sizeof(int)) {		pitch = *pp;		if (pitch == 1)			pitch = 0x1000;	} else		pitch = width;	if ((up = (unsigned *) get_property(dp, "address", &len)) != NULL	    && len == sizeof(unsigned))		address = (u_long) * up;	else {		for (i = 0; i < dp->n_addrs; ++i)			if (dp->addrs[i].size >=			    pitch * height * depth / 8)				break;		if (i >= dp->n_addrs) {			printk(KERN_ERR			       "no framebuffer address found for %s\n",			       dp->full_name);			return;		}		address = (u_long) dp->addrs[i].address;#ifdef CONFIG_PPC64		address += ((struct pci_dn *)dp->data)->phb->pci_mem_offset;#endif		/* kludge for valkyrie */		if (strcmp(dp->name, "valkyrie") == 0)			address += 0x1000;	}	offb_init_fb(dp->name, dp->full_name, width, height, depth,		     pitch, address, dp);}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/b341e32e5cc1a154cb0ac2f4229c2d040647804b/offb.c/buggy/drivers/video/offb.c