mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Will Deacon <will.deacon@arm.com>
To: Qian Cai <cai@lca.pw>
Cc: catalin.marinas@arm.com, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] arm64: fix pte_unmap() -Wunused-but-set-variable
Date: Mon, 29 Apr 2019 17:49:23 +0100	[thread overview]
Message-ID: <20190429164923.GA26912@fuggles.cambridge.arm.com> (raw)
In-Reply-To: <20190427012842.93737-1-cai@lca.pw>

On Fri, Apr 26, 2019 at 09:28:42PM -0400, Qian Cai wrote:
> Many compilation warnings due to pte_unmap() compiles away. Fixed it by
> making it an static inline function.
> 
> mm/gup.c: In function 'gup_pte_range':
> mm/gup.c:1727:16: warning: variable 'ptem' set but not used
> [-Wunused-but-set-variable]
> mm/gup.c: At top level:
> mm/memory.c: In function 'copy_pte_range':
> mm/memory.c:821:24: warning: variable 'orig_dst_pte' set but not used
> [-Wunused-but-set-variable]
> mm/memory.c:821:9: warning: variable 'orig_src_pte' set but not used
> [-Wunused-but-set-variable]
> mm/swap_state.c: In function 'swap_ra_info':
> mm/swap_state.c:641:15: warning: variable 'orig_pte' set but not used
> [-Wunused-but-set-variable]
> mm/madvise.c: In function 'madvise_free_pte_range':
> mm/madvise.c:318:9: warning: variable 'orig_pte' set but not used
> [-Wunused-but-set-variable]
> 
> Also, remove pte_unmap_nested() as nobody uses it anymore since the
> commit ece0e2b6406a ("mm: remove pte_*map_nested()").

Can you post that as a separate patch which also removes
pte_offset_map_nested(), please?

> Signed-off-by: Qian Cai <cai@lca.pw>
> ---
>  arch/arm64/include/asm/pgtable.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h
> index de70c1eabf33..7543e345e078 100644
> --- a/arch/arm64/include/asm/pgtable.h
> +++ b/arch/arm64/include/asm/pgtable.h
> @@ -478,6 +478,8 @@ static inline phys_addr_t pmd_page_paddr(pmd_t pmd)
>  	return __pmd_to_phys(pmd);
>  }
>  
> +static inline void pte_unmap(pte_t *pte) { }

Hmm, is this guaranteed to stop the compiler from warning? Assuming the
pte_unmap() call is inlined, I'd expect it to keep complaining. What
compiler are you using?

Also, there are a bunch of other architectures that I would expect to have
this same issue because they defined pte_unmap() exactly the same way.

Will

  reply	other threads:[~2019-04-29 16:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-27  1:28 Qian Cai
2019-04-29 16:49 ` Will Deacon [this message]
2019-04-29 17:18   ` Qian Cai

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=20190429164923.GA26912@fuggles.cambridge.arm.com \
    --to=will.deacon@arm.com \
    --cc=cai@lca.pw \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    /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

Powered by JetHome