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

From: Jeff Garzik
Date: Fri Jul 21 2006 - 03:05:28 EST

Pekka Enberg wrote:
On 7/21/06, Rolf Eike Beer <eike-kernel@xxxxxxxxx> wrote:
> - if (!(handle = kmalloc(sizeof(struct input_handle), GFP_KERNEL)))
> + handle = kzalloc(sizeof(struct input_handle), GFP_KERNEL);
> + if (!handle)
> return NULL;


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.

Strongly agreed. Follow the style of the existing code as closely as possible, and resist the temptation of making little "improvements" while you are doing a task...


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at