diff mbox series

PCI: remove uneccessary if() and assignment

Message ID 20240914174554.98975-1-trintaeoitogc@gmail.com (mailing list archive)
State Rejected
Delegated to: Krzysztof Wilczyński
Headers show
Series PCI: remove uneccessary if() and assignment | expand

Commit Message

Guilherme Giácomo Simões Sept. 14, 2024, 5:45 p.m. UTC
This second if is uneccesary, because, the first if is equals.
The assignment os return pci_revert_fw_address() to ret variable is uneccessary to.
Then, the second if() was removed and the return function is the return of pci_revert_fw_address()

Signed-off-by: Guilherme Giacomo Simoes <trintaeoitogc@gmail.com>
---
 drivers/pci/setup-res.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

Comments

Guilherme Giácomo Simões Sept. 14, 2024, 6:04 p.m. UTC | #1
Guilherme Giacomo Simoes <trintaeoitogc@gmail.com> wrotes:
>
> This second if is uneccesary, because, the first if is equals.
> The assignment os return pci_revert_fw_address() to ret variable is uneccessary to.
> Then, the second if() was removed and the return function is the return of pci_revert_fw_address()
>
> Signed-off-by: Guilherme Giacomo Simoes <trintaeoitogc@gmail.com>
> ---
>  drivers/pci/setup-res.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c
> index c6d933ddfd46..8ca1007cb6b3 100644
> --- a/drivers/pci/setup-res.c
> +++ b/drivers/pci/setup-res.c
> @@ -352,12 +352,7 @@ int pci_assign_resource(struct pci_dev *dev, int resno)
>          */
>         if (ret < 0) {
>                 pci_info(dev, "%s %pR: can't assign; no space\n", res_name, res);
> -               ret = pci_revert_fw_address(res, dev, resno, size);
> -       }
> -
> -       if (ret < 0) {
> -               pci_info(dev, "%s %pR: failed to assign\n", res_name, res);
> -               return ret;
> +               return pci_revert_fw_address(res, dev, resno, size);
>         }
>
>         res->flags &= ~IORESOURCE_UNSET;
> --
> 2.46.0
>

Please disregard this patch.
diff mbox series

Patch

diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c
index c6d933ddfd46..8ca1007cb6b3 100644
--- a/drivers/pci/setup-res.c
+++ b/drivers/pci/setup-res.c
@@ -352,12 +352,7 @@  int pci_assign_resource(struct pci_dev *dev, int resno)
 	 */
 	if (ret < 0) {
 		pci_info(dev, "%s %pR: can't assign; no space\n", res_name, res);
-		ret = pci_revert_fw_address(res, dev, resno, size);
-	}
-
-	if (ret < 0) {
-		pci_info(dev, "%s %pR: failed to assign\n", res_name, res);
-		return ret;
+		return pci_revert_fw_address(res, dev, resno, size);
 	}
 
 	res->flags &= ~IORESOURCE_UNSET;