* [PATCH] PCI: remove uneccessary if() and assignment
@ 2024-09-14 17:45 Guilherme Giacomo Simoes
2024-09-14 18:04 ` Guilherme Giácomo Simões
0 siblings, 1 reply; 2+ messages in thread
From: Guilherme Giacomo Simoes @ 2024-09-14 17:45 UTC (permalink / raw)
To: bhelgaas; +Cc: Guilherme Giacomo Simoes, linux-pci, linux-kernel
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] PCI: remove uneccessary if() and assignment
2024-09-14 17:45 [PATCH] PCI: remove uneccessary if() and assignment Guilherme Giacomo Simoes
@ 2024-09-14 18:04 ` Guilherme Giácomo Simões
0 siblings, 0 replies; 2+ messages in thread
From: Guilherme Giácomo Simões @ 2024-09-14 18:04 UTC (permalink / raw)
To: bhelgaas; +Cc: linux-pci, linux-kernel
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.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-09-14 18:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-14 17:45 [PATCH] PCI: remove uneccessary if() and assignment Guilherme Giacomo Simoes
2024-09-14 18:04 ` Guilherme Giácomo Simões
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.