linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Mike Rapoport <rppt@linux.ibm.com>
To: kbuild test robot <lkp@intel.com>
Cc: kbuild-all@lists.01.org, Johannes Weiner <hannes@cmpxchg.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux Memory Management List <linux-mm@kvack.org>
Subject: Re: [hnaz-linux-mm:master 476/523] arch/powerpc/xmon/xmon.c:3138:16: warning: variable 'pgdir' set but not used
Date: Tue, 19 May 2020 21:14:54 +0300	[thread overview]
Message-ID: <20200519181454.GI1059226@linux.ibm.com> (raw)
In-Reply-To: <202005191943.u6XYFYID%lkp@intel.com>

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@intel.com>
> 
> 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@linux.ibm.com>
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@intel.com>
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
---
 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@lists.01.org



-- 
Sincerely yours,
Mike.


      reply	other threads:[~2020-05-19 18:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-19 11:56 [hnaz-linux-mm:master 476/523] arch/powerpc/xmon/xmon.c:3138:16: warning: variable 'pgdir' set but not used kbuild test robot
2020-05-19 18:14 ` Mike Rapoport [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200519181454.GI1059226@linux.ibm.com \
    --to=rppt@linux.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).