[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221215182140.129559-3-helgaas@kernel.org>
Date: Thu, 15 Dec 2022 12:21:40 -0600
From: Bjorn Helgaas <helgaas@...nel.org>
To: Kurt Schwemmer <kurt.schwemmer@...rosemi.com>,
Logan Gunthorpe <logang@...tatee.com>
Cc: linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org,
Bjorn Helgaas <bhelgaas@...gle.com>
Subject: [PATCH 2/2] PCI: switchtec: Remove useless assignments in switchtec_dev_read()
From: Bjorn Helgaas <bhelgaas@...gle.com>
Some switchtec_dev_read() error cases assign to "rc", then branch to "out".
But the code at "out" never uses "rc". Drop the useless assignments. No
functional change intended.
Signed-off-by: Bjorn Helgaas <bhelgaas@...gle.com>
---
drivers/pci/switch/switchtec.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/pci/switch/switchtec.c b/drivers/pci/switch/switchtec.c
index d7ae84070e29..c04c7ee35184 100644
--- a/drivers/pci/switch/switchtec.c
+++ b/drivers/pci/switch/switchtec.c
@@ -605,18 +605,14 @@ static ssize_t switchtec_dev_read(struct file *filp, char __user *data,
rc = copy_to_user(data, &stuser->return_code,
sizeof(stuser->return_code));
- if (rc) {
- rc = -EFAULT;
+ if (rc)
goto out;
- }
data += sizeof(stuser->return_code);
rc = copy_to_user(data, &stuser->data,
size - sizeof(stuser->return_code));
- if (rc) {
- rc = -EFAULT;
+ if (rc)
goto out;
- }
stuser_set_state(stuser, MRPC_IDLE);
--
2.25.1
Powered by blists - more mailing lists