From: Guilherme Giacomo Simoes <trintaeoitogc@gmail.com>
To: bhelgaas@google.com
Cc: Guilherme Giacomo Simoes <trintaeoitogc@gmail.com>,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] PCI: remove uneccessary if() and assignment
Date: Sat, 14 Sep 2024 14:45:53 -0300 [thread overview]
Message-ID: <20240914174554.98975-1-trintaeoitogc@gmail.com> (raw)
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
next reply other threads:[~2024-09-14 17:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-14 17:45 Guilherme Giacomo Simoes [this message]
2024-09-14 18:04 ` [PATCH] PCI: remove uneccessary if() and assignment Guilherme Giácomo Simões
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240914174554.98975-1-trintaeoitogc@gmail.com \
--to=trintaeoitogc@gmail.com \
--cc=bhelgaas@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox