amd64-agp: remove redundant assignment to variable i
Subsystems (2)
PATCH 1/1 amd64-agp: remove redundant assignment to variable i
Variable i is being assigned a value that is never read, it is being re-assigned later in a for-loop. The assignment 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 <[email protected]>
--- drivers/char/agp/amd64-agp.c | 1 - 1 file changed, 1 deletion(-)
drivers/char/agp/amd64-agp.c +0 -1
@@ -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 ) {
Signature · 1 line
2.35.1
Quoted 10 lines · Colin Ian King
Variable i is being assigned a value that is never read, it is being re-assigned later in a for-loop. The assignment 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 <[email protected]>
Thanks for the patch!
Reviewed-by Nick Desaulniers <[email protected]>
Quoted 20 lines
--- drivers/char/agp/amd64-agp.c | 1 - 1 file changed, 1 deletion(-)drivers/char/agp/amd64-agp.c +0
-2@@ -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.35.1
Signature · 2 lines
Thanks, ~Nick Desaulniers