Messages in this thread Patch in this message |  | | From | Bjorn Helgaas <> | Subject | [PATCH 2/2] PCI: switchtec: Remove useless assignments in switchtec_dev_read() | Date | Thu, 15 Dec 2022 12:21:40 -0600 |
| |
From: Bjorn Helgaas <bhelgaas@google.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@google.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
|  |