瀏覽代碼

[POWERPC] drivers/macintosh/therm_adt746x.c: kmalloc + memset conversion to kzalloc

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Mariusz Kozlowski 18 年之前
父節點
當前提交
cc61f957f4
共有 1 個文件被更改,包括 1 次插入4 次删除
  1. 1 4
      drivers/macintosh/therm_adt746x.c

+ 1 - 4
drivers/macintosh/therm_adt746x.c

@@ -379,13 +379,10 @@ static int attach_one_thermostat(struct i2c_adapter *adapter, int addr,
 	if (thermostat)
 		return 0;
 
-	th = (struct thermostat *)
-		kmalloc(sizeof(struct thermostat), GFP_KERNEL);
-
+	th = kzalloc(sizeof(struct thermostat), GFP_KERNEL);
 	if (!th)
 		return -ENOMEM;
 
-	memset(th, 0, sizeof(*th));
 	th->clt.addr = addr;
 	th->clt.adapter = adapter;
 	th->clt.driver = &thermostat_driver;