git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git]
/
drivers
/
s390
/
net
/
fsm.c
diff --git
a/drivers/s390/net/fsm.c
b/drivers/s390/net/fsm.c
index
fa09440
..
7145e21
100644
(file)
--- a/
drivers/s390/net/fsm.c
+++ b/
drivers/s390/net/fsm.c
@@
-1,6
+1,4
@@
/**
/**
- * $Id: fsm.c,v 1.6 2003/10/15 11:37:29 mschwide Exp $
- *
* A generic FSM based on fsm used in isdn4linux
*
*/
* A generic FSM based on fsm used in isdn4linux
*
*/
@@
-16,45
+14,41
@@
MODULE_LICENSE("GPL");
fsm_instance *
init_fsm(char *name, const char **state_names, const char **event_names, int nr_states,
fsm_instance *
init_fsm(char *name, const char **state_names, const char **event_names, int nr_states,
- int nr_events, const fsm_node *tmpl, int tmpl_len,
in
t order)
+ int nr_events, const fsm_node *tmpl, int tmpl_len,
gfp_
t order)
{
int i;
fsm_instance *this;
fsm_function_t *m;
fsm *f;
{
int i;
fsm_instance *this;
fsm_function_t *m;
fsm *f;
- this =
(fsm_instance *)km
alloc(sizeof(fsm_instance), order);
+ this =
kz
alloc(sizeof(fsm_instance), order);
if (this == NULL) {
printk(KERN_WARNING
"fsm(%s): init_fsm: Couldn't alloc instance\n", name);
return NULL;
}
if (this == NULL) {
printk(KERN_WARNING
"fsm(%s): init_fsm: Couldn't alloc instance\n", name);
return NULL;
}
- memset(this, 0, sizeof(fsm_instance));
strlcpy(this->name, name, sizeof(this->name));
strlcpy(this->name, name, sizeof(this->name));
- f =
(fsm *)km
alloc(sizeof(fsm), order);
+ f =
kz
alloc(sizeof(fsm), order);
if (f == NULL) {
printk(KERN_WARNING
"fsm(%s): init_fsm: Couldn't alloc fsm\n", name);
kfree_fsm(this);
return NULL;
}
if (f == NULL) {
printk(KERN_WARNING
"fsm(%s): init_fsm: Couldn't alloc fsm\n", name);
kfree_fsm(this);
return NULL;
}
- memset(f, 0, sizeof(fsm));
f->nr_events = nr_events;
f->nr_states = nr_states;
f->event_names = event_names;
f->state_names = state_names;
this->f = f;
f->nr_events = nr_events;
f->nr_states = nr_states;
f->event_names = event_names;
f->state_names = state_names;
this->f = f;
- m = (fsm_function_t *)kmalloc(
- sizeof(fsm_function_t) * nr_states * nr_events, order);
+ m = kcalloc(nr_states*nr_events, sizeof(fsm_function_t), order);
if (m == NULL) {
printk(KERN_WARNING
"fsm(%s): init_fsm: Couldn't alloc jumptable\n", name);
kfree_fsm(this);
return NULL;
}
if (m == NULL) {
printk(KERN_WARNING
"fsm(%s): init_fsm: Couldn't alloc jumptable\n", name);
kfree_fsm(this);
return NULL;
}
- memset(m, 0, sizeof(fsm_function_t) * f->nr_states * f->nr_events);
f->jumpmatrix = m;
for (i = 0; i < tmpl_len; i++) {
f->jumpmatrix = m;
for (i = 0; i < tmpl_len; i++) {
@@
-78,8
+72,7
@@
kfree_fsm(fsm_instance *this)
{
if (this) {
if (this->f) {
{
if (this) {
if (this->f) {
- if (this->f->jumpmatrix)
- kfree(this->f->jumpmatrix);
+ kfree(this->f->jumpmatrix);
kfree(this->f);
}
kfree(this);
kfree(this->f);
}
kfree(this);