dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] agp/amd64: remove redundant assignment to variable i
@ 2023-10-23 13:27 Colin Ian King
  0 siblings, 0 replies; 2+ messages in thread
From: Colin Ian King @ 2023-10-23 13:27 UTC (permalink / raw)
  To: David Airlie, dri-devel; +Cc: kernel-janitors, linux-kernel

The variable i is being initialized to 0 and then again in the
following for-loop. The initialization outside the for-loop is
redundant and can be removed.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/char/agp/amd64-agp.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c
index ce8651436609..47bd3b8a54b4 100644
--- a/drivers/char/agp/amd64-agp.c
+++ b/drivers/char/agp/amd64-agp.c
@@ -333,7 +333,6 @@ static int cache_nbs(struct pci_dev *pdev, u32 cap_ptr)
 	if (!amd_nb_has_feature(AMD_NB_GART))
 		return -ENODEV;
 
-	i = 0;
 	for (i = 0; i < amd_nb_num(); i++) {
 		struct pci_dev *dev = node_to_amd_nb(i)->misc;
 		if (fix_northbridge(dev, pdev, cap_ptr) < 0) {
-- 
2.39.2


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

* [PATCH][next] agp/amd64: remove redundant assignment to variable i
@ 2024-02-15 22:48 Colin Ian King
  0 siblings, 0 replies; 2+ messages in thread
From: Colin Ian King @ 2024-02-15 22:48 UTC (permalink / raw)
  To: David Airlie, dri-devel; +Cc: kernel-janitors, linux-kernel

The variable i is being initialized with a value that is never read,
it is being re-assigned in the next for-loop statement. The
initialization is redundant and can be removed.

Cleans up clang scan build warning:
drivers/char/agp/amd64-agp.c:336:2: warning: Value stored to 'i' is
never read [deadcode.DeadStores]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/char/agp/amd64-agp.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c
index ce8651436609..47bd3b8a54b4 100644
--- a/drivers/char/agp/amd64-agp.c
+++ b/drivers/char/agp/amd64-agp.c
@@ -333,7 +333,6 @@ static int cache_nbs(struct pci_dev *pdev, u32 cap_ptr)
 	if (!amd_nb_has_feature(AMD_NB_GART))
 		return -ENODEV;
 
-	i = 0;
 	for (i = 0; i < amd_nb_num(); i++) {
 		struct pci_dev *dev = node_to_amd_nb(i)->misc;
 		if (fix_northbridge(dev, pdev, cap_ptr) < 0) {
-- 
2.39.2


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

end of thread, other threads:[~2024-02-15 22:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-23 13:27 [PATCH][next] agp/amd64: remove redundant assignment to variable i Colin Ian King
2024-02-15 22:48 Colin Ian King

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).