diff options
author | Markus Lidel <Markus.Lidel@shadowconnect.com> | 2006-01-06 03:19:33 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-06 11:33:54 -0500 |
commit | f6ed39a6e1a88240eec629a3da17c3a47ada3b89 (patch) | |
tree | b19fee742b48865b94bb26ed4428ca00a1a95b2c /drivers/message/i2o/iop.c | |
parent | 2e1973a3cd0b9fe31469be62df3583bdc5a34f51 (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/iop.c')
-rw-r--r-- | drivers/message/i2o/iop.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/drivers/message/i2o/iop.c b/drivers/message/i2o/iop.c index 0e465186196c..492167446936 100644 --- a/drivers/message/i2o/iop.c +++ b/drivers/message/i2o/iop.c | |||
@@ -32,7 +32,7 @@ | |||
32 | #include "core.h" | 32 | #include "core.h" |
33 | 33 | ||
34 | #define OSM_NAME "i2o" | 34 | #define OSM_NAME "i2o" |
35 | #define OSM_VERSION "1.316" | 35 | #define OSM_VERSION "1.325" |
36 | #define OSM_DESCRIPTION "I2O subsystem" | 36 | #define OSM_DESCRIPTION "I2O subsystem" |
37 | 37 | ||
38 | /* global I2O controller list */ | 38 | /* global I2O controller list */ |
@@ -838,12 +838,11 @@ static int i2o_systab_build(void) | |||
838 | i2o_systab.len = sizeof(struct i2o_sys_tbl) + num_controllers * | 838 | i2o_systab.len = sizeof(struct i2o_sys_tbl) + num_controllers * |
839 | sizeof(struct i2o_sys_tbl_entry); | 839 | sizeof(struct i2o_sys_tbl_entry); |
840 | 840 | ||
841 | systab = i2o_systab.virt = kmalloc(i2o_systab.len, GFP_KERNEL); | 841 | systab = i2o_systab.virt = kzalloc(i2o_systab.len, GFP_KERNEL); |
842 | if (!systab) { | 842 | if (!systab) { |
843 | osm_err("unable to allocate memory for System Table\n"); | 843 | osm_err("unable to allocate memory for System Table\n"); |
844 | return -ENOMEM; | 844 | return -ENOMEM; |
845 | } | 845 | } |
846 | memset(systab, 0, i2o_systab.len); | ||
847 | 846 | ||
848 | systab->version = I2OVERSION; | 847 | systab->version = I2OVERSION; |
849 | systab->change_ind = change_ind + 1; | 848 | systab->change_ind = change_ind + 1; |
@@ -1020,16 +1019,6 @@ static int i2o_hrt_get(struct i2o_controller *c) | |||
1020 | } | 1019 | } |
1021 | 1020 | ||
1022 | /** | 1021 | /** |
1023 | * i2o_iop_free - Free the i2o_controller struct | ||
1024 | * @c: I2O controller to free | ||
1025 | */ | ||
1026 | void i2o_iop_free(struct i2o_controller *c) | ||
1027 | { | ||
1028 | i2o_pool_free(&c->in_msg); | ||
1029 | kfree(c); | ||
1030 | }; | ||
1031 | |||
1032 | /** | ||
1033 | * i2o_iop_release - release the memory for a I2O controller | 1022 | * i2o_iop_release - release the memory for a I2O controller |
1034 | * @dev: I2O controller which should be released | 1023 | * @dev: I2O controller which should be released |
1035 | * | 1024 | * |
@@ -1058,13 +1047,12 @@ struct i2o_controller *i2o_iop_alloc(void) | |||
1058 | struct i2o_controller *c; | 1047 | struct i2o_controller *c; |
1059 | char poolname[32]; | 1048 | char poolname[32]; |
1060 | 1049 | ||
1061 | c = kmalloc(sizeof(*c), GFP_KERNEL); | 1050 | c = kzalloc(sizeof(*c), GFP_KERNEL); |
1062 | if (!c) { | 1051 | if (!c) { |
1063 | osm_err("i2o: Insufficient memory to allocate a I2O controller." | 1052 | osm_err("i2o: Insufficient memory to allocate a I2O controller." |
1064 | "\n"); | 1053 | "\n"); |
1065 | return ERR_PTR(-ENOMEM); | 1054 | return ERR_PTR(-ENOMEM); |
1066 | } | 1055 | } |
1067 | memset(c, 0, sizeof(*c)); | ||
1068 | 1056 | ||
1069 | c->unit = unit++; | 1057 | c->unit = unit++; |
1070 | sprintf(c->name, "iop%d", c->unit); | 1058 | sprintf(c->name, "iop%d", c->unit); |