From: Markus Elfring <Markus.Elfring@web.de>
To: Andrea della Porta <andrea.porta@suse.com>,
Arnd Bergmann <arnd@arndb.de>,
Bjorn Helgaas <bhelgaas@google.com>,
Florian Fainelli <florian.fainelli@broadcom.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: kernel-janitors@vger.kernel.org,
LKML <linux-kernel@vger.kernel.org>,
Anand Moon <linux.amoon@gmail.com>,
Christophe Jaillet <christophe.jaillet@wanadoo.fr>
Subject: [PATCH] misc: rp1: Omit two variable reassignments in rp1_probe()
Date: Mon, 20 Oct 2025 15:00:13 +0200 [thread overview]
Message-ID: <28b3e6b0-0090-4256-8dd6-5a01fc4bd576@web.de> (raw)
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 20 Oct 2025 14:51:43 +0200
Subject: [PATCH] misc: rp1: Omit two variable reassignments in rp1_probe()
An error code was assigned to a variable and checked accordingly.
This value was passed to a dev_err_probe() call in an if branch.
This function is documented in the way that the same value is returned.
Thus delete two redundant variable reassignments.
The source code was transformed by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/misc/rp1/rp1_pci.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/misc/rp1/rp1_pci.c b/drivers/misc/rp1/rp1_pci.c
index 803832006ec8..3baea1a24549 100644
--- a/drivers/misc/rp1/rp1_pci.c
+++ b/drivers/misc/rp1/rp1_pci.c
@@ -226,8 +226,7 @@ static int rp1_probe(struct pci_dev *pdev, const struct pci_device_id *id)
err = pcim_enable_device(pdev);
if (err < 0) {
- err = dev_err_probe(&pdev->dev, err,
- "Enabling PCI device has failed");
+ dev_err_probe(&pdev->dev, err, "Enabling PCI device has failed");
goto err_put_node;
}
@@ -243,8 +242,7 @@ static int rp1_probe(struct pci_dev *pdev, const struct pci_device_id *id)
err = pci_alloc_irq_vectors(pdev, RP1_INT_END, RP1_INT_END,
PCI_IRQ_MSIX);
if (err < 0) {
- err = dev_err_probe(&pdev->dev, err,
- "Failed to allocate MSI-X vectors\n");
+ dev_err_probe(&pdev->dev, err, "Failed to allocate MSI-X vectors\n");
goto err_put_node;
} else if (err != RP1_INT_END) {
dev_err(&pdev->dev, "Cannot allocate enough interrupts\n");
--
2.51.1
next reply other threads:[~2025-10-20 13:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-20 13:00 Markus Elfring [this message]
2025-10-21 10:13 ` Andrea della Porta
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=28b3e6b0-0090-4256-8dd6-5a01fc4bd576@web.de \
--to=markus.elfring@web.de \
--cc=andrea.porta@suse.com \
--cc=arnd@arndb.de \
--cc=bhelgaas@google.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=florian.fainelli@broadcom.com \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux.amoon@gmail.com \
/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
all inboxes | Powered by JetHome®