diff options
author | Eli Billauer <eli.billauer@gmail.com> | 2014-09-04 17:47:48 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-09-08 13:58:19 -0700 |
commit | 40931bbbfe7361d873b235e0667481c47796890a (patch) | |
tree | 143245ba3c2e37ee419f84bc09965b83666e2b2e /drivers/staging/xillybus/xillybus_pcie.c | |
parent | 06bda66b010324604883be715a9f46e857fa5346 (diff) |
staging: xillybus: Fixes related to "rc" variable
"rc" is often used to hold the return value of a function call. This patch
removes unnecessary assignments to this variable, and makes a few related
execution flow improvements.
Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Eli Billauer <eli.billauer@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/xillybus/xillybus_pcie.c')
-rw-r--r-- | drivers/staging/xillybus/xillybus_pcie.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/staging/xillybus/xillybus_pcie.c b/drivers/staging/xillybus/xillybus_pcie.c index 96c2c9f67e0c..371cec318c48 100644 --- a/drivers/staging/xillybus/xillybus_pcie.c +++ b/drivers/staging/xillybus/xillybus_pcie.c @@ -98,7 +98,7 @@ static int xilly_map_single_pci(struct xilly_endpoint *ep, int pci_direction; dma_addr_t addr; struct xilly_mapping *this; - int rc = 0; + int rc; this = kzalloc(sizeof(*this), GFP_KERNEL); if (!this) @@ -121,13 +121,13 @@ static int xilly_map_single_pci(struct xilly_endpoint *ep, *ret_dma_handle = addr; rc = devm_add_action(ep->dev, xilly_pci_unmap, this); - if (rc) { pci_unmap_single(ep->pdev, addr, size, pci_direction); kfree(this); + return rc; } - return rc; + return 0; } static struct xilly_endpoint_hardware pci_hw = { @@ -141,7 +141,7 @@ static int xilly_probe(struct pci_dev *pdev, const struct pci_device_id *ent) { struct xilly_endpoint *endpoint; - int rc = 0; + int rc; endpoint = xillybus_init_endpoint(pdev, &pdev->dev, &pci_hw); @@ -151,7 +151,6 @@ static int xilly_probe(struct pci_dev *pdev, pci_set_drvdata(pdev, endpoint); rc = pcim_enable_device(pdev); - if (rc) { dev_err(endpoint->dev, "pcim_enable_device() failed. Aborting.\n"); @@ -187,7 +186,6 @@ static int xilly_probe(struct pci_dev *pdev, } rc = devm_request_irq(&pdev->dev, pdev->irq, xillybus_isr, 0, xillyname, endpoint); - if (rc) { dev_err(endpoint->dev, "Failed to register MSI handler. Aborting.\n"); |