Commit 78aca3bb authored by YueHaibing's avatar YueHaibing Committed by David S. Miller

vxge: remove set but not used variable 'req_out', 'status' and 'ret'

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/net/ethernet/neterion/vxge/vxge-config.c:1097:6: warning:
 variable 'ret' set but not used [-Wunused-but-set-variable]
drivers/net/ethernet/neterion/vxge/vxge-config.c:2263:6: warning:
 variable 'req_out' set but not used [-Wunused-but-set-variable]
drivers/net/ethernet/neterion/vxge/vxge-config.c:2262:22: warning:
 variable 'status' set but not used [-Wunused-but-set-variable]
drivers/net/ethernet/neterion/vxge/vxge-config.c:2360:22: warning:
 variable 'status' set but not used [-Wunused-but-set-variable]
  enum vxge_hw_status status = VXGE_HW_OK;
Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 29afde50
...@@ -1094,12 +1094,9 @@ static void __vxge_hw_blockpool_destroy(struct __vxge_hw_blockpool *blockpool) ...@@ -1094,12 +1094,9 @@ static void __vxge_hw_blockpool_destroy(struct __vxge_hw_blockpool *blockpool)
{ {
struct __vxge_hw_device *hldev; struct __vxge_hw_device *hldev;
struct list_head *p, *n; struct list_head *p, *n;
u16 ret;
if (blockpool == NULL) { if (!blockpool)
ret = 1; return;
goto exit;
}
hldev = blockpool->hldev; hldev = blockpool->hldev;
...@@ -1122,8 +1119,7 @@ static void __vxge_hw_blockpool_destroy(struct __vxge_hw_blockpool *blockpool) ...@@ -1122,8 +1119,7 @@ static void __vxge_hw_blockpool_destroy(struct __vxge_hw_blockpool *blockpool)
list_del(&((struct __vxge_hw_blockpool_entry *)p)->item); list_del(&((struct __vxge_hw_blockpool_entry *)p)->item);
kfree((void *)p); kfree((void *)p);
} }
ret = 0;
exit:
return; return;
} }
...@@ -2259,14 +2255,11 @@ static void vxge_hw_blockpool_block_add(struct __vxge_hw_device *devh, ...@@ -2259,14 +2255,11 @@ static void vxge_hw_blockpool_block_add(struct __vxge_hw_device *devh,
struct __vxge_hw_blockpool *blockpool; struct __vxge_hw_blockpool *blockpool;
struct __vxge_hw_blockpool_entry *entry = NULL; struct __vxge_hw_blockpool_entry *entry = NULL;
dma_addr_t dma_addr; dma_addr_t dma_addr;
enum vxge_hw_status status = VXGE_HW_OK;
u32 req_out;
blockpool = &devh->block_pool; blockpool = &devh->block_pool;
if (block_addr == NULL) { if (block_addr == NULL) {
blockpool->req_out--; blockpool->req_out--;
status = VXGE_HW_FAIL;
goto exit; goto exit;
} }
...@@ -2276,7 +2269,6 @@ static void vxge_hw_blockpool_block_add(struct __vxge_hw_device *devh, ...@@ -2276,7 +2269,6 @@ static void vxge_hw_blockpool_block_add(struct __vxge_hw_device *devh,
if (unlikely(pci_dma_mapping_error(devh->pdev, dma_addr))) { if (unlikely(pci_dma_mapping_error(devh->pdev, dma_addr))) {
vxge_os_dma_free(devh->pdev, block_addr, &acc_handle); vxge_os_dma_free(devh->pdev, block_addr, &acc_handle);
blockpool->req_out--; blockpool->req_out--;
status = VXGE_HW_FAIL;
goto exit; goto exit;
} }
...@@ -2291,7 +2283,7 @@ static void vxge_hw_blockpool_block_add(struct __vxge_hw_device *devh, ...@@ -2291,7 +2283,7 @@ static void vxge_hw_blockpool_block_add(struct __vxge_hw_device *devh,
else else
list_del(&entry->item); list_del(&entry->item);
if (entry != NULL) { if (entry) {
entry->length = length; entry->length = length;
entry->memblock = block_addr; entry->memblock = block_addr;
entry->dma_addr = dma_addr; entry->dma_addr = dma_addr;
...@@ -2299,13 +2291,10 @@ static void vxge_hw_blockpool_block_add(struct __vxge_hw_device *devh, ...@@ -2299,13 +2291,10 @@ static void vxge_hw_blockpool_block_add(struct __vxge_hw_device *devh,
entry->dma_handle = dma_h; entry->dma_handle = dma_h;
list_add(&entry->item, &blockpool->free_block_list); list_add(&entry->item, &blockpool->free_block_list);
blockpool->pool_size++; blockpool->pool_size++;
status = VXGE_HW_OK; }
} else
status = VXGE_HW_ERR_OUT_OF_MEMORY;
blockpool->req_out--; blockpool->req_out--;
req_out = blockpool->req_out;
exit: exit:
return; return;
} }
...@@ -2357,7 +2346,6 @@ static void *__vxge_hw_blockpool_malloc(struct __vxge_hw_device *devh, u32 size, ...@@ -2357,7 +2346,6 @@ static void *__vxge_hw_blockpool_malloc(struct __vxge_hw_device *devh, u32 size,
struct __vxge_hw_blockpool_entry *entry = NULL; struct __vxge_hw_blockpool_entry *entry = NULL;
struct __vxge_hw_blockpool *blockpool; struct __vxge_hw_blockpool *blockpool;
void *memblock = NULL; void *memblock = NULL;
enum vxge_hw_status status = VXGE_HW_OK;
blockpool = &devh->block_pool; blockpool = &devh->block_pool;
...@@ -2367,10 +2355,8 @@ static void *__vxge_hw_blockpool_malloc(struct __vxge_hw_device *devh, u32 size, ...@@ -2367,10 +2355,8 @@ static void *__vxge_hw_blockpool_malloc(struct __vxge_hw_device *devh, u32 size,
&dma_object->handle, &dma_object->handle,
&dma_object->acc_handle); &dma_object->acc_handle);
if (memblock == NULL) { if (!memblock)
status = VXGE_HW_ERR_OUT_OF_MEMORY;
goto exit; goto exit;
}
dma_object->addr = pci_map_single(devh->pdev, memblock, size, dma_object->addr = pci_map_single(devh->pdev, memblock, size,
PCI_DMA_BIDIRECTIONAL); PCI_DMA_BIDIRECTIONAL);
...@@ -2379,7 +2365,6 @@ static void *__vxge_hw_blockpool_malloc(struct __vxge_hw_device *devh, u32 size, ...@@ -2379,7 +2365,6 @@ static void *__vxge_hw_blockpool_malloc(struct __vxge_hw_device *devh, u32 size,
dma_object->addr))) { dma_object->addr))) {
vxge_os_dma_free(devh->pdev, memblock, vxge_os_dma_free(devh->pdev, memblock,
&dma_object->acc_handle); &dma_object->acc_handle);
status = VXGE_HW_ERR_OUT_OF_MEMORY;
goto exit; goto exit;
} }
......
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