Re: [PATCH] [HWMON] kmalloc + memset -> kzalloc conversion

From: Jean Delvare
Date: Sat Oct 01 2005 - 15:47:28 EST


Hi Deepak,

> Signed-off-by: Deepak Saxena <dsaxena@xxxxxxxxxxx>
>
> diff --git a/drivers/hwmon/adm1021.c b/drivers/hwmon/adm1021.c
> --- a/drivers/hwmon/adm1021.c
> +++ b/drivers/hwmon/adm1021.c
> @@ -204,11 +204,10 @@ static int adm1021_detect(struct i2c_ada
> client structure, even though we cannot fill it completely yet.
> But it allows us to access adm1021_{read,write}_value. */
>
> - if (!(data = kmalloc(sizeof(struct adm1021_data), GFP_KERNEL))) {
> + if (!(data = kzalloc(sizeof(struct adm1021_data), GFP_KERNEL))) {
> err = -ENOMEM;
> goto error0;
> }
> - memset(data, 0, sizeof(struct adm1021_data));
> (...)

OK, I'll pick that patch. Three comments however:

1* Please exclude adm9240, it is already updated in my tree.

2* Please add some comment before your Signed-off-line, explaining what
the patch is all about. It doesn't need to be long, but it needs to
exist.

3* Please include diffstat output in the patch header.

Care to respin your patch?

As a side note, I don't think it was worth sending this to Linus,
Andrew and two mailing lists. There's nothing ground breaking here.
Send this kind of patches to me as the subsystem maintainer, CC LKML
for comments if you want, and that should be sufficient.

Thanks,
--
Jean Delvare
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/