linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64: Fix flush_icache_range prototype
Date: Mon, 23 Oct 2017 14:05:05 +0100	[thread overview]
Message-ID: <20171023130504.GF31263@arm.com> (raw)
In-Reply-To: <20171023125414.10758-1-marc.zyngier@arm.com>

On Mon, Oct 23, 2017 at 01:54:14PM +0100, Marc Zyngier wrote:
> flush_icache_range can return -EFAULT, and yet its prototype
> has void as a return type. Fix it by aligning it to that of
> __flush_cache_user_range.
> 
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> ---
>  arch/arm64/include/asm/cacheflush.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/include/asm/cacheflush.h b/arch/arm64/include/asm/cacheflush.h
> index 76d1cc85d5b1..377fa6b5d67f 100644
> --- a/arch/arm64/include/asm/cacheflush.h
> +++ b/arch/arm64/include/asm/cacheflush.h
> @@ -65,7 +65,7 @@
>   *		- kaddr  - page address
>   *		- size   - region size
>   */
> -extern void flush_icache_range(unsigned long start, unsigned long end);
> +extern long flush_icache_range(unsigned long start, unsigned long end);

Oh blimey, I hadn't realised that. However, this is used in the core code,
which expects a void return type and I'd like to avoid the risk of compiler
warnings complaining that the returned value is not used. I don't think
there's a problem with leaving this as void, since the PCS already says
that x0 is caller saved and this is out-of-line asm.

It just means that we silently handle userspace addresses, rather than
trigger a panic in the absence of software-PAN.

Will

      reply	other threads:[~2017-10-23 13:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-23 12:54 [PATCH] arm64: Fix flush_icache_range prototype Marc Zyngier
2017-10-23 13:05 ` Will Deacon [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=20171023130504.GF31263@arm.com \
    --to=will.deacon@arm.com \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).