PCI: Remove redundant initialization of variable rc
Subsystems (2)
PATCH 1/1 PCI: Remove redundant initialization of variable rc
From: Colin Ian King <[email protected]>
The variable rc is being initialized with a value that is never read, it is being updated later on. The assignment is redundant and can be removed.
Addresses-Coverity: ("Unused value")
--- drivers/pci/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/pci.c +1 -1
@@ -5288,7 +5288,7 @@ const struct attribute_group pci_dev_reset_method_attr_group = {*/ int __pci_reset_function_locked (struct pci_dev *dev) { -int i, m, rc = -ENOTTY ; +int i, m, rc;might_sleep ();
Signature · 1 line
2.32.0
Hi Colin,
Quoted 14 lines
The variable rc is being initialized with a value that is never read, it is being updated later on. The assignment is redundant and can be removed.
Addresses-Coverity: ("Unused value")
Signed-off-by Colin Ian King <[email protected]>--- drivers/pci/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/pci/pci.c +0
-0
drivers/pci/pci.c const struct attribute_group pci_dev_reset_method_attr_group = { · line 5291
Quoted 5 lines
drivers/pci/pci.c +1
-1@@ -5288,7 +5288,7 @@ const struct attribute_group pci_dev_reset_method_attr_group = {*/ int __pci_reset_function_locked (struct pci_dev *dev) { -int i, m, rc = -ENOTTY ; +int i, m, rc;
Thank you!
Krzysztof
Quoted 7 lines · Colin King
From: Colin Ian King <[email protected]>
The variable rc is being initialized with a value that is never read, it is being updated later on. The assignment is redundant and can be removed.
Addresses-Coverity: ("Unused value")
Signed-off-by Colin Ian King <[email protected]>
Applied with Krzysztof's reviewed-by to pci/misc for v5.16, thanks!
Quoted 20 lines
--- drivers/pci/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/pci/pci.c +1
-1@@ -5288,7 +5288,7 @@ const struct attribute_group pci_dev_reset_method_attr_group = {*/ int __pci_reset_function_locked (struct pci_dev *dev) { -int i, m, rc = -ENOTTY ; +int i, m, rc;might_sleep ();Signature · 1 line
2.32.0