Re: [PATCH] ALSA: Remove subsystem-specific malloc (1/8)

Chris Wright
2004-06-09T18:35:10Z

* Pekka J Enberg (penberg@cs.helsinki.fi) wrote:
> /**
> + * kcalloc - allocate memory. The memory is set to zero.
> + * @size: how many bytes of memory are required.
> + * @flags: the type of memory to allocate.
> + */
> +void *kcalloc(size_t size, int flags)
> +{
> + void *ret = kmalloc(size, flags);
> + if (ret)
> + memset(ret, 0, size);
> + return ret;
> +}

This looks more like the kzalloc() that pops up every now and then.
Wouldn't it make more sense to give kcalloc() a true calloc() style
interface?

thanks,
-chris
--
Linux Security Modules http://lsm.immunix.org http://lsm.bkbits.net