Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1468710 > unrolled thread

[PATCH] treewide: replace config_enabled() with IS_ENABLED() (2nd round)

Started byMasahiro Yamada <yamada.masahiro@socionext.com>
First post2016-08-23 18:50 +0200
Last post2016-08-24 10:00 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] treewide: replace config_enabled() with IS_ENABLED() (2nd round) Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-08-23 18:50 +0200
    Re: [PATCH] treewide: replace config_enabled() with IS_ENABLED() (2nd round) Kees Cook <keescook@chromium.org> - 2016-08-24 04:20 +0200
    Re: [PATCH] treewide: replace config_enabled() with IS_ENABLED() (2nd  round) Peter Oberparleiter <oberpar@linux.vnet.ibm.com> - 2016-08-24 10:00 +0200

#1468710 — [PATCH] treewide: replace config_enabled() with IS_ENABLED() (2nd round)

FromMasahiro Yamada <yamada.masahiro@socionext.com>
Date2016-08-23 18:50 +0200
Subject[PATCH] treewide: replace config_enabled() with IS_ENABLED() (2nd round)
Message-ID<s9n3I-6xg-43@gated-at.bofh.it>
Commit 97f2645f358b ("tree-wide: replace config_enabled() with
IS_ENABLED()") mostly killed config_enabled(), but some new users
have appeared for v4.8-rc1.  They are all used for a boolean option,
so can be replaced with IS_ENABLED() safely.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 arch/mips/include/asm/page.h | 4 ++--
 arch/s390/kernel/setup.c     | 6 ++----
 arch/x86/mm/kaslr.c          | 2 +-
 3 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h
index ea0cd97..5f98759 100644
--- a/arch/mips/include/asm/page.h
+++ b/arch/mips/include/asm/page.h
@@ -164,7 +164,7 @@ typedef struct { unsigned long pgprot; } pgprot_t;
  */
 static inline unsigned long ___pa(unsigned long x)
 {
-	if (config_enabled(CONFIG_64BIT)) {
+	if (IS_ENABLED(CONFIG_64BIT)) {
 		/*
 		 * For MIPS64 the virtual address may either be in one of
 		 * the compatibility segements ckseg0 or ckseg1, or it may
@@ -173,7 +173,7 @@ static inline unsigned long ___pa(unsigned long x)
 		return x < CKSEG0 ? XPHYSADDR(x) : CPHYSADDR(x);
 	}
 
-	if (!config_enabled(CONFIG_EVA)) {
+	if (!IS_ENABLED(CONFIG_EVA)) {
 		/*
 		 * We're using the standard MIPS32 legacy memory map, ie.
 		 * the address x is going to be in kseg0 or kseg1. We can
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index ba5f456..7f7ba5f2 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -204,11 +204,9 @@ static void __init conmode_default(void)
 #endif
 		}
 	} else if (MACHINE_IS_KVM) {
-		if (sclp.has_vt220 &&
-		    config_enabled(CONFIG_SCLP_VT220_CONSOLE))
+		if (sclp.has_vt220 && IS_ENABLED(CONFIG_SCLP_VT220_CONSOLE))
 			SET_CONSOLE_VT220;
-		else if (sclp.has_linemode &&
-			 config_enabled(CONFIG_SCLP_CONSOLE))
+		else if (sclp.has_linemode && IS_ENABLED(CONFIG_SCLP_CONSOLE))
 			SET_CONSOLE_SCLP;
 		else
 			SET_CONSOLE_HVC;
diff --git a/arch/x86/mm/kaslr.c b/arch/x86/mm/kaslr.c
index ec8654f..bda8d5e 100644
--- a/arch/x86/mm/kaslr.c
+++ b/arch/x86/mm/kaslr.c
@@ -77,7 +77,7 @@ static inline unsigned long get_padding(struct kaslr_memory_region *region)
  */
 static inline bool kaslr_memory_enabled(void)
 {
-	return kaslr_enabled() && !config_enabled(CONFIG_KASAN);
+	return kaslr_enabled() && !IS_ENABLED(CONFIG_KASAN);
 }
 
 /* Initialize base and padding for each memory region randomized with KASLR */
-- 
1.9.1

[toc] | [next] | [standalone]


#1469026

FromKees Cook <keescook@chromium.org>
Date2016-08-24 04:20 +0200
Message-ID<s9vXj-4dW-9@gated-at.bofh.it>
In reply to#1468710
On Tue, Aug 23, 2016 at 12:45 PM, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
> Commit 97f2645f358b ("tree-wide: replace config_enabled() with
> IS_ENABLED()") mostly killed config_enabled(), but some new users
> have appeared for v4.8-rc1.  They are all used for a boolean option,
> so can be replaced with IS_ENABLED() safely.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

Acked-by: Kees Cook <keescook@chromium.org>

-Kees

> ---
>
>  arch/mips/include/asm/page.h | 4 ++--
>  arch/s390/kernel/setup.c     | 6 ++----
>  arch/x86/mm/kaslr.c          | 2 +-
>  3 files changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h
> index ea0cd97..5f98759 100644
> --- a/arch/mips/include/asm/page.h
> +++ b/arch/mips/include/asm/page.h
> @@ -164,7 +164,7 @@ typedef struct { unsigned long pgprot; } pgprot_t;
>   */
>  static inline unsigned long ___pa(unsigned long x)
>  {
> -       if (config_enabled(CONFIG_64BIT)) {
> +       if (IS_ENABLED(CONFIG_64BIT)) {
>                 /*
>                  * For MIPS64 the virtual address may either be in one of
>                  * the compatibility segements ckseg0 or ckseg1, or it may
> @@ -173,7 +173,7 @@ static inline unsigned long ___pa(unsigned long x)
>                 return x < CKSEG0 ? XPHYSADDR(x) : CPHYSADDR(x);
>         }
>
> -       if (!config_enabled(CONFIG_EVA)) {
> +       if (!IS_ENABLED(CONFIG_EVA)) {
>                 /*
>                  * We're using the standard MIPS32 legacy memory map, ie.
>                  * the address x is going to be in kseg0 or kseg1. We can
> diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
> index ba5f456..7f7ba5f2 100644
> --- a/arch/s390/kernel/setup.c
> +++ b/arch/s390/kernel/setup.c
> @@ -204,11 +204,9 @@ static void __init conmode_default(void)
>  #endif
>                 }
>         } else if (MACHINE_IS_KVM) {
> -               if (sclp.has_vt220 &&
> -                   config_enabled(CONFIG_SCLP_VT220_CONSOLE))
> +               if (sclp.has_vt220 && IS_ENABLED(CONFIG_SCLP_VT220_CONSOLE))
>                         SET_CONSOLE_VT220;
> -               else if (sclp.has_linemode &&
> -                        config_enabled(CONFIG_SCLP_CONSOLE))
> +               else if (sclp.has_linemode && IS_ENABLED(CONFIG_SCLP_CONSOLE))
>                         SET_CONSOLE_SCLP;
>                 else
>                         SET_CONSOLE_HVC;
> diff --git a/arch/x86/mm/kaslr.c b/arch/x86/mm/kaslr.c
> index ec8654f..bda8d5e 100644
> --- a/arch/x86/mm/kaslr.c
> +++ b/arch/x86/mm/kaslr.c
> @@ -77,7 +77,7 @@ static inline unsigned long get_padding(struct kaslr_memory_region *region)
>   */
>  static inline bool kaslr_memory_enabled(void)
>  {
> -       return kaslr_enabled() && !config_enabled(CONFIG_KASAN);
> +       return kaslr_enabled() && !IS_ENABLED(CONFIG_KASAN);
>  }
>
>  /* Initialize base and padding for each memory region randomized with KASLR */
> --
> 1.9.1
>



-- 
Kees Cook
Nexus Security

[toc] | [prev] | [next] | [standalone]


#1469155 — Re: [PATCH] treewide: replace config_enabled() with IS_ENABLED() (2nd round)

FromPeter Oberparleiter <oberpar@linux.vnet.ibm.com>
Date2016-08-24 10:00 +0200
SubjectRe: [PATCH] treewide: replace config_enabled() with IS_ENABLED() (2nd round)
Message-ID<s9Bgl-7De-11@gated-at.bofh.it>
In reply to#1468710
On 23.08.2016 18:45, Masahiro Yamada wrote:
> Commit 97f2645f358b ("tree-wide: replace config_enabled() with
> IS_ENABLED()") mostly killed config_enabled(), but some new users
> have appeared for v4.8-rc1.  They are all used for a boolean option,
> so can be replaced with IS_ENABLED() safely.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

Acked-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>

> ---
> 
>  arch/mips/include/asm/page.h | 4 ++--
>  arch/s390/kernel/setup.c     | 6 ++----
>  arch/x86/mm/kaslr.c          | 2 +-
>  3 files changed, 5 insertions(+), 7 deletions(-)

-- 
Peter Oberparleiter
Linux on z Systems Development - IBM Germany

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web