
6 Aug
2008
6 Aug
'08
6:09 p.m.
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