summary refs log tree commit diff
path: root/drivers/pci/proc.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2022-03-13 14:29:29 -0500
committerBjorn Helgaas <bhelgaas@google.com>2022-03-22 11:23:53 -0500
commitc50762a85da6a95a96a20043ed518264b62b47df (patch)
treec53b677142a4960b6dd06e9352a0b6fb5a1e6e7e /drivers/pci/proc.c
parentcb2d0f846139b620ff2d11da15daa0eeb581d1a6 (diff)
downloadlinux-c50762a85da6a95a96a20043ed518264b62b47df.tar.gz
PCI: Remove unused assignments
Remove variables and assignments that are never used.

Found by Krzysztof using cppcheck, e.g.,

  $ cppcheck --enable=all --force
  uselessAssignmentPtrArg drivers/pci/proc.c:102 Assignment of function parameter has no effect outside the function. Did you forget dereferencing it?
  unreadVariable drivers/pci/setup-bus.c:1528 Variable 'old_flags' is assigned a value that is never used.

Reported-by: Krzysztof WilczyƄski <kw@linux.com>
Link: https://lore.kernel.org/r/20220313192933.434746-2-helgaas@kernel.org
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/proc.c')
-rw-r--r--drivers/pci/proc.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/drivers/pci/proc.c b/drivers/pci/proc.c
index 1a5b75399aa5..31b26d8ea6cc 100644
--- a/drivers/pci/proc.c
+++ b/drivers/pci/proc.c
@@ -99,9 +99,7 @@ static ssize_t proc_bus_pci_read(struct file *file, char __user *buf,
 		unsigned char val;
 		pci_user_read_config_byte(dev, pos, &val);
 		__put_user(val, buf);
-		buf++;
 		pos++;
-		cnt--;
 	}
 
 	pci_config_pm_runtime_put(dev);
@@ -176,9 +174,7 @@ static ssize_t proc_bus_pci_write(struct file *file, const char __user *buf,
 		unsigned char val;
 		__get_user(val, buf);
 		pci_user_write_config_byte(dev, pos, val);
-		buf++;
 		pos++;
-		cnt--;
 	}
 
 	pci_config_pm_runtime_put(dev);