linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] linux/const.h: cleanups of macros such as UL(), _BITUL(), BIT() etc.
@ 2017-01-05  2:20 Masahiro Yamada
  2017-01-05  2:20 ` [PATCH v2 1/4] m68k: rename UL() to TO_UL() Masahiro Yamada
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Masahiro Yamada @ 2017-01-05  2:20 UTC (permalink / raw)
  To: Andrew Morton
  Cc: H . Peter Anvin, Arnd Bergmann, David Howells, x86,
	Thomas Gleixner, Russell King, Srinivas Pandruvada, Ingo Molnar,
	Will Deacon, Mark Rutland, Olof Johansson, Catalin Marinas,
	linux-arm-kernel, Masahiro Yamada, Geert Uytterhoeven,
	Pratyush Anand, Ard Biesheuvel, James Morse, Nicolas Pitre,
	linux-m68k, Guan Xuetao, Shaohua Li, Alexander Popov,
	Guoqing Jiang, linux-kernel, Santosh Shilimkar, zijun_hu,
	Laura Abbott, Neeraj Upadhyay


ARM, ARM64, UniCore32 define UL() as a shorthand of _AC(..., UL).
In the future, more architectures may introduce it, so move
the definition to include/linux/const.h.

The _AC() is used for either (likely) UL or (unlikely) ULL.
Having UL(L) in a common place can avoid direct use of _AC().

The _AC() is defined under the uapi directory, so it compels
underscore-prefixed macros even for unexported headers.

I see similar situation for _BITUL().  This is available in
both C and assembly.  However, it is defined in an uapi header,
so direct use of the underscore macro is needed even for unexported
headers.  The 3/3 makes BIT() available in assembly too, which will
be more suitable for use in unexported headers.


Changes in v2:
  - Split out as a prerequisite patch

Masahiro Yamada (4):
  m68k: rename UL() to TO_UL()
  linux/const.h: move UL() macro to include/linux/const.h
  linux/const.h: refactor _BITUL and _BITULL a bit
  linux/const.h: move BIT(_ULL) to linux/const.h for use in assembly

 arch/arm/include/asm/memory.h       |  6 ------
 arch/arm64/include/asm/memory.h     |  6 ------
 arch/m68k/mm/init.c                 |  6 +++---
 arch/unicore32/include/asm/memory.h |  6 ------
 include/linux/bitops.h              |  3 +--
 include/linux/const.h               | 12 ++++++++++++
 include/uapi/linux/const.h          | 13 ++++++++-----
 7 files changed, 24 insertions(+), 28 deletions(-)
 create mode 100644 include/linux/const.h

-- 
2.7.4

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-01-08  6:27 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-05  2:20 [PATCH v2 0/4] linux/const.h: cleanups of macros such as UL(), _BITUL(), BIT() etc Masahiro Yamada
2017-01-05  2:20 ` [PATCH v2 1/4] m68k: rename UL() to TO_UL() Masahiro Yamada
2017-01-05  2:20 ` [PATCH v2 2/4] linux/const.h: move UL() macro to include/linux/const.h Masahiro Yamada
2017-01-05 11:18   ` Catalin Marinas
2017-01-05 11:24   ` Russell King - ARM Linux
2017-01-05  2:20 ` [PATCH v2 3/4] linux/const.h: refactor _BITUL and _BITULL a bit Masahiro Yamada
2017-01-05  2:20 ` [PATCH v2 4/4] linux/const.h: move BIT(_ULL) to linux/const.h for use in assembly Masahiro Yamada
2017-01-06 10:45 ` [PATCH v2 2/4] linux/const.h: move UL() macro to include/linux/const.h David Howells
2017-01-08  6:27   ` Masahiro Yamada

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).