diff options
author | Panagiotis Issaris <takis@issaris.org> | 2006-07-21 14:51:30 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-07-21 14:51:30 -0700 |
commit | 0da974f4f303a6842516b764507e3c0a03f41e5a (patch) | |
tree | 8872aec792f02040269c6769dd1009b20f71d186 /net/irda/irttp.c | |
parent | a0ee7c70b22f78593957f99faa06acb4747b8bc0 (diff) | |
download | blackbird-op-linux-0da974f4f303a6842516b764507e3c0a03f41e5a.tar.gz blackbird-op-linux-0da974f4f303a6842516b764507e3c0a03f41e5a.zip |
[NET]: Conversions from kmalloc+memset to k(z|c)alloc.
Signed-off-by: Panagiotis Issaris <takis@issaris.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/irda/irttp.c')
-rw-r--r-- | net/irda/irttp.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/net/irda/irttp.c b/net/irda/irttp.c index 7a3ccb8a6698..42acf1cde737 100644 --- a/net/irda/irttp.c +++ b/net/irda/irttp.c @@ -85,10 +85,9 @@ static pi_param_info_t param_info = { pi_major_call_table, 1, 0x0f, 4 }; */ int __init irttp_init(void) { - irttp = kmalloc(sizeof(struct irttp_cb), GFP_KERNEL); + irttp = kzalloc(sizeof(struct irttp_cb), GFP_KERNEL); if (irttp == NULL) return -ENOMEM; - memset(irttp, 0, sizeof(struct irttp_cb)); irttp->magic = TTP_MAGIC; @@ -390,12 +389,11 @@ struct tsap_cb *irttp_open_tsap(__u8 stsap_sel, int credit, notify_t *notify) return NULL; } - self = kmalloc(sizeof(struct tsap_cb), GFP_ATOMIC); + self = kzalloc(sizeof(struct tsap_cb), GFP_ATOMIC); if (self == NULL) { IRDA_DEBUG(0, "%s(), unable to kmalloc!\n", __FUNCTION__); return NULL; } - memset(self, 0, sizeof(struct tsap_cb)); spin_lock_init(&self->lock); /* Initialise todo timer */ @@ -1877,7 +1875,7 @@ static int irttp_seq_open(struct inode *inode, struct file *file) int rc = -ENOMEM; struct irttp_iter_state *s; - s = kmalloc(sizeof(*s), GFP_KERNEL); + s = kzalloc(sizeof(*s), GFP_KERNEL); if (!s) goto out; @@ -1887,7 +1885,6 @@ static int irttp_seq_open(struct inode *inode, struct file *file) seq = file->private_data; seq->private = s; - memset(s, 0, sizeof(*s)); out: return rc; out_kfree: |