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

Brown, Len
2006-07-22T02:22:16Z

>diff --git a/drivers/acpi/hotkey.c b/drivers/acpi/hotkey.c
>index 32c9d88..037d022 100644
>--- a/drivers/acpi/hotkey.c
>+++ b/drivers/acpi/hotkey.c
>@@ -246,10 +246,8 @@ static char *format_result(union acpi_ob
> {
> char *buf = NULL;
>
>- buf = (char *)kmalloc(RESULT_STR_LEN, GFP_KERNEL);
>- if (buf)
>- memset(buf, 0, RESULT_STR_LEN);
>- else
>+ buf = kzalloc(RESULT_STR_LEN, GFP_KERNEL);
>+ if (!buf)
> goto do_fail;

Go ahead and delete the '= NULL' while you're there.

Acked-by: Len Brown <len.brown@intel.com>

thanks,
-Len