LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] PCI: Remove redundant initialization of variable rc
@ 2021-09-10 16:14 Colin King
  2021-09-15  1:23 ` Krzysztof Wilczyński
  2021-10-26 21:35 ` Bjorn Helgaas
  0 siblings, 2 replies; 3+ messages in thread
From: Colin King @ 2021-09-10 16:14 UTC (permalink / raw)
  To: Bjorn Helgaas, linux-pci; +Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

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 <colin.king@canonical.com>
---
 drivers/pci/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index ce2ab62b64cf..cd8cb94cc450 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -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();
 
-- 
2.32.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] PCI: Remove redundant initialization of variable rc
  2021-09-10 16:14 [PATCH] PCI: Remove redundant initialization of variable rc Colin King
@ 2021-09-15  1:23 ` Krzysztof Wilczyński
  2021-10-26 21:35 ` Bjorn Helgaas
  1 sibling, 0 replies; 3+ messages in thread
From: Krzysztof Wilczyński @ 2021-09-15  1:23 UTC (permalink / raw)
  To: Colin King; +Cc: Bjorn Helgaas, linux-pci, kernel-janitors, linux-kernel

Hi Colin,

> 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 <colin.king@canonical.com>
> ---
>  drivers/pci/pci.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> index ce2ab62b64cf..cd8cb94cc450 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -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!

Reviewed-by: Krzysztof Wilczyński <kw@linux.com>

	Krzysztof

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] PCI: Remove redundant initialization of variable rc
  2021-09-10 16:14 [PATCH] PCI: Remove redundant initialization of variable rc Colin King
  2021-09-15  1:23 ` Krzysztof Wilczyński
@ 2021-10-26 21:35 ` Bjorn Helgaas
  1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Helgaas @ 2021-10-26 21:35 UTC (permalink / raw)
  To: Colin King; +Cc: Bjorn Helgaas, linux-pci, kernel-janitors, linux-kernel

On Fri, Sep 10, 2021 at 05:14:17PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> 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 <colin.king@canonical.com>

Applied with Krzysztof's reviewed-by to pci/misc for v5.16, thanks!

> ---
>  drivers/pci/pci.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> index ce2ab62b64cf..cd8cb94cc450 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -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();
>  
> -- 
> 2.32.0
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-26 21:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-10 16:14 [PATCH] PCI: Remove redundant initialization of variable rc Colin King
2021-09-15  1:23 ` Krzysztof Wilczyński
2021-10-26 21:35 ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).