diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2005-11-07 06:31:45 -0500 |
---|---|---|
committer | Jody McIntyre <scjody@modernduck.com> | 2005-11-07 06:31:45 -0500 |
commit | 8551158abc8ef45a7f473a87e69624d05ebfd684 (patch) | |
tree | 47cd79c5f5444c7cac812d797764f203207345a7 /drivers/ieee1394/csr1212.c | |
parent | 7afa1467761f06bd9649efd66a4a6b3ff9f29a1f (diff) |
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 <stefanr@s5r6.in-berlin.de>
Signed-off-by: Jody McIntyre <scjody@modernduck.com>
Diffstat (limited to 'drivers/ieee1394/csr1212.c')
-rw-r--r-- | drivers/ieee1394/csr1212.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/ieee1394/csr1212.c b/drivers/ieee1394/csr1212.c index 61ddd5d37eff..c0f8ed6fca8a 100644 --- a/drivers/ieee1394/csr1212.c +++ b/drivers/ieee1394/csr1212.c | |||
@@ -1261,7 +1261,7 @@ static int csr1212_parse_bus_info_block(struct csr1212_csr *csr) | |||
1261 | return CSR1212_EINVAL; | 1261 | return CSR1212_EINVAL; |
1262 | #endif | 1262 | #endif |
1263 | 1263 | ||
1264 | cr = CSR1212_MALLOC(sizeof(struct csr1212_cache_region)); | 1264 | cr = CSR1212_MALLOC(sizeof(*cr)); |
1265 | if (!cr) | 1265 | if (!cr) |
1266 | return CSR1212_ENOMEM; | 1266 | return CSR1212_ENOMEM; |
1267 | 1267 | ||
@@ -1393,8 +1393,7 @@ int csr1212_parse_keyval(struct csr1212_keyval *kv, | |||
1393 | case CSR1212_KV_TYPE_LEAF: | 1393 | case CSR1212_KV_TYPE_LEAF: |
1394 | if (kv->key.id != CSR1212_KV_ID_EXTENDED_ROM) { | 1394 | if (kv->key.id != CSR1212_KV_ID_EXTENDED_ROM) { |
1395 | kv->value.leaf.data = CSR1212_MALLOC(quads_to_bytes(kvi_len)); | 1395 | kv->value.leaf.data = CSR1212_MALLOC(quads_to_bytes(kvi_len)); |
1396 | if (!kv->value.leaf.data) | 1396 | if (!kv->value.leaf.data) { |
1397 | { | ||
1398 | ret = CSR1212_ENOMEM; | 1397 | ret = CSR1212_ENOMEM; |
1399 | goto fail; | 1398 | goto fail; |
1400 | } | 1399 | } |
@@ -1462,7 +1461,7 @@ int _csr1212_read_keyval(struct csr1212_csr *csr, struct csr1212_keyval *kv) | |||
1462 | cache->next = NULL; | 1461 | cache->next = NULL; |
1463 | csr->cache_tail = cache; | 1462 | csr->cache_tail = cache; |
1464 | cache->filled_head = | 1463 | cache->filled_head = |
1465 | CSR1212_MALLOC(sizeof(struct csr1212_cache_region)); | 1464 | CSR1212_MALLOC(sizeof(*cache->filled_head)); |
1466 | if (!cache->filled_head) { | 1465 | if (!cache->filled_head) { |
1467 | return CSR1212_ENOMEM; | 1466 | return CSR1212_ENOMEM; |
1468 | } | 1467 | } |
@@ -1484,7 +1483,7 @@ int _csr1212_read_keyval(struct csr1212_csr *csr, struct csr1212_keyval *kv) | |||
1484 | /* Now seach read portions of the cache to see if it is there. */ | 1483 | /* Now seach read portions of the cache to see if it is there. */ |
1485 | for (cr = cache->filled_head; cr; cr = cr->next) { | 1484 | for (cr = cache->filled_head; cr; cr = cr->next) { |
1486 | if (cache_index < cr->offset_start) { | 1485 | if (cache_index < cr->offset_start) { |
1487 | newcr = CSR1212_MALLOC(sizeof(struct csr1212_cache_region)); | 1486 | newcr = CSR1212_MALLOC(sizeof(*newcr)); |
1488 | if (!newcr) | 1487 | if (!newcr) |
1489 | return CSR1212_ENOMEM; | 1488 | return CSR1212_ENOMEM; |
1490 | 1489 | ||
@@ -1508,7 +1507,7 @@ int _csr1212_read_keyval(struct csr1212_csr *csr, struct csr1212_keyval *kv) | |||
1508 | 1507 | ||
1509 | if (!cr) { | 1508 | if (!cr) { |
1510 | cr = cache->filled_tail; | 1509 | cr = cache->filled_tail; |
1511 | newcr = CSR1212_MALLOC(sizeof(struct csr1212_cache_region)); | 1510 | newcr = CSR1212_MALLOC(sizeof(*newcr)); |
1512 | if (!newcr) | 1511 | if (!newcr) |
1513 | return CSR1212_ENOMEM; | 1512 | return CSR1212_ENOMEM; |
1514 | 1513 | ||