agp: amd64: remove unneeded initialization
Subsystems (2)
PATCH 1/1 agp: amd64: remove unneeded initialization
make clang-analyzer on x86_64 defconfig caught my attention with:
drivers/char/agp/amd64-agp.c:336:2: warning: \
Value stored to 'i' is never read [clang-analyzer-deadcode.DeadStores]
i = 0;
^Remove this unneeded initialization to make clang-analyzer happy.
Commit a32073bffc65 ("x86_64: Clean and enhance up K8 northbridge access code") refactored cache_nbs() and introduced this unneeded dead-store initialization.
As compilers will detect this unneeded assignment and optimize this anyway, the resulting binary is identical before and after this change.
No functional change. No change in binary code.
---
applies cleanly on current master and next-20201028
David, please pick this minor non-urgent clean-up patch.
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.17.1
Quoted 32 lines · Lukas Bulwahn
make clang-analyzer on
x86_64defconfig caught my attention with:drivers/char/agp/amd64-agp.c:336:2: warning: \ Value stored to 'i' is never read [clang-analyzer-deadcode.DeadStores] i = 0; ^Remove this unneeded initialization to make clang-analyzer happy.
Commit
a32073bffc65("x86_64: Clean and enhance up K8 northbridge access code") refactoredcache_nbs()and introduced this unneeded dead-store initialization.As compilers will detect this unneeded assignment and optimize this anyway, the resulting binary is identical before and after this change.
No functional change. No change in binary code.
Signed-off-by Lukas Bulwahn <[email protected]>---
applies cleanly on current master and next-20201028David, please pick this minor non-urgent clean-up patch.
drivers/char/agp/amd64-agp.c | 1 - 1 file changed, 1 deletion(-)drivers/char/agp/amd64-agp.c +0
-0
drivers/char/agp/amd64-agp.c static int cache_nbs(struct pci_dev *pdev, u32 cap_ptr) · line 338
Quoted 7 lines
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 ) {
Looks ok to me.
Quoted 13 lines · Lukas Bulwahn
make clang-analyzer on
x86_64defconfig caught my attention with:drivers/char/agp/amd64-agp.c:336:2: warning: \ Value stored to 'i' is never read [clang-analyzer-deadcode.DeadStores] i = 0; ^Remove this unneeded initialization to make clang-analyzer happy.
Commit
a32073bffc65("x86_64: Clean and enhance up K8 northbridge access code") refactoredcache_nbs()and introduced this unneeded dead-store initialization.
Quoted 6 lines
As compilers will detect this unneeded assignment and optimize this anyway, the resulting binary is identical before and after this change.
No functional change. No change in binary code.
Signed-off-by Lukas Bulwahn <[email protected]>
Seems obvious :)
Quoted 23 lines
---
applies cleanly on current master and next-20201028David, please pick this minor non-urgent clean-up patch.
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.17.1