From: Andrew Morton <akpm@linux-foundation.org>
To: Mike Rapoport <rppt@linux.ibm.com>
Cc: kbuild test robot <lkp@intel.com>,
kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
Linux Memory Management List <linux-mm@kvack.org>
Subject: Re: arch/sparc/mm/srmmu.c:300:9: error: variable 'pud' set but not used
Date: Wed, 20 May 2020 16:46:28 -0700 [thread overview]
Message-ID: <20200520164628.fda1af0c681bbae498dd7ba7@linux-foundation.org> (raw)
In-Reply-To: <20200520132005.GM1059226@linux.ibm.com>
On Wed, 20 May 2020 16:20:05 +0300 Mike Rapoport <rppt@linux.ibm.com> wrote:
> The kbuild test robot reported the following warning:
>
> arch/sparc/mm/srmmu.c: In function 'srmmu_nocache_init':
> >> arch/sparc/mm/srmmu.c:300:9: error: variable 'pud' set but not used
> >> [-Werror=unused-but-set-variable]
> 300 | pud_t *pud;
>
> This warning is caused by misprint in the page table traversal in
> srmmu_nocache_init() function which accessed a PMD entry using PGD rather
> than PUD.
> Since sparc32 has only 3 page table levels, the PGD and PUD are essentially
> the same and usage of __nocache_fix() removed the type checking.
>
> Use PUD for the consistency and to silence the compiler warning.
>
> ...
>
> --- a/arch/sparc/mm/srmmu.c
> +++ b/arch/sparc/mm/srmmu.c
> @@ -304,7 +304,7 @@ static void __init srmmu_nocache_init(void)
> pgd = pgd_offset_k(vaddr);
> p4d = p4d_offset(__nocache_fix(pgd), vaddr);
> pud = pud_offset(__nocache_fix(p4d), vaddr);
> - pmd = pmd_offset(__nocache_fix(pgd), vaddr);
> + pmd = pmd_offset(__nocache_fix(pud), vaddr);
> pte = pte_offset_kernel(__nocache_fix(pmd), vaddr);
>
> pteval = ((paddr >> 4) | SRMMU_ET_PTE | SRMMU_PRIV);
I added
Fixes: 7235db268a2777bc38 ("sparc32: use pgtable-nopud instead of 4level-fixup")
and, after a bit of thought,
Cc: <stable@vger.kernel.org>
Because that's a fairly scary-looking warning.
WARNING: multiple messages have this Message-ID (diff)
From: Andrew Morton <akpm@linux-foundation.org>
To: kbuild-all@lists.01.org
Subject: Re: arch/sparc/mm/srmmu.c:300:9: error: variable 'pud' set but not used
Date: Wed, 20 May 2020 16:46:28 -0700 [thread overview]
Message-ID: <20200520164628.fda1af0c681bbae498dd7ba7@linux-foundation.org> (raw)
In-Reply-To: <20200520132005.GM1059226@linux.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 1428 bytes --]
On Wed, 20 May 2020 16:20:05 +0300 Mike Rapoport <rppt@linux.ibm.com> wrote:
> The kbuild test robot reported the following warning:
>
> arch/sparc/mm/srmmu.c: In function 'srmmu_nocache_init':
> >> arch/sparc/mm/srmmu.c:300:9: error: variable 'pud' set but not used
> >> [-Werror=unused-but-set-variable]
> 300 | pud_t *pud;
>
> This warning is caused by misprint in the page table traversal in
> srmmu_nocache_init() function which accessed a PMD entry using PGD rather
> than PUD.
> Since sparc32 has only 3 page table levels, the PGD and PUD are essentially
> the same and usage of __nocache_fix() removed the type checking.
>
> Use PUD for the consistency and to silence the compiler warning.
>
> ...
>
> --- a/arch/sparc/mm/srmmu.c
> +++ b/arch/sparc/mm/srmmu.c
> @@ -304,7 +304,7 @@ static void __init srmmu_nocache_init(void)
> pgd = pgd_offset_k(vaddr);
> p4d = p4d_offset(__nocache_fix(pgd), vaddr);
> pud = pud_offset(__nocache_fix(p4d), vaddr);
> - pmd = pmd_offset(__nocache_fix(pgd), vaddr);
> + pmd = pmd_offset(__nocache_fix(pud), vaddr);
> pte = pte_offset_kernel(__nocache_fix(pmd), vaddr);
>
> pteval = ((paddr >> 4) | SRMMU_ET_PTE | SRMMU_PRIV);
I added
Fixes: 7235db268a2777bc38 ("sparc32: use pgtable-nopud instead of 4level-fixup")
and, after a bit of thought,
Cc: <stable@vger.kernel.org>
Because that's a fairly scary-looking warning.
next prev parent reply other threads:[~2020-05-20 23:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-20 0:57 arch/sparc/mm/srmmu.c:300:9: error: variable 'pud' set but not used kbuild test robot
2020-05-20 0:57 ` kbuild test robot
2020-05-20 13:20 ` Mike Rapoport
2020-05-20 23:46 ` Andrew Morton [this message]
2020-05-20 23:46 ` Andrew Morton
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=20200520164628.fda1af0c681bbae498dd7ba7@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lkp@intel.com \
--cc=rppt@linux.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.