diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2016-08-03 16:45:50 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-08-04 08:50:07 -0400 |
commit | 97f2645f358b411ba2afb22e5966753f0ad92916 (patch) | |
tree | 131ff2c4f9454b075a0179879dbcb078e510fd13 /arch/mips/include/asm/pgtable.h | |
parent | 1c8cb409491403036919dd1c6b45013dc8835a44 (diff) |
tree-wide: replace config_enabled() with IS_ENABLED()
The use of config_enabled() against config options is ambiguous. In
practical terms, config_enabled() is equivalent to IS_BUILTIN(), but the
author might have used it for the meaning of IS_ENABLED(). Using
IS_ENABLED(), IS_BUILTIN(), IS_MODULE() etc. makes the intention
clearer.
This commit replaces config_enabled() with IS_ENABLED() where possible.
This commit is only touching bool config options.
I noticed two cases where config_enabled() is used against a tristate
option:
- config_enabled(CONFIG_HWMON)
[ drivers/net/wireless/ath/ath10k/thermal.c ]
- config_enabled(CONFIG_BACKLIGHT_CLASS_DEVICE)
[ drivers/gpu/drm/gma500/opregion.c ]
I did not touch them because they should be converted to IS_BUILTIN()
in order to keep the logic, but I was not sure it was the authors'
intention.
Link: http://lkml.kernel.org/r/1465215656-20569-1-git-send-email-yamada.masahiro@socionext.com
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Kees Cook <keescook@chromium.org>
Cc: Stas Sergeev <stsp@list.ru>
Cc: Matt Redfearn <matt.redfearn@imgtec.com>
Cc: Joshua Kinard <kumba@gentoo.org>
Cc: Jiri Slaby <jslaby@suse.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: Markos Chandras <markos.chandras@imgtec.com>
Cc: "Dmitry V. Levin" <ldv@altlinux.org>
Cc: yu-cheng yu <yu-cheng.yu@intel.com>
Cc: James Hogan <james.hogan@imgtec.com>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Will Drewry <wad@chromium.org>
Cc: Nikolay Martynov <mar.kolya@gmail.com>
Cc: Huacai Chen <chenhc@lemote.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
Cc: Rafal Milecki <zajec5@gmail.com>
Cc: James Cowgill <James.Cowgill@imgtec.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Alex Smith <alex.smith@imgtec.com>
Cc: Adam Buchbinder <adam.buchbinder@gmail.com>
Cc: Qais Yousef <qais.yousef@imgtec.com>
Cc: Jiang Liu <jiang.liu@linux.intel.com>
Cc: Mikko Rapeli <mikko.rapeli@iki.fi>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Brian Norris <computersforpeace@gmail.com>
Cc: Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com>
Cc: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Roland McGrath <roland@hack.frob.com>
Cc: Paul Burton <paul.burton@imgtec.com>
Cc: Kalle Valo <kvalo@qca.qualcomm.com>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Tony Wu <tung7970@gmail.com>
Cc: Huaitong Han <huaitong.han@intel.com>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Juergen Gross <jgross@suse.com>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Andrea Gelmini <andrea.gelmini@gelma.net>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Rabin Vincent <rabin@rab.in>
Cc: "Maciej W. Rozycki" <macro@imgtec.com>
Cc: David Daney <david.daney@cavium.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/mips/include/asm/pgtable.h')
-rw-r--r-- | arch/mips/include/asm/pgtable.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/arch/mips/include/asm/pgtable.h b/arch/mips/include/asm/pgtable.h index 7d44e888134f..70128d3f770a 100644 --- a/arch/mips/include/asm/pgtable.h +++ b/arch/mips/include/asm/pgtable.h | |||
@@ -159,7 +159,7 @@ static inline void set_pte(pte_t *ptep, pte_t pte) | |||
159 | * it better already be global) | 159 | * it better already be global) |
160 | */ | 160 | */ |
161 | if (pte_none(*buddy)) { | 161 | if (pte_none(*buddy)) { |
162 | if (!config_enabled(CONFIG_XPA)) | 162 | if (!IS_ENABLED(CONFIG_XPA)) |
163 | buddy->pte_low |= _PAGE_GLOBAL; | 163 | buddy->pte_low |= _PAGE_GLOBAL; |
164 | buddy->pte_high |= _PAGE_GLOBAL; | 164 | buddy->pte_high |= _PAGE_GLOBAL; |
165 | } | 165 | } |
@@ -172,7 +172,7 @@ static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *pt | |||
172 | 172 | ||
173 | htw_stop(); | 173 | htw_stop(); |
174 | /* Preserve global status for the pair */ | 174 | /* Preserve global status for the pair */ |
175 | if (config_enabled(CONFIG_XPA)) { | 175 | if (IS_ENABLED(CONFIG_XPA)) { |
176 | if (ptep_buddy(ptep)->pte_high & _PAGE_GLOBAL) | 176 | if (ptep_buddy(ptep)->pte_high & _PAGE_GLOBAL) |
177 | null.pte_high = _PAGE_GLOBAL; | 177 | null.pte_high = _PAGE_GLOBAL; |
178 | } else { | 178 | } else { |
@@ -319,7 +319,7 @@ static inline int pte_young(pte_t pte) { return pte.pte_low & _PAGE_ACCESSED; } | |||
319 | static inline pte_t pte_wrprotect(pte_t pte) | 319 | static inline pte_t pte_wrprotect(pte_t pte) |
320 | { | 320 | { |
321 | pte.pte_low &= ~_PAGE_WRITE; | 321 | pte.pte_low &= ~_PAGE_WRITE; |
322 | if (!config_enabled(CONFIG_XPA)) | 322 | if (!IS_ENABLED(CONFIG_XPA)) |
323 | pte.pte_low &= ~_PAGE_SILENT_WRITE; | 323 | pte.pte_low &= ~_PAGE_SILENT_WRITE; |
324 | pte.pte_high &= ~_PAGE_SILENT_WRITE; | 324 | pte.pte_high &= ~_PAGE_SILENT_WRITE; |
325 | return pte; | 325 | return pte; |
@@ -328,7 +328,7 @@ static inline pte_t pte_wrprotect(pte_t pte) | |||
328 | static inline pte_t pte_mkclean(pte_t pte) | 328 | static inline pte_t pte_mkclean(pte_t pte) |
329 | { | 329 | { |
330 | pte.pte_low &= ~_PAGE_MODIFIED; | 330 | pte.pte_low &= ~_PAGE_MODIFIED; |
331 | if (!config_enabled(CONFIG_XPA)) | 331 | if (!IS_ENABLED(CONFIG_XPA)) |
332 | pte.pte_low &= ~_PAGE_SILENT_WRITE; | 332 | pte.pte_low &= ~_PAGE_SILENT_WRITE; |
333 | pte.pte_high &= ~_PAGE_SILENT_WRITE; | 333 | pte.pte_high &= ~_PAGE_SILENT_WRITE; |
334 | return pte; | 334 | return pte; |
@@ -337,7 +337,7 @@ static inline pte_t pte_mkclean(pte_t pte) | |||
337 | static inline pte_t pte_mkold(pte_t pte) | 337 | static inline pte_t pte_mkold(pte_t pte) |
338 | { | 338 | { |
339 | pte.pte_low &= ~_PAGE_ACCESSED; | 339 | pte.pte_low &= ~_PAGE_ACCESSED; |
340 | if (!config_enabled(CONFIG_XPA)) | 340 | if (!IS_ENABLED(CONFIG_XPA)) |
341 | pte.pte_low &= ~_PAGE_SILENT_READ; | 341 | pte.pte_low &= ~_PAGE_SILENT_READ; |
342 | pte.pte_high &= ~_PAGE_SILENT_READ; | 342 | pte.pte_high &= ~_PAGE_SILENT_READ; |
343 | return pte; | 343 | return pte; |
@@ -347,7 +347,7 @@ static inline pte_t pte_mkwrite(pte_t pte) | |||
347 | { | 347 | { |
348 | pte.pte_low |= _PAGE_WRITE; | 348 | pte.pte_low |= _PAGE_WRITE; |
349 | if (pte.pte_low & _PAGE_MODIFIED) { | 349 | if (pte.pte_low & _PAGE_MODIFIED) { |
350 | if (!config_enabled(CONFIG_XPA)) | 350 | if (!IS_ENABLED(CONFIG_XPA)) |
351 | pte.pte_low |= _PAGE_SILENT_WRITE; | 351 | pte.pte_low |= _PAGE_SILENT_WRITE; |
352 | pte.pte_high |= _PAGE_SILENT_WRITE; | 352 | pte.pte_high |= _PAGE_SILENT_WRITE; |
353 | } | 353 | } |
@@ -358,7 +358,7 @@ static inline pte_t pte_mkdirty(pte_t pte) | |||
358 | { | 358 | { |
359 | pte.pte_low |= _PAGE_MODIFIED; | 359 | pte.pte_low |= _PAGE_MODIFIED; |
360 | if (pte.pte_low & _PAGE_WRITE) { | 360 | if (pte.pte_low & _PAGE_WRITE) { |
361 | if (!config_enabled(CONFIG_XPA)) | 361 | if (!IS_ENABLED(CONFIG_XPA)) |
362 | pte.pte_low |= _PAGE_SILENT_WRITE; | 362 | pte.pte_low |= _PAGE_SILENT_WRITE; |
363 | pte.pte_high |= _PAGE_SILENT_WRITE; | 363 | pte.pte_high |= _PAGE_SILENT_WRITE; |
364 | } | 364 | } |
@@ -369,7 +369,7 @@ static inline pte_t pte_mkyoung(pte_t pte) | |||
369 | { | 369 | { |
370 | pte.pte_low |= _PAGE_ACCESSED; | 370 | pte.pte_low |= _PAGE_ACCESSED; |
371 | if (!(pte.pte_low & _PAGE_NO_READ)) { | 371 | if (!(pte.pte_low & _PAGE_NO_READ)) { |
372 | if (!config_enabled(CONFIG_XPA)) | 372 | if (!IS_ENABLED(CONFIG_XPA)) |
373 | pte.pte_low |= _PAGE_SILENT_READ; | 373 | pte.pte_low |= _PAGE_SILENT_READ; |
374 | pte.pte_high |= _PAGE_SILENT_READ; | 374 | pte.pte_high |= _PAGE_SILENT_READ; |
375 | } | 375 | } |