[PATCH 1/4] mtd: Don't cast kmalloc() return value in drivers/mtd/maps/pmcmsp-flash.c

Jesper Juhl jesper.juhl at gmail.com
Sun Aug 26 09:19:42 EDT 2007


On 26/08/07, Robert P. J. Day <rpjday at mindspring.com> wrote:
> On Sun, 26 Aug 2007, Jesper Juhl wrote:
>
> > +     msp_maps = kmalloc(fcnt * sizeof(struct mtd_info), GFP_KERNEL);
> >       memset(msp_maps, 0, fcnt * sizeof(struct mtd_info));
>
> ...
>
> > +             msp_parts[i] = kmalloc(pcnt * sizeof(struct mtd_partition),
> > +                     GFP_KERNEL);
> >               memset(msp_parts[i], 0, pcnt * sizeof(struct mtd_partition));
>
> again, both of the above could be done with a single call to kcalloc()
> in each case.  why are you so philosophically opposed to doing it that
> way?
>
Check the second patch in the series, please.

-- 
Jesper Juhl <jesper.juhl at gmail.com>
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please      http://www.expita.com/nomime.html



More information about the linux-mtd mailing list