Commit e80be0b0 authored by Joe Perches's avatar Joe Perches Committed by David S. Miller

vxge: remove unnecessary [kv][mcz]alloc casts

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f3167460
...@@ -1219,8 +1219,7 @@ vxge_hw_device_initialize( ...@@ -1219,8 +1219,7 @@ vxge_hw_device_initialize(
if (status != VXGE_HW_OK) if (status != VXGE_HW_OK)
goto exit; goto exit;
hldev = (struct __vxge_hw_device *) hldev = vzalloc(sizeof(struct __vxge_hw_device));
vzalloc(sizeof(struct __vxge_hw_device));
if (hldev == NULL) { if (hldev == NULL) {
status = VXGE_HW_ERR_OUT_OF_MEMORY; status = VXGE_HW_ERR_OUT_OF_MEMORY;
goto exit; goto exit;
...@@ -2140,8 +2139,7 @@ __vxge_hw_mempool_create( ...@@ -2140,8 +2139,7 @@ __vxge_hw_mempool_create(
goto exit; goto exit;
} }
mempool = (struct vxge_hw_mempool *) mempool = vzalloc(sizeof(struct vxge_hw_mempool));
vzalloc(sizeof(struct vxge_hw_mempool));
if (mempool == NULL) { if (mempool == NULL) {
status = VXGE_HW_ERR_OUT_OF_MEMORY; status = VXGE_HW_ERR_OUT_OF_MEMORY;
goto exit; goto exit;
...@@ -2165,7 +2163,7 @@ __vxge_hw_mempool_create( ...@@ -2165,7 +2163,7 @@ __vxge_hw_mempool_create(
/* allocate array of memblocks */ /* allocate array of memblocks */
mempool->memblocks_arr = mempool->memblocks_arr =
(void **) vzalloc(sizeof(void *) * mempool->memblocks_max); vzalloc(sizeof(void *) * mempool->memblocks_max);
if (mempool->memblocks_arr == NULL) { if (mempool->memblocks_arr == NULL) {
__vxge_hw_mempool_destroy(mempool); __vxge_hw_mempool_destroy(mempool);
status = VXGE_HW_ERR_OUT_OF_MEMORY; status = VXGE_HW_ERR_OUT_OF_MEMORY;
...@@ -2175,7 +2173,7 @@ __vxge_hw_mempool_create( ...@@ -2175,7 +2173,7 @@ __vxge_hw_mempool_create(
/* allocate array of private parts of items per memblocks */ /* allocate array of private parts of items per memblocks */
mempool->memblocks_priv_arr = mempool->memblocks_priv_arr =
(void **) vzalloc(sizeof(void *) * mempool->memblocks_max); vzalloc(sizeof(void *) * mempool->memblocks_max);
if (mempool->memblocks_priv_arr == NULL) { if (mempool->memblocks_priv_arr == NULL) {
__vxge_hw_mempool_destroy(mempool); __vxge_hw_mempool_destroy(mempool);
status = VXGE_HW_ERR_OUT_OF_MEMORY; status = VXGE_HW_ERR_OUT_OF_MEMORY;
...@@ -2184,7 +2182,7 @@ __vxge_hw_mempool_create( ...@@ -2184,7 +2182,7 @@ __vxge_hw_mempool_create(
} }
/* allocate array of memblocks DMA objects */ /* allocate array of memblocks DMA objects */
mempool->memblocks_dma_arr = (struct vxge_hw_mempool_dma *) mempool->memblocks_dma_arr =
vzalloc(sizeof(struct vxge_hw_mempool_dma) * vzalloc(sizeof(struct vxge_hw_mempool_dma) *
mempool->memblocks_max); mempool->memblocks_max);
...@@ -2196,8 +2194,7 @@ __vxge_hw_mempool_create( ...@@ -2196,8 +2194,7 @@ __vxge_hw_mempool_create(
} }
/* allocate hash array of items */ /* allocate hash array of items */
mempool->items_arr = mempool->items_arr = vzalloc(sizeof(void *) * mempool->items_max);
(void **) vzalloc(sizeof(void *) * mempool->items_max);
if (mempool->items_arr == NULL) { if (mempool->items_arr == NULL) {
__vxge_hw_mempool_destroy(mempool); __vxge_hw_mempool_destroy(mempool);
status = VXGE_HW_ERR_OUT_OF_MEMORY; status = VXGE_HW_ERR_OUT_OF_MEMORY;
...@@ -4258,8 +4255,7 @@ vxge_hw_vpath_open(struct __vxge_hw_device *hldev, ...@@ -4258,8 +4255,7 @@ vxge_hw_vpath_open(struct __vxge_hw_device *hldev,
if (status != VXGE_HW_OK) if (status != VXGE_HW_OK)
goto vpath_open_exit1; goto vpath_open_exit1;
vp = (struct __vxge_hw_vpath_handle *) vp = vzalloc(sizeof(struct __vxge_hw_vpath_handle));
vzalloc(sizeof(struct __vxge_hw_vpath_handle));
if (vp == NULL) { if (vp == NULL) {
status = VXGE_HW_ERR_OUT_OF_MEMORY; status = VXGE_HW_ERR_OUT_OF_MEMORY;
goto vpath_open_exit2; goto vpath_open_exit2;
...@@ -5065,8 +5061,7 @@ static void vxge_hw_blockpool_block_add(struct __vxge_hw_device *devh, ...@@ -5065,8 +5061,7 @@ static void vxge_hw_blockpool_block_add(struct __vxge_hw_device *devh,
item); item);
if (entry == NULL) if (entry == NULL)
entry = (struct __vxge_hw_blockpool_entry *) entry = vmalloc(sizeof(struct __vxge_hw_blockpool_entry));
vmalloc(sizeof(struct __vxge_hw_blockpool_entry));
else else
list_del(&entry->item); list_del(&entry->item);
...@@ -5182,8 +5177,7 @@ __vxge_hw_blockpool_free(struct __vxge_hw_device *devh, ...@@ -5182,8 +5177,7 @@ __vxge_hw_blockpool_free(struct __vxge_hw_device *devh,
item); item);
if (entry == NULL) if (entry == NULL)
entry = (struct __vxge_hw_blockpool_entry *) entry = vmalloc(sizeof(
vmalloc(sizeof(
struct __vxge_hw_blockpool_entry)); struct __vxge_hw_blockpool_entry));
else else
list_del(&entry->item); list_del(&entry->item);
......
...@@ -4602,9 +4602,7 @@ vxge_probe(struct pci_dev *pdev, const struct pci_device_id *pre) ...@@ -4602,9 +4602,7 @@ vxge_probe(struct pci_dev *pdev, const struct pci_device_id *pre)
/* Copy the station mac address to the list */ /* Copy the station mac address to the list */
for (i = 0; i < vdev->no_of_vpath; i++) { for (i = 0; i < vdev->no_of_vpath; i++) {
entry = (struct vxge_mac_addrs *) entry = kzalloc(sizeof(struct vxge_mac_addrs), GFP_KERNEL);
kzalloc(sizeof(struct vxge_mac_addrs),
GFP_KERNEL);
if (NULL == entry) { if (NULL == entry) {
vxge_debug_init(VXGE_ERR, vxge_debug_init(VXGE_ERR,
"%s: mac_addr_list : memory allocation failed", "%s: mac_addr_list : memory allocation failed",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment