lkml.org 
[lkml]   [2005]   [Oct]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] [HWMON] kmalloc + memset -> kzalloc conversion
Date
On Sat, 1 Oct 2005 22:46:04 +0200, Jean Delvare <khali@linux-fr.org> wrote:

>Hi Deepak,
>
>> Signed-off-by: Deepak Saxena <dsaxena@plexity.net>
>>
>> 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))) {

if (!(data = kzalloc(sizeof(*data), GFP_KERNEL))) {
instead? Though lkml opinion seems to be split...

Cheers,
Grant.

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

\
 
 \ /
  Last update: 2005-10-01 23:48    [W:0.293 / U:0.160 seconds]
©2003-2011 Jasper Spaans. Advertise on this site