[PATCH] drivers: Conversions from kmalloc+memset to k(z|c)alloc.

Pekka Enberg penberg at cs.helsinki.fi
Wed Jul 19 04:38:27 EDT 2006


On 7/19/06, Daniel K. <daniel at cluded.net> wrote:
> > diff --git a/drivers/serial/ip22zilog.c b/drivers/serial/ip22zilog.c
> > index 5ff269f..ca0e9f2 100644
> > --- a/drivers/serial/ip22zilog.c
> > +++ b/drivers/serial/ip22zilog.c
> > @@ -925,11 +925,7 @@ static int zilog_irq = -1;
> >  static void * __init alloc_one_table(unsigned long size)
> >  {
> >       void *ret;
> > -
> > -     ret = kmalloc(size, GFP_KERNEL);
> > -     if (ret != NULL)
> > -             memset(ret, 0, size);
> > -
> > +     ret = kzalloc(size, GFP_KERNEL);
> >       return ret;
> >  }
>
> And here as well.
>
> What is preferred by developers?

That you kill useless wrappers and type casts.



More information about the linux-pcmcia mailing list