linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/5] linux/const.h: cleanups of macros such as UL(), _BITUL(), BIT() etc.
@ 2018-02-22 12:15 Masahiro Yamada
  2018-02-22 12:15 ` [PATCH v3 1/5] linux/const.h: prefix include guard of uapi/linux/const.h with _UAPI Masahiro Yamada
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Masahiro Yamada @ 2018-02-22 12:15 UTC (permalink / raw)
  To: Andrew Morton
  Cc: David Howells, linux-arm-kernel, Masahiro Yamada, linux-kernel,
	Will Deacon, linux-m68k, Guan Xuetao, Geert Uytterhoeven,
	Catalin Marinas, Russell King


ARM, ARM64, UniCore32 define UL() as a shorthand of _AC(..., UL).
More architectures may introduce it in the future.

UL() is arch-agnostic, and useful. So let's move it to
include/linux/const.h

Currently, <asm/memory.h> must be included to use UL().
It pulls in more bloats just for defining some bit macros.

I posted V2 one year ago.

The previous posts are:
https://patchwork.kernel.org/patch/9498273/
https://patchwork.kernel.org/patch/9498275/
https://patchwork.kernel.org/patch/9498269/
https://patchwork.kernel.org/patch/9498271/

At that time, what blocked this series was a comment from
David Howells:
  You need to be very careful doing this.  Some userspace stuff
  depends on the guard macro names on the kernel header files.

(https://patchwork.kernel.org/patch/9498275/)

Looking at the code closer, I noticed this is not a problem.

See the following line.
https://github.com/torvalds/linux/blob/v4.16-rc2/scripts/headers_install.sh#L40

scripts/headers_install.sh rips off _UAPI prefix from guard macro names.

I ran "make headers_install" and confirmed the result is what I expect.

So, we can prefix the include guard of include/uapi/linux/const.h,
and add a new include/linux/const.h.



Masahiro Yamada (5):
  linux/const.h: prefix include guard of uapi/linux/const.h with _UAPI
  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] 12+ messages in thread

end of thread, other threads:[~2018-03-13  8:40 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-22 12:15 [PATCH v3 0/5] linux/const.h: cleanups of macros such as UL(), _BITUL(), BIT() etc Masahiro Yamada
2018-02-22 12:15 ` [PATCH v3 1/5] linux/const.h: prefix include guard of uapi/linux/const.h with _UAPI Masahiro Yamada
2018-02-22 12:15 ` [PATCH v3 2/5] m68k: rename UL() to TO_UL() Masahiro Yamada
2018-02-22 13:20   ` Geert Uytterhoeven
2018-02-22 16:58     ` Masahiro Yamada
2018-02-26  9:49       ` Geert Uytterhoeven
2018-02-22 12:15 ` [PATCH v3 3/5] linux/const.h: move UL() macro to include/linux/const.h Masahiro Yamada
2018-02-22 12:15 ` [PATCH v3 4/5] linux/const.h: refactor _BITUL and _BITULL a bit Masahiro Yamada
2018-02-22 12:15 ` [PATCH v3 5/5] linux/const.h: move BIT(_ULL) to linux/const.h for use in assembly Masahiro Yamada
2018-02-24  5:00   ` kbuild test robot
2018-02-26  2:13     ` Masahiro Yamada
2018-03-13  8:39   ` 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).