linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Nicholas Piggin <npiggin@gmail.com>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH for-4.8 V2 01/10] powerpc/mm: Add __cpu/__mmu_has_feature
Date: Mon, 25 Jul 2016 15:26:05 +1000	[thread overview]
Message-ID: <20160725152605.780c6458@roar.ozlabs.ibm.com> (raw)
In-Reply-To: <1469265163-1491-2-git-send-email-aneesh.kumar@linux.vnet.ibm.com>

On Sat, 23 Jul 2016 14:42:34 +0530
"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com> wrote:

> In later patches, we will be switching cpu and mmu feature check to
> use static keys. This would require us to have a variant of feature
> check that can be used in early boot before jump label is initialized.
> This patch adds the same. We also add a variant for radix_enabled()
> check
> 
> We also update the return type to bool.
> 
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
> ---
>  arch/powerpc/include/asm/book3s/64/mmu.h | 19 +++++++++++++++----
>  arch/powerpc/include/asm/cputable.h      | 15 ++++++++++-----
>  arch/powerpc/include/asm/mmu.h           | 13 +++++++++++--
>  arch/powerpc/xmon/ppc-dis.c              |  1 +
>  4 files changed, 37 insertions(+), 11 deletions(-)
> 
> diff --git a/arch/powerpc/include/asm/book3s/64/mmu.h
> b/arch/powerpc/include/asm/book3s/64/mmu.h index
> 6d8306d9aa7a..1bb0e536c76b 100644 ---
> a/arch/powerpc/include/asm/book3s/64/mmu.h +++
> b/arch/powerpc/include/asm/book3s/64/mmu.h @@ -24,9 +24,20 @@ struct
> mmu_psize_def { extern struct mmu_psize_def
> mmu_psize_defs[MMU_PAGE_COUNT]; 
>  #ifdef CONFIG_PPC_RADIX_MMU
> -#define radix_enabled() mmu_has_feature(MMU_FTR_TYPE_RADIX)
> +static inline bool radix_enabled(void)
> +{
> +	return mmu_has_feature(MMU_FTR_TYPE_RADIX);
> +}
> +#define radix_enabled radix_enabled
> +
> +static inline bool __radix_enabled(void)
> +{
> +	return __mmu_has_feature(MMU_FTR_TYPE_RADIX);
> +}

I'm probably guilty of this too, but the prefix-more-underscores naming
convention for a "special" variant of a function sucks, especially for
names used beyond a single file.

Might _early or similar be an improvement?

Thanks,
Nick

  reply	other threads:[~2016-07-25  5:26 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-23  9:12 [PATCH for-4.8 V2 00/10] Use jump label for cpu/mmu_has_feature Aneesh Kumar K.V
2016-07-23  9:12 ` [PATCH for-4.8 V2 01/10] powerpc/mm: Add __cpu/__mmu_has_feature Aneesh Kumar K.V
2016-07-25  5:26   ` Nicholas Piggin [this message]
2016-07-23  9:12 ` [PATCH for-4.8 V2 02/10] powerpc/mm: Convert early cpu/mmu feature check to use the new helpers Aneesh Kumar K.V
2016-07-23  9:12 ` [PATCH for-4.8 V2 03/10] powerpc/mm/radix: Add radix_set_pte to use in early init Aneesh Kumar K.V
2016-07-25  6:23   ` Nicholas Piggin
2016-07-25  8:33     ` Michael Ellerman
2016-07-25  8:36   ` Michael Ellerman
2016-07-25  8:56     ` Nicholas Piggin
2016-07-23  9:12 ` [PATCH for-4.8 V2 04/10] jump_label: make it possible for the archs to invoke jump_label_init() much earlier Aneesh Kumar K.V
2016-07-23  9:12 ` [PATCH for-4.8 V2 05/10] powerpc: Call jump_label_init early Aneesh Kumar K.V
2016-07-23  9:12 ` [PATCH for-4.8 V2 06/10] powerpc: kill mfvtb() Aneesh Kumar K.V
2016-07-23  9:12 ` [PATCH for-4.8 V2 07/10] powerpc: move the cpu_has_feature to a separate file Aneesh Kumar K.V
2016-07-23  9:12 ` [PATCH for-4.8 V2 08/10] powerpc: use the jump label for cpu_has_feature Aneesh Kumar K.V
2016-07-25  6:28   ` Nicholas Piggin
2016-07-25 11:30     ` Kevin Hao
2016-07-23  9:12 ` [PATCH for-4.8 V2 09/10] powerpc: use jump label for mmu_has_feature Aneesh Kumar K.V
2016-07-23  9:12 ` [PATCH for-4.8 V2 10/10] powerpc/mm: Catch the usage of cpu/mmu_has_feature before jump label init Aneesh Kumar K.V
2016-07-25  5:22 ` [PATCH for-4.8 V2 00/10] Use jump label for cpu/mmu_has_feature Nicholas Piggin
2016-07-25  6:25   ` Aneesh Kumar K.V
2016-07-25  6:37     ` Nicholas Piggin

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=20160725152605.780c6458@roar.ozlabs.ibm.com \
    --to=npiggin@gmail.com \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=benh@kernel.crashing.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@samba.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).