Skip to contentSkip to conversation

mips: cacheinfo: Remove unnecessary increment of level

PATCH Applied Souptick Joarder 3 participants 4 messages Jan 16, 2021 – Jan 27, 2021 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mips: cacheinfo: Remove unnecessary increment of level

kernel test robot throws below warning ->

arch/mips/kernel/cacheinfo.c:112:3: warning: Variable 'level' is modified but its new value is never used. [unreadVariable]

Remove unnecessary increment of level at the end.

---
 arch/mips/kernel/cacheinfo.c | 1 -
 1 file changed, 1 deletion(-)
arch/mips/kernel/cacheinfo.c +0 -1
index 5f9d0eb..c858ae3 100644
@@ -109,7 +109,6 @@ static int __populate_cache_leaves(unsigned int cpu)
 
 	if (c->tcache.waysize) {
 		populate_cache(tcache, this_leaf, level, CACHE_TYPE_UNIFIED);
-		level++;
 	}
 
 	this_cpu_ci->cpu_map_populated = true;
Signature · 1 line
1.9.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Souptick Joarder

kernel test robot throws below warning ->

arch/mips/kernel/cacheinfo.c:112:3: warning: Variable 'level' is modified but its new value is never used. [unreadVariable]

Remove unnecessary increment of level at the end.

Quoted 16 lines
---
  arch/mips/kernel/cacheinfo.c | 1 -
  1 file changed, 1 deletion(-)
arch/mips/kernel/cacheinfo.c +0 -1
index 5f9d0eb..c858ae3 100644
@@ -109,7 +109,6 @@ static int __populate_cache_leaves(unsigned int cpu)
 
  	if (c->tcache.waysize) {
  		populate_cache(tcache, this_leaf, level, CACHE_TYPE_UNIFIED);
-		level++;
  	}
 
  	this_cpu_ci->cpu_map_populated = true;
#2 lore raw
In reply to Souptick Joarder
Quoted 18 lines · Souptick Joarder

kernel test robot throws below warning ->

arch/mips/kernel/cacheinfo.c:112:3: warning: Variable 'level' is modified but its new value is never used. [unreadVariable]

Remove unnecessary increment of level at the end.

---
 arch/mips/kernel/cacheinfo.c | 1 -
 1 file changed, 1 deletion(-)
arch/mips/kernel/cacheinfo.c +0 -0
index 5f9d0eb..c858ae3 100644

arch/mips/kernel/cacheinfo.c static int __populate_cache_leaves(unsigned int cpu) · line 112

Quoted 4 lines
arch/mips/kernel/cacheinfo.c +0 -1
@@ -109,7 +109,6 @@ static int __populate_cache_leaves(unsigned int cpu)
 
 	if (c->tcache.waysize) {
 		populate_cache(tcache, this_leaf, level, CACHE_TYPE_UNIFIED);
-		level++;

please remove the no longer needed braces, too.

Thomas.

Signature · 2 lines
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]
maintainer Applied
#3 lore raw
In reply to Souptick Joarder
Quoted 5 lines · Souptick Joarder

kernel test robot throws below warning ->

arch/mips/kernel/cacheinfo.c:112:3: warning: Variable 'level' is modified but its new value is never used. [unreadVariable]

Quoted 7 lines

Remove unnecessary increment of level at the end.

---
 arch/mips/kernel/cacheinfo.c | 1 -
 1 file changed, 1 deletion(-)

applied to mips-next with braces removed.

Thomas.

Signature · 2 lines
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]