linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stafford Horne <shorne@gmail.com>
To: Changbin Du <changbin.du@gmail.com>
Cc: jonas@southpole.se, stefan.kristiansson@saunalahti.fi,
	openrisc@lists.librecores.org, linux-kernel@vger.kernel.org,
	Masahiro Yamada <yamada.masahiro@socionext.com>
Subject: Re: [PATCH] openrisc: make function cache_loop() inline
Date: Wed, 14 Nov 2018 05:49:53 +0900	[thread overview]
Message-ID: <20181113204953.GF2718@lianli.shorne-pla.net> (raw)
In-Reply-To: <20181112155544.7230-1-changbin.du@gmail.com>

On Mon, Nov 12, 2018 at 11:55:44PM +0800, Changbin Du wrote:
> The third operand of mtspr instruction must be a constraint. To guarantee
> this condition, function cache_loop() which uses macro mtspr() must be
> inlined. So let's force it as 'inline'. This is to fix compiling error with
> new option CONFIG_NO_AUTO_INLINE.

Thanks for looking at this.

Do you mean, must be a 'constant'?

I think this fix is fine for now.  Can you add it to your 'kernel hacking: GCC
optimization for better debug experience' series?

> In file included from arch/openrisc/mm/cache.c:17:0:
> arch/openrisc/mm/cache.c: In function 'cache_loop':
> arch/openrisc/include/asm/spr.h:20:27: warning: asm operand 0 probably doesn't match constraints
>                               ^
> arch/openrisc/mm/cache.c:29:3: note: in expansion of macro 'mtspr'
>       mtspr(reg, line);
>       ^~~~~
> arch/openrisc/include/asm/spr.h:20:27: error: impossible constraint in 'asm'
> 
> Signed-off-by: Changbin Du <changbin.du@gmail.com>
> Reported-by: kbuild test robot <lkp@intel.com>
> Cc: Stafford Horne <shorne@gmail.com>
> Cc: Masahiro Yamada <yamada.masahiro@socionext.com>

Acked-by: Stafford Horne <shorne@gmail.com>

> ---
>  arch/openrisc/mm/cache.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/openrisc/mm/cache.c b/arch/openrisc/mm/cache.c
> index b747bf1fc1b6..4a4b2b6e006b 100644
> --- a/arch/openrisc/mm/cache.c
> +++ b/arch/openrisc/mm/cache.c
> @@ -20,7 +20,7 @@
>  #include <asm/cacheflush.h>
>  #include <asm/tlbflush.h>
>  
> -static void cache_loop(struct page *page, const unsigned int reg)
> +static inline void cache_loop(struct page *page, const unsigned int reg)
>  {
>  	unsigned long paddr = page_to_pfn(page) << PAGE_SHIFT;
>  	unsigned long line = paddr & ~(L1_CACHE_BYTES - 1);
> -- 
> 2.17.1
> 

  reply	other threads:[~2018-11-13 20:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-12 15:55 [PATCH] openrisc: make function cache_loop() inline Changbin Du
2018-11-13 20:49 ` Stafford Horne [this message]
2018-11-14  2:19   ` Changbin Du

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=20181113204953.GF2718@lianli.shorne-pla.net \
    --to=shorne@gmail.com \
    --cc=changbin.du@gmail.com \
    --cc=jonas@southpole.se \
    --cc=linux-kernel@vger.kernel.org \
    --cc=openrisc@lists.librecores.org \
    --cc=stefan.kristiansson@saunalahti.fi \
    --cc=yamada.masahiro@socionext.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).