Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f6ed39a6 authored by Markus Lidel's avatar Markus Lidel Committed by Linus Torvalds
Browse files

[PATCH] I2O: Optimizing



- make i2o_iop_free() static inline (from Adrian Bunk)

- changed kmalloc() + memset(0) into kzalloc()

Signed-off-by: default avatarMarkus Lidel <Markus.Lidel@shadowconnect.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 2e1973a3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@
#include <asm/uaccess.h>

#define OSM_NAME	"config-osm"
#define OSM_VERSION	"1.317"
#define OSM_VERSION	"1.323"
#define OSM_DESCRIPTION	"I2O Configuration OSM"

/* access mode user rw */
+10 −1
Original line number Diff line number Diff line
@@ -40,7 +40,16 @@ extern int i2o_device_parse_lct(struct i2o_controller *);

/* IOP */
extern struct i2o_controller *i2o_iop_alloc(void);
extern void i2o_iop_free(struct i2o_controller *);

/**
 *	i2o_iop_free - Free the i2o_controller struct
 *	@c: I2O controller to free
 */
static inline void i2o_iop_free(struct i2o_controller *c)
{
	i2o_pool_free(&c->in_msg);
	kfree(c);
}

extern int i2o_iop_add(struct i2o_controller *);
extern void i2o_iop_remove(struct i2o_controller *);
+1 −3
Original line number Diff line number Diff line
@@ -195,12 +195,10 @@ static struct i2o_device *i2o_device_alloc(void)
{
	struct i2o_device *dev;

	dev = kmalloc(sizeof(*dev), GFP_KERNEL);
	dev = kzalloc(sizeof(*dev), GFP_KERNEL);
	if (!dev)
		return ERR_PTR(-ENOMEM);

	memset(dev, 0, sizeof(*dev));

	INIT_LIST_HEAD(&dev->list);
	init_MUTEX(&dev->lock);

+2 −5
Original line number Diff line number Diff line
@@ -217,10 +217,9 @@ int i2o_driver_dispatch(struct i2o_controller *c, u32 m)
		/* cut of header from message size (in 32-bit words) */
		size = (le32_to_cpu(msg->u.head[0]) >> 16) - 5;

		evt = kmalloc(size * 4 + sizeof(*evt), GFP_ATOMIC);
		evt = kzalloc(size * 4 + sizeof(*evt), GFP_ATOMIC);
		if (!evt)
			return -ENOMEM;
		memset(evt, 0, size * 4 + sizeof(*evt));

		evt->size = size;
		evt->tcntxt = le32_to_cpu(msg->u.s.tcntxt);
@@ -348,12 +347,10 @@ int __init i2o_driver_init(void)
	osm_info("max drivers = %d\n", i2o_max_drivers);

	i2o_drivers =
	    kmalloc(i2o_max_drivers * sizeof(*i2o_drivers), GFP_KERNEL);
	    kzalloc(i2o_max_drivers * sizeof(*i2o_drivers), GFP_KERNEL);
	if (!i2o_drivers)
		return -ENOMEM;

	memset(i2o_drivers, 0, i2o_max_drivers * sizeof(*i2o_drivers));

	rc = bus_register(&i2o_bus_type);

	if (rc < 0)
+1 −3
Original line number Diff line number Diff line
@@ -75,12 +75,10 @@ static struct i2o_exec_wait *i2o_exec_wait_alloc(void)
{
	struct i2o_exec_wait *wait;

	wait = kmalloc(sizeof(*wait), GFP_KERNEL);
	wait = kzalloc(sizeof(*wait), GFP_KERNEL);
	if (!wait)
		return NULL;

	memset(wait, 0, sizeof(*wait));

	INIT_LIST_HEAD(&wait->list);

	return wait;
Loading