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

Pekka Enberg penberg at cs.helsinki.fi
Fri Jul 21 02:58:41 EDT 2006


On 7/21/06, Rolf Eike Beer <eike-kernel at sf-tec.de> wrote:
> > -     if (!(handle = kmalloc(sizeof(struct input_handle), GFP_KERNEL)))
> > +     handle = kzalloc(sizeof(struct input_handle), GFP_KERNEL);
> > +     if (!handle)
> >               return NULL;
>
> sizeof(*handle)?

In general, yes. However, some maintainers don't like that, so I would
recommend to keep them as-is unless you get a clear ack from the
maintainer to change it.



More information about the linux-pcmcia mailing list