[PATCH v2 0/6] make use of gcc 9's "asm inline()"

From: Rasmus Villemoes
Date: Fri Aug 30 2019 - 19:15:36 EST


gcc 9 provides a way to override the otherwise crude heuristic that
gcc uses to estimate the size of the code represented by an asm()
statement. From the gcc docs

If you use 'asm inline' instead of just 'asm', then for inlining
purposes the size of the asm is taken as the minimum size, ignoring
how many instructions GCC thinks it is.

For compatibility with older compilers, we obviously want a

#if new enough
#define asm_inline asm inline
#else
#define asm_inline asm
#endif

But since we #define the identifier inline to attach some attributes,
we have to use an alternate spelling of that keyword. gcc provides
both __inline__ and __inline, and we currently #define both to inline,
so they all have the same semantics. We have to free up one of
__inline__ and __inline, and the latter is by far the easiest.

The two x86 changes cause smaller code gen differences than I'd
expect, but I think we do want the asm_inline thing available sooner
or later, so this is just to get the ball rolling.

Changes since v1: __inline instead of __inline__, making the diffstat
400 lines smaller. Probably no longer needs special handling (having
Linus run a script to generate patch 1), so if the x86 folks want 5/6
and 6/6, perhaps the whole thing can be routed that way.

Rasmus Villemoes (6):
staging: rtl8723bs: replace __inline by inline
lib/zstd/mem.h: replace __inline by inline
compiler_types.h: don't #define __inline
compiler-gcc.h: add asm_inline definition
x86: alternative.h: use asm_inline for all alternative variants
x86: bug.h: use asm_inline in _BUG_FLAGS definitions

arch/x86/include/asm/alternative.h | 14 +++++++-------
arch/x86/include/asm/bug.h | 4 ++--
drivers/staging/rtl8723bs/core/rtw_pwrctrl.c | 4 ++--
drivers/staging/rtl8723bs/core/rtw_wlan_util.c | 2 +-
drivers/staging/rtl8723bs/include/drv_types.h | 6 +++---
.../staging/rtl8723bs/include/osdep_service.h | 10 +++++-----
.../rtl8723bs/include/osdep_service_linux.h | 14 +++++++-------
drivers/staging/rtl8723bs/include/rtw_mlme.h | 14 +++++++-------
drivers/staging/rtl8723bs/include/rtw_recv.h | 16 ++++++++--------
drivers/staging/rtl8723bs/include/sta_info.h | 2 +-
drivers/staging/rtl8723bs/include/wifi.h | 14 +++++++-------
drivers/staging/rtl8723bs/include/wlan_bssdef.h | 2 +-
include/linux/compiler-gcc.h | 4 ++++
include/linux/compiler_types.h | 15 ++++++++++++++-
lib/zstd/mem.h | 2 +-
15 files changed, 70 insertions(+), 53 deletions(-)

--
2.20.1