Re: [hnaz-linux-mm:master 476/523] arch/powerpc/xmon/xmon.c:3138:16: warning: variable 'pgdir' set but not used

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 19, 2020 at 07:56:50PM +0800, kbuild test robot wrote:
> tree:   https://github.com/hnaz/linux-mm master
> head:   2bbf0589bfeb27800c730b76eacf34528eee5418
> commit: 47dde7dbc279f3698c76a7b92ac0d0f1913539af [476/523] powerpc: add support for folded p4d page tables
> config: powerpc-allyesconfig (attached as .config)
> compiler: powerpc64-linux-gcc (GCC) 9.3.0
> reproduce:
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         git checkout 47dde7dbc279f3698c76a7b92ac0d0f1913539af
>         # save the attached .config to linux build tree
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc 
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kbuild test robot <lkp@xxxxxxxxx>
> 
> All warnings (new ones prefixed by >>, old ones prefixed by <<):
> 
> arch/powerpc/xmon/xmon.c: In function 'show_pte':
> >> arch/powerpc/xmon/xmon.c:3138:16: warning: variable 'pgdir' set but not used [-Wunused-but-set-variable]
> 3138 |  pgd_t *pgdp, *pgdir;
> |                ^~~~~


...

The fix is below:

>From ced3189aa0b1c3888c4e8d4ff2d6575ad93859f7 Mon Sep 17 00:00:00 2001
From: Mike Rapoport <rppt@xxxxxxxxxxxxx>
Date: Tue, 19 May 2020 21:11:05 +0300
Subject: [PATCH] powerpc/xmon: drop unused pgdir varialble in show_pte()
 function

The kernel build robot complained:

arch/powerpc/xmon/xmon.c: In function 'show_pte':
>> arch/powerpc/xmon/xmon.c:3138:16: warning: variable 'pgdir' set but not
>> used [-Wunused-but-set-variable]
3138 |  pgd_t *pgdp, *pgdir;
|                ^~~~~

Remove the unused pgdir variable and adjust if () else statement to comply
with the coding style.

Reported-by: kbuild test robot <lkp@xxxxxxxxx>
Signed-off-by: Mike Rapoport <rppt@xxxxxxxxxxxxx>
---
 arch/powerpc/xmon/xmon.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index 506fd93fcf1e..da7f62f1daec 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -3134,7 +3134,7 @@ static void show_pte(unsigned long addr)
 	unsigned long tskv = 0;
 	struct task_struct *tsk = NULL;
 	struct mm_struct *mm;
-	pgd_t *pgdp, *pgdir;
+	pgd_t *pgdp;
 	p4d_t *p4dp;
 	pud_t *pudp;
 	pmd_t *pmdp;
@@ -3159,13 +3159,10 @@ static void show_pte(unsigned long addr)
 	catch_memory_errors = 1;
 	sync();
 
-	if (mm == &init_mm) {
+	if (mm == &init_mm)
 		pgdp = pgd_offset_k(addr);
-		pgdir = pgd_offset_k(0);
-	} else {
+	else
 		pgdp = pgd_offset(mm, addr);
-		pgdir = pgd_offset(mm, 0);
-	}
 
 	p4dp = p4d_offset(pgdp, addr);
 
-- 
2.26.2

> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx



-- 
Sincerely yours,
Mike.




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux