[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200707312114.31646.m.kozlowski@tuxland.pl>
Date: Tue, 31 Jul 2007 21:14:31 +0200
From: Mariusz Kozlowski <m.kozlowski@...land.pl>
To: linux-kernel@...r.kernel.org
Cc: kernel-janitors@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
mchehab@...radead.org, v4l-dvb-maintainer@...uxtv.org,
video4linux-list@...hat.com
Subject: [PATCH 51] drivers/media/video/msp3400-driver.c: kmalloc + memset conversion to kzalloc
Signed-off-by: Mariusz Kozlowski <m.kozlowski@...land.pl>
drivers/media/video/msp3400-driver.c | 28945 -> 28898 (-47 bytes)
drivers/media/video/msp3400-driver.o | 125620 -> 125320 (-300 bytes)
drivers/media/video/msp3400-driver.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
--- linux-2.6.23-rc1-mm1-a/drivers/media/video/msp3400-driver.c 2007-07-26 13:07:43.000000000 +0200
+++ linux-2.6.23-rc1-mm1-b/drivers/media/video/msp3400-driver.c 2007-07-31 13:22:34.000000000 +0200
@@ -813,8 +813,9 @@ static int msp_attach(struct i2c_adapter
int msp_rom;
client = kzalloc(sizeof(*client), GFP_KERNEL);
- if (client == NULL)
+ if (!client)
return -ENOMEM;
+
client->addr = address;
client->adapter = adapter;
client->driver = &i2c_driver;
@@ -826,14 +827,14 @@ static int msp_attach(struct i2c_adapter
return 0;
}
- state = kmalloc(sizeof(*state), GFP_KERNEL);
- if (state == NULL) {
+ state = kzalloc(sizeof(*state), GFP_KERNEL);
+ if (!state) {
kfree(client);
return -ENOMEM;
}
+
i2c_set_clientdata(client, state);
- memset(state, 0, sizeof(*state));
state->v4l2_std = V4L2_STD_NTSC;
state->audmode = V4L2_TUNER_MODE_STEREO;
state->volume = 58880; /* 0db gain */
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists