[U-Boot-Users] [PATCH] Fill in remaining MTD driver data for OneNAND

Scott Wood scottwood at freescale.com
Tue Aug 5 18:49:21 CEST 2008


On Tue, Aug 05, 2008 at 11:06:28AM +0200, Fathi BOUDRA wrote:
> -void onenand_print_device_info(int device, int verbose)
> +char * onenand_print_device_info(int device)
>  {
>  	int vcc, demuxed, ddp, density;
> -
> -	if (!verbose)
> -		return;
> +	char *dev_info;
>  
>  	vcc = device & ONENAND_DEVICE_VCC_MASK;
>  	demuxed = device & ONENAND_DEVICE_IS_DEMUX;
>  	ddp = device & ONENAND_DEVICE_IS_DDP;
>  	density = device >> ONENAND_DEVICE_DENSITY_SHIFT;
> -	printk(KERN_INFO "%sOneNAND%s %dMB %sV 16-bit (0x%02x)\n",
> +	sprintf(dev_info, "%sOneNAND%s %dMB %sV 16-bit (0x%02x)",
>  	       demuxed ? "" : "Muxed ",
>  	       ddp ? "(DDP)" : "",
>  	       (16 << density), vcc ? "2.65/3.3" : "1.8", device);
> +
> +	return dev_info;

Please don't write to uninitialized pointers.

-Scott




More information about the U-Boot mailing list