From 8551158abc8ef45a7f473a87e69624d05ebfd684 Mon Sep 17 00:00:00 2001 From: Stefan Richter Date: Mon, 7 Nov 2005 06:31:45 -0500 Subject: kmalloc/kzalloc changes: dv1394, eth1394, ieee1394, ohci1394, pcilynx, raw1394, sbp2c, video1394: - use kzalloc - provide safer size arguments to kmalloc and kzalloc - omit some casts Signed-off-by: Stefan Richter Signed-off-by: Jody McIntyre --- drivers/ieee1394/highlevel.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'drivers/ieee1394/highlevel.c') diff --git a/drivers/ieee1394/highlevel.c b/drivers/ieee1394/highlevel.c index 997e1bf6297..734b121a055 100644 --- a/drivers/ieee1394/highlevel.c +++ b/drivers/ieee1394/highlevel.c @@ -101,12 +101,10 @@ void *hpsb_create_hostinfo(struct hpsb_highlevel *hl, struct hpsb_host *host, return NULL; } - hi = kmalloc(sizeof(*hi) + data_size, GFP_ATOMIC); + hi = kzalloc(sizeof(*hi) + data_size, GFP_ATOMIC); if (!hi) return NULL; - memset(hi, 0, sizeof(*hi) + data_size); - if (data_size) { data = hi->data = hi + 1; hi->size = data_size; @@ -326,11 +324,9 @@ u64 hpsb_allocate_and_register_addrspace(struct hpsb_highlevel *hl, return retval; } - as = (struct hpsb_address_serve *) - kmalloc(sizeof(struct hpsb_address_serve), GFP_KERNEL); - if (as == NULL) { + as = kmalloc(sizeof(*as), GFP_KERNEL); + if (!as) return retval; - } INIT_LIST_HEAD(&as->host_list); INIT_LIST_HEAD(&as->hl_list); @@ -383,11 +379,9 @@ int hpsb_register_addrspace(struct hpsb_highlevel *hl, struct hpsb_host *host, return 0; } - as = (struct hpsb_address_serve *) - kmalloc(sizeof(struct hpsb_address_serve), GFP_ATOMIC); - if (as == NULL) { - return 0; - } + as = kmalloc(sizeof(*as), GFP_ATOMIC); + if (!as) + return 0; INIT_LIST_HEAD(&as->host_list); INIT_LIST_HEAD(&as->hl_list); -- cgit v1.2.3-18-g5258