On Wed, Aug 06, 2008 at 10:06:20AM +0200, Fathi BOUDRA wrote:
> -void onenand_print_device_info(int device, int verbose)
> +char * onenand_print_device_info(int device)
No space after unary '*' (here and elsewhere).
> {
> int vcc, demuxed, ddp, density;
> -
> - if (!verbose)
> - return;
> + char *dev_info = (char *)malloc(80);
Don't cast the return of malloc.
Why not just declare a static array?
> - 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);
It'd be better to use snprintf, even if you're pretty sure it won't
overflow.
-Scott
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
U-Boot-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/u-boot-users