aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message/i2o/driver.c
diff options
context:
space:
mode:
authorMarkus Lidel <Markus.Lidel@shadowconnect.com>2006-01-06 03:19:33 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-06 11:33:54 -0500
commitf6ed39a6e1a88240eec629a3da17c3a47ada3b89 (patch)
treeb19fee742b48865b94bb26ed4428ca00a1a95b2c /drivers/message/i2o/driver.c
parent2e1973a3cd0b9fe31469be62df3583bdc5a34f51 (diff)
[PATCH] I2O: Optimizing
- make i2o_iop_free() static inline (from Adrian Bunk) - changed kmalloc() + memset(0) into kzalloc() Signed-off-by: Markus Lidel <Markus.Lidel@shadowconnect.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/message/i2o/driver.c')
-rw-r--r--drivers/message/i2o/driver.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/message/i2o/driver.c b/drivers/message/i2o/driver.c
index 45f4119a75f6..64130227574f 100644
--- a/drivers/message/i2o/driver.c
+++ b/drivers/message/i2o/driver.c
@@ -217,10 +217,9 @@ int i2o_driver_dispatch(struct i2o_controller *c, u32 m)
217 /* cut of header from message size (in 32-bit words) */ 217 /* cut of header from message size (in 32-bit words) */
218 size = (le32_to_cpu(msg->u.head[0]) >> 16) - 5; 218 size = (le32_to_cpu(msg->u.head[0]) >> 16) - 5;
219 219
220 evt = kmalloc(size * 4 + sizeof(*evt), GFP_ATOMIC); 220 evt = kzalloc(size * 4 + sizeof(*evt), GFP_ATOMIC);
221 if (!evt) 221 if (!evt)
222 return -ENOMEM; 222 return -ENOMEM;
223 memset(evt, 0, size * 4 + sizeof(*evt));
224 223
225 evt->size = size; 224 evt->size = size;
226 evt->tcntxt = le32_to_cpu(msg->u.s.tcntxt); 225 evt->tcntxt = le32_to_cpu(msg->u.s.tcntxt);
@@ -348,12 +347,10 @@ int __init i2o_driver_init(void)
348 osm_info("max drivers = %d\n", i2o_max_drivers); 347 osm_info("max drivers = %d\n", i2o_max_drivers);
349 348
350 i2o_drivers = 349 i2o_drivers =
351 kmalloc(i2o_max_drivers * sizeof(*i2o_drivers), GFP_KERNEL); 350 kzalloc(i2o_max_drivers * sizeof(*i2o_drivers), GFP_KERNEL);
352 if (!i2o_drivers) 351 if (!i2o_drivers)
353 return -ENOMEM; 352 return -ENOMEM;
354 353
355 memset(i2o_drivers, 0, i2o_max_drivers * sizeof(*i2o_drivers));
356
357 rc = bus_register(&i2o_bus_type); 354 rc = bus_register(&i2o_bus_type);
358 355
359 if (rc < 0) 356 if (rc < 0)