From: Geert U. <ge...@li...> - 2008-03-06 18:07:57
|
On Thu, 6 Mar 2008, Bryan Wu wrote: > On Wed, Mar 5, 2008 at 11:02 PM, Andrew Morton > <ak...@li...> wrote: > > On Thu, 31 Jan 2008 00:49:43 +0800 Bryan Wu <bry...@an...> wrote: > > > + fbinfo = > > > + framebuffer_alloc(sizeof(struct bfin_t350mcqbfb_info), &pdev->dev); > > > + if (!fbinfo) { > > > + ret = -ENOMEM; > > > + goto out2; > > > + } [...] > > > + fbinfo->pseudo_palette = kmalloc(sizeof(u32) * 16, GFP_KERNEL); > > > + if (!fbinfo->pseudo_palette) { > > > + printk(KERN_ERR DRIVER_NAME > > > + "Fail to allocate pseudo_palette\n"); > > > + > > > + ret = -ENOMEM; > > > + goto out4; > > > + } > > > + > > > + memset(fbinfo->pseudo_palette, 0, sizeof(u32) * 16); > > > > You just invented kzalloc! > > > > Right Alternatively, you could embed the pseudo palette inside struct bfin_t350mcqbfb_info, so it's allocated by the framebuffer_alloc() call above. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@li... In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds |