lkml.org 
[lkml]   [2007]   [Jul]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 03] drivers/sbus/char/bbc_envctrl.c: kmalloc + memset conversion to kzalloc
Date
Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>

drivers/sbus/char/bbc_envctrl.c | 16622 -> 16580 (-42 bytes)

drivers/sbus/char/bbc_envctrl.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)

--- linux-2.6.23-rc1-mm1-a/drivers/sbus/char/bbc_envctrl.c 2007-07-26 13:07:43.000000000 +0200
+++ linux-2.6.23-rc1-mm1-b/drivers/sbus/char/bbc_envctrl.c 2007-07-31 13:58:44.000000000 +0200
@@ -479,11 +479,12 @@ static int kenvctrld(void *__unused)

static void attach_one_temp(struct linux_ebus_child *echild, int temp_idx)
{
- struct bbc_cpu_temperature *tp = kmalloc(sizeof(*tp), GFP_KERNEL);
-
+ struct bbc_cpu_temperature *tp;
+
+ tp = kzalloc(sizeof(*tp), GFP_KERNEL);
if (!tp)
return;
- memset(tp, 0, sizeof(*tp));
+
tp->client = bbc_i2c_attach(echild);
if (!tp->client) {
kfree(tp);
@@ -525,11 +526,12 @@ static void attach_one_temp(struct linux

static void attach_one_fan(struct linux_ebus_child *echild, int fan_idx)
{
- struct bbc_fan_control *fp = kmalloc(sizeof(*fp), GFP_KERNEL);
-
+ struct bbc_fan_control *fp;
+
+ fp = kzalloc(sizeof(*fp), GFP_KERNEL);
if (!fp)
return;
- memset(fp, 0, sizeof(*fp));
+
fp->client = bbc_i2c_attach(echild);
if (!fp->client) {
kfree(fp);
-
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: 2007-07-31 18:59    [W:0.406 / U:0.364 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site