mips: cacheinfo: Remove unnecessary increment of level
diff mbox series

Message ID 1610786400-3629-1-git-send-email-jrdr.linux@gmail.com
State New, archived
Headers show
Series
  • mips: cacheinfo: Remove unnecessary increment of level
Related show

Commit Message

Souptick Joarder Jan. 16, 2021, 8:40 a.m. UTC
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.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
---
 arch/mips/kernel/cacheinfo.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Jiaxun Yang Jan. 18, 2021, 1:54 a.m. UTC | #1
在 2021/1/16 下午4:40, 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.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>

Reviewed-by: Jiaxun Yang <jiaxun.yang@flygoat.com>

> ---
>   arch/mips/kernel/cacheinfo.c | 1 -
>   1 file changed, 1 deletion(-)
>
> diff --git a/arch/mips/kernel/cacheinfo.c b/arch/mips/kernel/cacheinfo.c
> index 5f9d0eb..c858ae3 100644
> --- a/arch/mips/kernel/cacheinfo.c
> +++ b/arch/mips/kernel/cacheinfo.c
> @@ -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;
Thomas Bogendoerfer Jan. 18, 2021, 8:40 a.m. UTC | #2
On Sat, Jan 16, 2021 at 02:10:00PM +0530, Souptick Joarder wrote:
> 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.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
> ---
>  arch/mips/kernel/cacheinfo.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/arch/mips/kernel/cacheinfo.c b/arch/mips/kernel/cacheinfo.c
> index 5f9d0eb..c858ae3 100644
> --- a/arch/mips/kernel/cacheinfo.c
> +++ b/arch/mips/kernel/cacheinfo.c
> @@ -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.
Thomas Bogendoerfer Jan. 27, 2021, 9:05 p.m. UTC | #3
On Sat, Jan 16, 2021 at 02:10:00PM +0530, Souptick Joarder wrote:
> 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.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
> ---
>  arch/mips/kernel/cacheinfo.c | 1 -
>  1 file changed, 1 deletion(-)

applied to mips-next with braces removed.

Thomas.

Patch
diff mbox series

diff --git a/arch/mips/kernel/cacheinfo.c b/arch/mips/kernel/cacheinfo.c
index 5f9d0eb..c858ae3 100644
--- a/arch/mips/kernel/cacheinfo.c
+++ b/arch/mips/kernel/cacheinfo.c
@@ -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;