aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/qlcnic
diff options
context:
space:
mode:
authorJulia Lawall <julia@diku.dk>2010-08-16 06:23:51 -0400
committerDavid S. Miller <davem@davemloft.net>2010-08-18 17:26:32 -0400
commit900853a4db7098b0e58ddcb732632ac43a7b2148 (patch)
tree9152ef81c79caef6434f077db7b3bf5794e45f96 /drivers/net/qlcnic
parent49339ccae5ba361b62e829886117dbce4b77194f (diff)
drivers/net/qlcnic: Use available error codes
The error code is stored in the variable err, but it is the variable ret that is returned instead. So store the error code in ret. Err is then useless. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r@ local idexpression x; constant C; @@ if (...) { ... x = -C ... when != x ( return <+...x...+>; | return NULL; | return; | * return ...; ) } // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/qlcnic')
-rw-r--r--drivers/net/qlcnic/qlcnic_main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c
index abd7cd6db6f..384cc52a9c3 100644
--- a/drivers/net/qlcnic/qlcnic_main.c
+++ b/drivers/net/qlcnic/qlcnic_main.c
@@ -474,7 +474,7 @@ static int
474qlcnic_init_pci_info(struct qlcnic_adapter *adapter) 474qlcnic_init_pci_info(struct qlcnic_adapter *adapter)
475{ 475{
476 struct qlcnic_pci_info *pci_info; 476 struct qlcnic_pci_info *pci_info;
477 int i, ret = 0, err; 477 int i, ret = 0;
478 u8 pfn; 478 u8 pfn;
479 479
480 pci_info = kcalloc(QLCNIC_MAX_PCI_FUNC, sizeof(*pci_info), GFP_KERNEL); 480 pci_info = kcalloc(QLCNIC_MAX_PCI_FUNC, sizeof(*pci_info), GFP_KERNEL);
@@ -484,14 +484,14 @@ qlcnic_init_pci_info(struct qlcnic_adapter *adapter)
484 adapter->npars = kzalloc(sizeof(struct qlcnic_npar_info) * 484 adapter->npars = kzalloc(sizeof(struct qlcnic_npar_info) *
485 QLCNIC_MAX_PCI_FUNC, GFP_KERNEL); 485 QLCNIC_MAX_PCI_FUNC, GFP_KERNEL);
486 if (!adapter->npars) { 486 if (!adapter->npars) {
487 err = -ENOMEM; 487 ret = -ENOMEM;
488 goto err_pci_info; 488 goto err_pci_info;
489 } 489 }
490 490
491 adapter->eswitch = kzalloc(sizeof(struct qlcnic_eswitch) * 491 adapter->eswitch = kzalloc(sizeof(struct qlcnic_eswitch) *
492 QLCNIC_NIU_MAX_XG_PORTS, GFP_KERNEL); 492 QLCNIC_NIU_MAX_XG_PORTS, GFP_KERNEL);
493 if (!adapter->eswitch) { 493 if (!adapter->eswitch) {
494 err = -ENOMEM; 494 ret = -ENOMEM;
495 goto err_npars; 495 goto err_npars;
496 } 496 }
497 497