extern inline native_save_fl for paravirt
Subsystems (52)
v2 cover extern inline native_save_fl for paravirt
paravirt depends on a custom calling convention (callee saved), but expects this from a static inline function that it then forces to be outlined. This is problematic because different compilers or flags can then add a stack guard that violates the calling conventions.
Uses extern inline with the out-of-line definition in assembly to prevent compilers from adding stack guards to the outlined version.
Other parts of the codebase overwrite KBUILD_CFLAGS, which is *extremely problematic* for extern inline, as the sematics are completely the opposite depending on what C standard is used.
http://blahg.josefsipek.net/?p=529
Changes since v2:
Prefer gnu_inline function attribute instead of explicitly setting C standard compiler flag in problematic Makefiles. We should instead carefully evaluate if those Makefiles should be overwriting KBUILD_CFLAGS at all. Dropped the previous first two patches and added a new first patch.
Nick Desaulniers (2):
compiler-gcc.h: add gnu_inline to all inline declarations
x86: paravirt: make native_save_fl extern inline
arch/x86/include/asm/irqflags.h | 2 +- arch/x86/kernel/Makefile | 1 + arch/x86/kernel/irqflags.S | 26 ++++++++++++++++++++++++++ include/linux/compiler-gcc.h | 19 +++++++++++++------ 4 files changed, 41 insertions(+), 7 deletions(-) create mode 100644 arch/x86/kernel/irqflags.S
Signature · 1 line
2.17.1.1185.g55be947832-goog
PATCH v2 1/2 compiler-gcc.h: add gnu_inline to all inline declarations
Functions marked extern inline do not emit an externally visible function when the gnu89 C standard is used. Some KBUILD Makefiles overwrite KBUILD_CFLAGS. This is an issue for GCC 5.1+ users as without an explicit C standard specified, the default is gnu11. Since c99, the semantics of extern inline have changed such that an externally visible function is always emitted. This can lead to multiple definition errors of extern inline functions at link time of compilation units whose build files have removed an explicit C standard compiler flag for users of GCC 5.1+ or Clang.
--- include/linux/compiler-gcc.h | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-)
include/linux/compiler-gcc.h +13 -6
@@ -72,17 +72,24 @@* -Wunused-function. This turns out to avoid the need for complex #ifdef * directives. Suppress the warning in clang as well by using "unused" * function attribute, which is redundant but not harmful for gcc. +* Prefer gnu_inline, so that extern inline functions do not emit an +* externally visible function. This makes extern inline behave as per gnu89 +* semantics rather than c99. This prevents multiple symbol definition errors +* of extern inline functions at link time. */ #if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING ) || \ !defined(CONFIG_OPTIMIZE_INLINING ) || (__GNUC__ <4 ) -#define inline inline __attribute__((always_inline,unused)) notrace -#define __inline__ __inline__ __attribute__((always_inline,unused)) notrace -#define __inline __inline __attribute__((always_inline,unused)) notrace +#define inline \ + inline __attribute__((always_inline, unused, gnu_inline)) notrace +#define __inline__ \ + __inline__ __attribute__((always_inline, unused, gnu_inline)) notrace +#define __inline \ + __inline __attribute__((always_inline, unused, gnu_inline)) notrace#else /* A lot of inline functions can cause havoc with function tracing */ -#define inline inline __attribute__((unused)) notrace -#define __inline__ __inline__ __attribute__((unused)) notrace -#define __inline __inline __attribute__((unused)) notrace +#define inline inline __attribute__((unused, gnu_inline)) notrace +#define __inline__ __inline__ __attribute__((unused, gnu_inline)) notrace +#define __inline __inline __attribute__((unused, gnu_inline)) notrace#endif #define __always_inline inline __attribute__((always_inline))
Signature · 1 line
2.17.1.1185.g55be947832-goog
Re: [PATCH v2 1/2] compiler-gcc.h: add gnu_inline to all inline declarations
Quoted 9 lines · Nick Desaulniers
Functions marked extern inline do not emit an externally visible function when the gnu89 C standard is used. Some KBUILD Makefiles overwrite
KBUILD_CFLAGS. This is an issue for GCC 5.1+ users as without an explicit C standard specified, the default is gnu11. Since c99, the semantics of extern inline have changed such that an externally visible function is always emitted. This can lead to multiple definition errors of extern inline functions at link time of compilation units whose build files have removed an explicit C standard compiler flag for users of GCC 5.1+ or Clang.
[]
include/linux/compiler-gcc.h
Quoted 1 line
include/linux/compiler-gcc.h +0
-0
[]
Quoted 10 lines
include/linux/compiler-gcc.h +4
-0@@ -72,17 +72,24 @@* -Wunused-function. This turns out to avoid the need for complex #ifdef * directives. Suppress the warning in clang as well by using "unused" * function attribute, which is redundant but not harmful for gcc. +* Prefer gnu_inline, so that extern inline functions do not emit an +* externally visible function. This makes extern inline behave as per gnu89 +* semantics rather than c99. This prevents multiple symbol definition errors +* of extern inline functions at link time. */ #if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \
include/linux/compiler-gcc.h line 87
Quoted 10 lines
include/linux/compiler-gcc.h +6
-3!defined(CONFIG_OPTIMIZE_INLINING) || (__GNUC__ < 4) -#define inline inline __attribute__((always_inline,unused)) notrace -#define __inline__ __inline__ __attribute__((always_inline,unused)) notrace -#define __inline __inline __attribute__((always_inline,unused)) notrace +#define inline \ + inline __attribute__((always_inline, unused, gnu_inline)) notrace +#define __inline__ \ + __inline__ __attribute__((always_inline, unused, gnu_inline)) notrace +#define __inline \ + __inline __attribute__((always_inline, unused, gnu_inline)) notrace
Perhaps these are simpler as
#define __inline__ inline
#define __inline inline
include/linux/compiler-gcc.h line 93
Quoted 9 lines
include/linux/compiler-gcc.h +3
-3#else /* A lot of inline functions can cause havoc with function tracing */ -#define inline inline __attribute__((unused)) notrace -#define __inline__ __inline__ __attribute__((unused)) notrace -#define __inline __inline __attribute__((unused)) notrace +#define inline inline __attribute__((unused, gnu_inline)) notrace +#define __inline__ __inline__ __attribute__((unused, gnu_inline)) notrace +#define __inline __inline __attribute__((unused, gnu_inline)) notrace#endif
And only set once along with:
include/linux/compiler-gcc.h line 95
Quoted 1 line
include/linux/compiler-gcc.h +0
-0#define __always_inline inline __attribute__((always_inline))
And perhaps this __always_inline should be updated with gnu_inline as well
Re: [PATCH v2 1/2] compiler-gcc.h: add gnu_inline to all inline declarations
Quoted 30 lines · Joe Perches
include/linux/compiler-gcc.h line 87
Quoted 11 lines · Nick Desaulniers
#if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \ !defined(CONFIG_OPTIMIZE_INLINING) || (__GNUC__ < 4)include/linux/compiler-gcc.h +6
-3-#define inline inline __attribute__((always_inline,unused)) notrace -#define __inline__ __inline__ __attribute__((always_inline,unused)) notrace -#define __inline __inline __attribute__((always_inline,unused)) notrace +#define inline \ + inline __attribute__((always_inline, unused, gnu_inline)) notrace +#define __inline__ \ + __inline__ __attribute__((always_inline, unused, gnu_inline)) notrace +#define __inline \ + __inline __attribute__((always_inline, unused, gnu_inline)) notracePerhaps these are simpler as
#define
__inline__inline
#define__inlineinlineinclude/linux/compiler-gcc.h line 93
Quoted 9 lines
#else
/* A lot of inline functions can cause havoc with function tracing */include/linux/compiler-gcc.h +3
-3-#define inline inline __attribute__((unused)) notrace -#define __inline__ __inline__ __attribute__((unused)) notrace -#define __inline __inline __attribute__((unused)) notrace +#define inline inline __attribute__((unused, gnu_inline)) notrace +#define __inline__ __inline__ __attribute__((unused, gnu_inline)) notrace +#define __inline __inline __attribute__((unused, gnu_inline)) notrace#endif And only set once along with:
Quoted 5 lines
Quoted 1 line
#define
__always_inlineinline __attribute__((always_inline))And perhaps this
__always_inlineshould be updated withgnu_inlineas well
Great idea, I'll pick this up and add you to the Suggested-by: tag in v3. Thanks Joe!
Signature · 2 lines
Thanks, ~Nick Desaulniers
Re: [PATCH v2 1/2] compiler-gcc.h: add gnu_inline to all inline declarations
In reply to Joe PerchesQuoted 4 lines · Joe Perches
Perhaps these are simpler as
#define
__inline__inline
#define__inlineinline
Currently, there are these uses of inline variants in the kernel
$ git grep -w inline | wc -l 68410 $ git grep -w __inline__ | wc -l 503 $ git grep -w __inline | wc -l 57
So it seems it's also reasonable to sed all uses of __inline to inline and perhaps remove __inline eventually altogether.
(perhaps there are still too many __inline__ uses)
Excluding scripts and a few other files,
here's a possible patch done with:
$ git grep -w --name-only __inline | \
grep -vP '^(?:arch/alpha/|include/|scripts/)' | \
xargs sed -r -i -e 's/\b__inline\b/inline/g' \
-e 's/\binline\s+static\b/static inline/g'
---
Documentation/trace/tracepoint-analysis.rst | 2 +-
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 +++---
drivers/staging/rtl8723bs/include/ieee80211.h | 6 +++---
drivers/staging/rtl8723bs/include/osdep_service.h | 10 +++++-----
drivers/staging/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 +-
lib/zstd/mem.h | 2 +-
13 files changed, 47 insertions(+), 47 deletions(-)Documentation/trace/tracepoint-analysis.rst +1 -1
@@ -315,7 +315,7 @@ To see where within the function pixmanFillsse2 things are going wrong: 0.00 : 34eeb: 0f 18 08 prefetcht0 (%eax) : } : - : extern __inline void __attribute__((__gnu_inline__, __always_inline__, _ + : extern inline void __attribute__((__gnu_inline__, __always_inline__, _ : _mm_store_si128 (__m128i *__P, __m128i __B) : { : *__P = __B; 12.40 : 34eee: 66 0f 7f 80 40 ff ff movdqa %xmm0,-0xc0(%eax)
drivers/staging/rtl8723bs/core/rtw_pwrctrl.c +2 -2
@@ -839,12 +839,12 @@ static void pwr_rpwm_timeout_handler(struct timer_list *t)_set_workitem (&pwrpriv->rpwmtimeoutwi); } -static __inlinevoid register_task_alive (struct pwrctrl_priv *pwrctrl,u32 tag) +static inline void register_task_alive (struct pwrctrl_priv *pwrctrl,u32 tag) { pwrctrl->alives |= tag; } -static __inlinevoid unregister_task_alive (struct pwrctrl_priv *pwrctrl,u32 tag) +static inline void unregister_task_alive (struct pwrctrl_priv *pwrctrl,u32 tag) { pwrctrl->alives &= ~tag; }
drivers/staging/rtl8723bs/core/rtw_wlan_util.c +1 -1
@@ -493,7 +493,7 @@ void set_channel_bwmode(struct adapter *padapter, unsigned char channel, unsignemutex_unlock (&(adapter_to_dvobj (padapter)->setch_mutex)); } -__inlineu8 *get_my_bssid (struct wlan_bssid_ex *pnetwork) +inline u8 *get_my_bssid (struct wlan_bssid_ex *pnetwork) {return pnetwork->MacAddress; }
drivers/staging/rtl8723bs/include/drv_types.h +3 -3
@@ -493,7 +493,7 @@ struct dvobj_priv#define dvobj_to_pwrctl (dvobj) (&(dvobj->pwrctl_priv))#define pwrctl_to_dvobj (pwrctl) container_of(pwrctl, struct dvobj_priv, pwrctl_priv) -__inlinestatic struct device *dvobj_to_dev (struct dvobj_priv *dvobj) +static inline struct device *dvobj_to_dev (struct dvobj_priv *dvobj) {/* todo: get interface type from dvobj and the return the dev accordingly */ #ifdef RTW_DVOBJ_CHIP_HW_TYPE
@@ -651,14 +651,14 @@ struct adapter {/* define RTW_DISABLE_FUNC(padapter, func) (atomic_add(&adapter_to_dvobj(padapter)->disable_func, (func))) */ /* define RTW_ENABLE_FUNC(padapter, func) (atomic_sub(&adapter_to_dvobj(padapter)->disable_func, (func))) */ -__inlinestatic void RTW_DISABLE_FUNC (struct adapter *padapter,int func_bit) +static inline void RTW_DISABLE_FUNC (struct adapter *padapter,int func_bit) {int df =atomic_read (&adapter_to_dvobj (padapter)->disable_func); df |= func_bit;atomic_set (&adapter_to_dvobj (padapter)->disable_func, df); } -__inlinestatic void RTW_ENABLE_FUNC (struct adapter *padapter,int func_bit) +static inline void RTW_ENABLE_FUNC (struct adapter *padapter,int func_bit) {int df =atomic_read (&adapter_to_dvobj (padapter)->disable_func); df &= ~(func_bit);
drivers/staging/rtl8723bs/include/ieee80211.h +3 -3
@@ -858,18 +858,18 @@ enum ieee80211_state {#define IP_FMT "%pI4"#define IP_ARG (x) (x) -extern __inlineint is_multicast_mac_addr (const u8 *addr) +extern inline int is_multicast_mac_addr (const u8 *addr) {return ((addr[0 ] !=0xff ) && (0x01 & addr[0 ])); } -extern __inlineint is_broadcast_mac_addr (const u8 *addr) +extern inline int is_broadcast_mac_addr (const u8 *addr) {return ((addr[0 ] ==0xff ) && (addr[1 ] ==0xff ) && (addr[2 ] ==0xff ) && \ (addr[3 ] ==0xff ) && (addr[4 ] ==0xff ) && (addr[5 ] ==0xff )); } -extern __inlineint is_zero_mac_addr (const u8 *addr) +extern inline int is_zero_mac_addr (const u8 *addr) {return ((addr[0 ] ==0x00 ) && (addr[1 ] ==0x00 ) && (addr[2 ] ==0x00 ) && \ (addr[3 ] ==0x00 ) && (addr[4 ] ==0x00 ) && (addr[5 ] ==0x00 ));
drivers/staging/rtl8723bs/include/osdep_service.h +5 -5
@@ -118,12 +118,12 @@ int _rtw_netif_rx(_nic_hdl ndev, struct sk_buff *skb);extern void _rtw_init_queue (struct __queue *pqueue); -static __inlinevoid thread_enter (char *name) +static inline void thread_enter (char *name) {allow_signal (SIGTERM ); } -__inlinestatic void flush_signals_thread (void ) +static inline void flush_signals_thread (void ) {if (signal_pending (current)) {
@@ -133,7 +133,7 @@ __inline static void flush_signals_thread(void)#define rtw_warn_on (condition) WARN_ON(condition) -__inlinestatic int rtw_bug_check (void *parg1,void *parg2,void *parg3,void *parg4) +static inline int rtw_bug_check (void *parg1,void *parg2,void *parg3,void *parg4) {int ret = true;
@@ -144,7 +144,7 @@ __inline static int rtw_bug_check(void *parg1, void *parg2, void *parg3, void *p#define _RND (sz, r) ((((sz)+((r)-1))/(r))*(r))#define RND4 (x) (((x >> 2) + (((x & 3) == 0) ? 0: 1)) << 2) -__inlinestatic u32 _RND4 (u32 sz) +static inline u32 _RND4 (u32 sz) {u32 val;
@@ -155,7 +155,7 @@ __inline static u32 _RND4(u32 sz) } -__inlinestatic u32 _RND8 (u32 sz) +static inline u32 _RND8 (u32 sz) {u32 val;
drivers/staging/rtl8723bs/include/osdep_service_linux.h +7 -7
@@ -74,12 +74,12 @@typedef struct work_struct _workitem ; -__inlinestatic struct list_head *get_next (struct list_head *list) +static inline struct list_head *get_next (struct list_head *list) {return list->next; } -__inlinestatic struct list_head *get_list_head (struct __queue *queue) +static inline struct list_head *get_list_head (struct __queue *queue) {return (&(queue->queue)); }
@@ -88,28 +88,28 @@ __inline static struct list_head *get_list_head(struct __queue *queue)#define LIST_CONTAINOR (ptr, type, member) \ container_of(ptr, type, member) -__inlinestatic void _set_timer (_timer *ptimer,u32 delay_time) +static inline void _set_timer (_timer *ptimer,u32 delay_time) {mod_timer (ptimer , (jiffies+(delay_time*HZ /1000 ))); } -__inlinestatic void _cancel_timer (_timer *ptimer,u8 *bcancelled) +static inline void _cancel_timer (_timer *ptimer,u8 *bcancelled) {del_timer_sync (ptimer); *bcancelled = true;/* true == 1; false == 0 */ } -__inlinestatic void _init_workitem (_workitem *pwork,void *pfunc,void *cntx) +static inline void _init_workitem (_workitem *pwork,void *pfunc,void *cntx) {INIT_WORK (pwork, pfunc); } -__inlinestatic void _set_workitem (_workitem *pwork) +static inline void _set_workitem (_workitem *pwork) {schedule_work (pwork); } -__inlinestatic void _cancel_workitem_sync (_workitem *pwork) +static inline void _cancel_workitem_sync (_workitem *pwork) {cancel_work_sync (pwork); }
drivers/staging/rtl8723bs/include/rtw_mlme.h +7 -7
@@ -533,13 +533,13 @@ extern sint rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv);extern sint rtw_set_key (struct adapter *adapter,struct security_priv *psecuritypriv,sint keyid,u8 set_tx,bool enqueue);extern sint rtw_set_auth (struct adapter *adapter,struct security_priv *psecuritypriv); -__inlinestatic u8 *get_bssid (struct mlme_priv *pmlmepriv) +static inline u8 *get_bssid (struct mlme_priv *pmlmepriv) {/* if sta_mode:pmlmepriv->cur_network.network.MacAddress => bssid */ /* if adhoc_mode:pmlmepriv->cur_network.network.MacAddress => ibss mac address */ return pmlmepriv->cur_network.network.MacAddress; } -__inlinestatic sint check_fwstate (struct mlme_priv *pmlmepriv,sint state) +static inline sint check_fwstate (struct mlme_priv *pmlmepriv,sint state) {if (pmlmepriv->fw_state & state)return true;
@@ -547,7 +547,7 @@ __inline static sint check_fwstate(struct mlme_priv *pmlmepriv, sint state)return false; } -__inlinestatic sint get_fwstate (struct mlme_priv *pmlmepriv) +static inline sint get_fwstate (struct mlme_priv *pmlmepriv) {return pmlmepriv->fw_state; }
@@ -559,7 +559,7 @@ __inline static sint get_fwstate(struct mlme_priv *pmlmepriv)* ### NOTE:#### (!!!!) * MUST TAKE CARE THAT BEFORE CALLING THIS FUNC, YOU SHOULD HAVE LOCKED pmlmepriv->lock */ -__inlinestatic void set_fwstate (struct mlme_priv *pmlmepriv,sint state) +static inline void set_fwstate (struct mlme_priv *pmlmepriv,sint state) { pmlmepriv->fw_state |= state;/* FOR HW integration */
@@ -568,7 +568,7 @@ __inline static void set_fwstate(struct mlme_priv *pmlmepriv, sint state) } } -__inlinestatic void _clr_fwstate_ (struct mlme_priv *pmlmepriv,sint state) +static inline void _clr_fwstate_ (struct mlme_priv *pmlmepriv,sint state) { pmlmepriv->fw_state &= ~state;/* FOR HW integration */
@@ -581,7 +581,7 @@ __inline static void _clr_fwstate_(struct mlme_priv *pmlmepriv, sint state)* No Limit on the calling context, * therefore set it to be the critical section... */ -__inlinestatic void clr_fwstate (struct mlme_priv *pmlmepriv,sint state) +static inline void clr_fwstate (struct mlme_priv *pmlmepriv,sint state) {spin_lock_bh (&pmlmepriv->lock);if (check_fwstate (pmlmepriv, state) == true)
@@ -589,7 +589,7 @@ __inline static void clr_fwstate(struct mlme_priv *pmlmepriv, sint state)spin_unlock_bh (&pmlmepriv->lock); } -__inlinestatic void set_scanned_network_val (struct mlme_priv *pmlmepriv,sint val) +static inline void set_scanned_network_val (struct mlme_priv *pmlmepriv,sint val) {spin_lock_bh (&pmlmepriv->lock); pmlmepriv->num_of_scanned = val;
drivers/staging/rtl8723bs/include/rtw_recv.h +8 -8
@@ -413,7 +413,7 @@ struct recv_buf *rtw_dequeue_recvbuf (struct __queue *queue);void rtw_reordering_ctrl_timeout_handler (struct timer_list *t); -__inlinestatic u8 *get_rxmem (union recv_frame *precvframe) +static inline u8 *get_rxmem (union recv_frame *precvframe) {/* always return rx_head... */ if (precvframe ==NULL )
@@ -422,7 +422,7 @@ __inline static u8 *get_rxmem(union recv_frame *precvframe)return precvframe->u.hdr.rx_head; } -__inlinestatic u8 *get_recvframe_data (union recv_frame *precvframe) +static inline u8 *get_recvframe_data (union recv_frame *precvframe) {/* alwasy return rx_data */
@@ -433,7 +433,7 @@ __inline static u8 *get_recvframe_data(union recv_frame *precvframe) } -__inlinestatic u8 *recvframe_pull (union recv_frame *precvframe,sint sz) +static inline u8 *recvframe_pull (union recv_frame *precvframe,sint sz) {/* rx_data += sz; move rx_data sz bytes hereafter */
@@ -458,7 +458,7 @@ __inline static u8 *recvframe_pull(union recv_frame *precvframe, sint sz) } -__inlinestatic u8 *recvframe_put (union recv_frame *precvframe,sint sz) +static inline u8 *recvframe_put (union recv_frame *precvframe,sint sz) {/* rx_tai += sz; move rx_tail sz bytes hereafter */
@@ -487,7 +487,7 @@ __inline static u8 *recvframe_put(union recv_frame *precvframe, sint sz) -__inlinestatic u8 *recvframe_pull_tail (union recv_frame *precvframe,sint sz) +static inline u8 *recvframe_pull_tail (union recv_frame *precvframe,sint sz) {/* rmv data from rx_tail (by yitsen) */
@@ -511,7 +511,7 @@ __inline static u8 *recvframe_pull_tail(union recv_frame *precvframe, sint sz) } -__inlinestatic union recv_frame *rxmem_to_recvframe (u8 *rxmem) +static inline union recv_frame *rxmem_to_recvframe (u8 *rxmem) {/* due to the design of 2048 bytes alignment of recv_frame, we can reference the union recv_frame */ /* from any given member of recv_frame. */
@@ -521,13 +521,13 @@ __inline static union recv_frame *rxmem_to_recvframe(u8 *rxmem) } -__inlinestatic sint get_recvframe_len (union recv_frame *precvframe) +static inline sint get_recvframe_len (union recv_frame *precvframe) {return precvframe->u.hdr.len; } -__inlinestatic s32 translate_percentage_to_dbm (u32 SignalStrengthIndex) +static inline s32 translate_percentage_to_dbm (u32 SignalStrengthIndex) {s32 SignalPower;/* in dBm. */
drivers/staging/rtl8723bs/include/sta_info.h +1 -1
@@ -356,7 +356,7 @@ struct sta_priv { }; -__inlinestatic u32 wifi_mac_hash (u8 *mac) +static inline u32 wifi_mac_hash (u8 *mac) {u32 x;
drivers/staging/rtl8723bs/include/wifi.h +7 -7
@@ -355,7 +355,7 @@ enum WIFI_REG_DOMAIN { (addr[4] == 0xff) && (addr[5] == 0xff)) ? true : false \ ) -__inlinestatic int IS_MCAST (unsigned char *da) +static inline int IS_MCAST (unsigned char *da) {if ((*da) &0x01 )return true;
@@ -363,20 +363,20 @@ __inline static int IS_MCAST(unsigned char *da)return false; } -__inlinestatic unsigned char *get_ra (unsigned char *pframe) +static inline unsigned char *get_ra (unsigned char *pframe) {unsigned char *ra; ra =GetAddr1Ptr (pframe);return ra; } -__inlinestatic unsigned char *get_ta (unsigned char *pframe) +static inline unsigned char *get_ta (unsigned char *pframe) {unsigned char *ta; ta =GetAddr2Ptr (pframe);return ta; } -__inlinestatic unsigned char *get_da (unsigned char *pframe) +static inline unsigned char *get_da (unsigned char *pframe) {unsigned char *da;unsigned int to_fr_ds = (GetToDs (pframe) <<1 ) |GetFrDs (pframe);
@@ -400,7 +400,7 @@ __inline static unsigned char * get_da(unsigned char *pframe) } -__inlinestatic unsigned char *get_sa (unsigned char *pframe) +static inline unsigned char *get_sa (unsigned char *pframe) {unsigned char *sa;unsigned int to_fr_ds = (GetToDs (pframe) <<1 ) |GetFrDs (pframe);
@@ -423,7 +423,7 @@ __inline static unsigned char * get_sa(unsigned char *pframe)return sa; } -__inlinestatic unsigned char *get_hdr_bssid (unsigned char *pframe) +static inline unsigned char *get_hdr_bssid (unsigned char *pframe) {unsigned char *sa =NULL ;unsigned int to_fr_ds = (GetToDs (pframe) <<1 ) |GetFrDs (pframe);
@@ -447,7 +447,7 @@ __inline static unsigned char * get_hdr_bssid(unsigned char *pframe) } -__inlinestatic int IsFrameTypeCtrl (unsigned char *pframe) +static inline int IsFrameTypeCtrl (unsigned char *pframe) {if (WIFI_CTRL_TYPE ==GetFrameType (pframe))return true;
drivers/staging/rtl8723bs/include/wlan_bssdef.h +1 -1
@@ -231,7 +231,7 @@ struct wlan_bssid_ex {u8 IEs[MAX_IE_SZ ];/* timestamp, beacon interval, and capability information) */ } __packed; -__inlinestatic uint get_wlan_bssid_ex_sz (struct wlan_bssid_ex *bss) +static inline uint get_wlan_bssid_ex_sz (struct wlan_bssid_ex *bss) {return (sizeof (struct wlan_bssid_ex ) -MAX_IE_SZ + bss->IELength); }
lib/zstd/mem.h +1 -1
@@ -27,7 +27,7 @@/*-**************************************** * Compiler specifics ******************************************/ -#define ZSTD_STATIC static __inline __attribute__((unused)) +#define ZSTD_STATIC static inline __attribute__((unused))/*-************************************************************** * Basic Types
Re: [PATCH v2 1/2] compiler-gcc.h: add gnu_inline to all inline declarations
Quoted 16 lines · Joe Perches
Quoted 4 lines · Joe Perches
Perhaps these are simpler as
#define
__inline__inline
#define__inlineinlineCurrently, there are these uses of inline variants in the kernel
$ git grep -w inline | wc -l 68410 $ git grep -w __inline__ | wc -l 503 $ git grep -w __inline | wc -l 57
Quoted 3 lines
So it seems it's also reasonable to sed all uses of
__inlineto inline and perhaps remove__inlineeventually altogether.
(perhaps there are still too many__inline__uses)
Yeah, that sounds good. Should I split that into 3 patches:
Quoted 14 lines
Excluding scripts and a few other files,
here's a possible patch done with:$ git grep -w --name-only __inline | \ grep -vP '^(?:arch/alpha/|include/|scripts/)' | \ xargs sed -r -i -e 's/\b__inline\b/inline/g' \ -e 's/\binline\s+static\b/static inline/g' --- Documentation/trace/tracepoint-analysis.rst | 2 +- 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 +++--- drivers/staging/rtl8723bs/include/ieee80211.h | 6 +++--- drivers/staging/rtl8723bs/include/osdep_service.h | 10 +++++-----
Quoted 8 lines
drivers/staging/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 +- lib/zstd/mem.h | 2 +- 13 files changed, 47 insertions(+), 47 deletions(-)
1 for documentation, 1 for rtl8723bs, 1 for zstd?
Follow up set or include in v3?
Signature · 2 lines
Thanks, ~Nick Desaulniers
Re: [PATCH v2 1/2] compiler-gcc.h: add gnu_inline to all inline declarations
Quoted 47 lines · Nick Desaulniers
Quoted 16 lines · Joe Perches
Quoted 4 lines · Joe Perches
Perhaps these are simpler as
#define
__inline__inline
#define__inlineinlineCurrently, there are these uses of inline variants in the kernel
$ git grep -w inline | wc -l 68410 $ git grep -w __inline__ | wc -l 503 $ git grep -w __inline | wc -l 57Quoted 3 lines
So it seems it's also reasonable to sed all uses of
__inlineto inline and perhaps remove__inlineeventually altogether.
(perhaps there are still too many__inline__uses)Yeah, that sounds good. Should I split that into 3 patches:
Quoted 14 lines
Excluding scripts and a few other files,
here's a possible patch done with:$ git grep -w --name-only __inline | \ grep -vP '^(?:arch/alpha/|include/|scripts/)' | \ xargs sed -r -i -e 's/\b__inline\b/inline/g' \ -e 's/\binline\s+static\b/static inline/g' --- Documentation/trace/tracepoint-analysis.rst | 2 +- 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 +++--- drivers/staging/rtl8723bs/include/ieee80211.h | 6 +++--- drivers/staging/rtl8723bs/include/osdep_service.h | 10 +++++-----Quoted 8 lines
drivers/staging/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 +- lib/zstd/mem.h | 2 +- 13 files changed, 47 insertions(+), 47 deletions(-)
Quoted 1 line
1 for documentation, 1 for rtl8723bs, 1 for zstd?
Seems sensible to me.
Quoted 1 line
Follow up set or include in v3?
Your choice. Probably a follow up would work best.
Also, the remaining __inline uses would be:
arch/alpha/include/asm/compiler.h:#undef __inline include/linux/compiler-gcc.h:#define __inline __inline __attribute__((always_inline,unused)) notrace include/linux/compiler-gcc.h:#define __inline __inline __attribute__((unused)) notrace
scripts/checkpatch.pl:our $Inline = qr{inline|__always_inline|noinline|__inline|__inline__};
scripts/checkpatch.pl:# Check for __inline__ and __inline, prefer inline
scripts/checkpatch.pl: $line =~ /\b(__inline__|__inline)\b/) {
scripts/checkpatch.pl: $fixed[$fixlinenr] =~ s/\b(__inline__|__inline)\b/inline/;
scripts/genksyms/keywords.c: { "__inline", INLINE_KEYW },
scripts/kernel-doc: $prototype =~ s/^__inline +//;So all of these could be removed/updated appropriately too
Re: [PATCH v2 1/2] compiler-gcc.h: add gnu_inline to all inline declarations
In reply to Nick DesaulniersQuoted 47 lines · Nick Desaulniers
Quoted 16 lines · Joe Perches
Quoted 4 lines · Joe Perches
Perhaps these are simpler as
#define
__inline__inline
#define__inlineinlineCurrently, there are these uses of inline variants in the kernel
$ git grep -w inline | wc -l 68410 $ git grep -w __inline__ | wc -l 503 $ git grep -w __inline | wc -l 57Quoted 3 lines
So it seems it's also reasonable to sed all uses of
__inlineto inline and perhaps remove__inlineeventually altogether.
(perhaps there are still too many__inline__uses)Yeah, that sounds good. Should I split that into 3 patches:
Quoted 14 lines
Excluding scripts and a few other files,
here's a possible patch done with:$ git grep -w --name-only __inline | \ grep -vP '^(?:arch/alpha/|include/|scripts/)' | \ xargs sed -r -i -e 's/\b__inline\b/inline/g' \ -e 's/\binline\s+static\b/static inline/g' --- Documentation/trace/tracepoint-analysis.rst | 2 +- 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 +++--- drivers/staging/rtl8723bs/include/ieee80211.h | 6 +++--- drivers/staging/rtl8723bs/include/osdep_service.h | 10 +++++-----Quoted 8 lines
drivers/staging/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 +- lib/zstd/mem.h | 2 +- 13 files changed, 47 insertions(+), 47 deletions(-)
Quoted 1 line
1 for documentation, 1 for rtl8723bs, 1 for zstd?
Seems sensible to me.
Quoted 1 line
Follow up set or include in v3?
Your choice. Probably a follow up would work best.
Also, the remaining __inline uses would be:
arch/alpha/include/asm/compiler.h:#undef __inline include/linux/compiler-gcc.h:#define __inline __inline __attribute__((always_inline,unused)) notrace include/linux/compiler-gcc.h:#define __inline __inline __attribute__((unused)) notrace
scripts/checkpatch.pl:our $Inline = qr{inline|__always_inline|noinline|__inline|__inline__};
scripts/checkpatch.pl:# Check for __inline__ and __inline, prefer inline
scripts/checkpatch.pl: $line =~ /\b(__inline__|__inline)\b/) {
scripts/checkpatch.pl: $fixed[$fixlinenr] =~ s/\b(__inline__|__inline)\b/inline/;
scripts/genksyms/keywords.c: { "__inline", INLINE_KEYW },
scripts/kernel-doc: $prototype =~ s/^__inline +//;So all of these could be removed/updated appropriately too
Re: [PATCH v2 1/2] compiler-gcc.h: add gnu_inline to all inline declarations
In reply to Joe PerchesHi,
when discovering 'gnu_inline', I found ...
$ git grep -w __FORTIFY_INLINE include/linux/string.h:#define __FORTIFY_INLINE extern __always_inline __attribute__((gnu_inline)) include/linux/string.h:__FORTIFY_INLINE char *strncpy(char *p, const char *q, __kernel_size_t size) include/linux/string.h:__FORTIFY_INLINE char *strcat(char *p, const char *q) include/linux/string.h:__FORTIFY_INLINE __kernel_size_t strlen(const char *p) include/linux/string.h:__FORTIFY_INLINE __kernel_size_t strnlen(const char *p, __kernel_size_t maxlen) include/linux/string.h:__FORTIFY_INLINE size_t strlcpy(char *p, const char *q, size_t size) include/linux/string.h:__FORTIFY_INLINE char *strncat(char *p, const char *q, __kernel_size_t count) include/linux/string.h:__FORTIFY_INLINE void *memset(void *p, int c, __kernel_size_t size) include/linux/string.h:__FORTIFY_INLINE void *memcpy(void *p, const void *q, __kernel_size_t size) include/linux/string.h:__FORTIFY_INLINE void *memmove(void *p, const void *q, __kernel_size_t size) include/linux/string.h:__FORTIFY_INLINE void *memscan(void *p, int c, __kernel_size_t size) include/linux/string.h:__FORTIFY_INLINE int memcmp(const void *p, const void *q, __kernel_size_t size) include/linux/string.h:__FORTIFY_INLINE void *memchr(const void *p, int c, __kernel_size_t size) include/linux/string.h:__FORTIFY_INLINE void *memchr_inv(const void *p, int c, size_t size) include/linux/string.h:__FORTIFY_INLINE void *kmemdup(const void *p, size_t size, gfp_t gfp) include/linux/string.h:__FORTIFY_INLINE char *strcpy(char *p, const char *q)
After the inline changes suggested by Joe this can be adapted?
Beyond this, a general question: Can someone explain why all these inline defines are in compiler-gcc.h (as there exists compiler.h and compiler-clang.h)?
Thanks.
Regards,
- Sedat -
[email protected]
reviewerRe: [PATCH v2 1/2] compiler-gcc.h: add gnu_inline to all inline declarations
Quoted 40 lines · Sedat Dilek
Hi,
when discovering '
gnu_inline', I found ...$ git grep -w __FORTIFY_INLINE include/linux/string.h:#define __FORTIFY_INLINE extern __always_inline __attribute__((gnu_inline)) include/linux/string.h:__FORTIFY_INLINE char *strncpy(char *p, const char *q, __kernel_size_t size) include/linux/string.h:__FORTIFY_INLINE char *strcat(char *p, const char *q) include/linux/string.h:__FORTIFY_INLINE __kernel_size_t strlen(const char *p) include/linux/string.h:__FORTIFY_INLINE __kernel_size_t strnlen(const char *p, __kernel_size_t maxlen) include/linux/string.h:__FORTIFY_INLINE size_t strlcpy(char *p, const char *q, size_t size) include/linux/string.h:__FORTIFY_INLINE char *strncat(char *p, const char *q, __kernel_size_t count) include/linux/string.h:__FORTIFY_INLINE void *memset(void *p, int c, __kernel_size_t size) include/linux/string.h:__FORTIFY_INLINE void *memcpy(void *p, const void *q, __kernel_size_t size) include/linux/string.h:__FORTIFY_INLINE void *memmove(void *p, const void *q, __kernel_size_t size) include/linux/string.h:__FORTIFY_INLINE void *memscan(void *p, int c, __kernel_size_t size) include/linux/string.h:__FORTIFY_INLINE int memcmp(const void *p, const void *q, __kernel_size_t size) include/linux/string.h:__FORTIFY_INLINE void *memchr(const void *p, int c, __kernel_size_t size) include/linux/string.h:__FORTIFY_INLINE void *memchr_inv(const void *p, int c, size_t size) include/linux/string.h:__FORTIFY_INLINE void *kmemdup(const void *p, size_t size, gfp_t gfp) include/linux/string.h:__FORTIFY_INLINE char *strcpy(char *p, const char *q)After the inline changes suggested by Joe this can be adapted?
Quoted 8 lines
Beyond this, a general question: Can someone explain why all these inline defines are in
compiler-gcc.h(as there existscompiler.handcompiler-clang.h)?Thanks.
Regards,
- Sedat -
Because gcc itself also supports both GNU89-style and C99-style inlines, but the kernel was built with the former, and it is not necessarily a trivial modification, except for "static inline" which is the same for both.
The other option is to pass -fgnu89-inline on the command line, which is supported by both gcc and clang. The two methods are fully equivalent.
Signature · 1 line
Sent from my Android device with K-9 Mail. Please excuse my brevity.
Re: [PATCH v2 1/2] compiler-gcc.h: add gnu_inline to all inline declarations
On Wed, Jun 6, 2018 at 6:39 PM, <[email protected]> wrote:
...
Quoted 4 lines
Quoted 4 lines
Beyond this, a general question: Can someone explain why all these inline defines are in
compiler-gcc.h(as there existscompiler.handcompiler-clang.h)?
Quoted 9 lines
Quoted 4 lines
Thanks.
Regards,
- Sedat -Because gcc itself also supports both GNU89-style and C99-style inlines, but the kernel was built with the former, and it is not necessarily a trivial modification, except for "static inline" which is the same for both.
The other option is to pass -fgnu89-inline on the command line, which is supported by both gcc and clang. The two methods are fully equivalent.
We have...
$ ls include/linux/compiler* include/linux/compiler-clang.h include/linux/compiler-gcc.h include/linux/compiler.h include/linux/compiler-intel.h include/linux/compiler_types.h
include/linux/compiler_types.h says...
#ifdef __GNUC__
#include <linux/compiler-gcc.h>
#endif
...
/* Intel compiler defines __GNUC__. So we will overwrite implementations
* coming from above header files here
*/
#ifdef __INTEL_COMPILER
# include <linux/compiler-intel.h> #endif
/* Clang compiler defines __GNUC__. So we will overwrite implementations
* coming from above header files here
*/
#ifdef __clang__
#include <linux/compiler-clang.h>
#endif
/*
* Generic compiler-dependent macros required for kernel
* build go below this comment. Actual compiler/compiler version
* specific implementations come from the above header files */
...
include/linux/compiler-clang.h says...
#ifndef __LINUX_COMPILER_TYPES_H
#error "Please don't include <linux/compiler-clang.h> directly, include <linux/compiler.h> instead."
#endif
So, compiler-clang.h uses defines etc. from compiler-gcc.h but might overwrite it.
Correct?
I would have expected inline defines in compiler.h as I thought there is the place for generic stuff.
Maybe you can clarify on the roles of especially compiler.h and compiler_types.h.
Thanks.
- sed@ -
Re: [PATCH v2 1/2] compiler-gcc.h: add gnu_inline to all inline declarations
In reply to Joe PerchesQuoted 4 lines · Joe Perches
Perhaps these are simpler as
#define
__inline__inline
#define__inlineinline
Currently, there are these uses of inline variants in the kernel
$ git grep -w inline | wc -l 68410 $ git grep -w __inline__ | wc -l 503 $ git grep -w __inline | wc -l 57
So it seems it's also reasonable to sed all uses of __inline to inline and perhaps remove __inline eventually altogether.
(perhaps there are still too many __inline__ uses)
Excluding scripts and a few other files,
here's a possible patch done with:
$ git grep -w --name-only __inline | \
grep -vP '^(?:arch/alpha/|include/|scripts/)' | \
xargs sed -r -i -e 's/\b__inline\b/inline/g' \
-e 's/\binline\s+static\b/static inline/g'
---
Documentation/trace/tracepoint-analysis.rst | 2 +-
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 +++---
drivers/staging/rtl8723bs/include/ieee80211.h | 6 +++---
drivers/staging/rtl8723bs/include/osdep_service.h | 10 +++++-----
drivers/staging/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 +-
lib/zstd/mem.h | 2 +-
13 files changed, 47 insertions(+), 47 deletions(-)Documentation/trace/tracepoint-analysis.rst +1 -1
@@ -315,7 +315,7 @@ To see where within the function pixmanFillsse2 things are going wrong: 0.00 : 34eeb: 0f 18 08 prefetcht0 (%eax) : } : - : extern __inline void __attribute__((__gnu_inline__, __always_inline__, _ + : extern inline void __attribute__((__gnu_inline__, __always_inline__, _ : _mm_store_si128 (__m128i *__P, __m128i __B) : { : *__P = __B; 12.40 : 34eee: 66 0f 7f 80 40 ff ff movdqa %xmm0,-0xc0(%eax)
drivers/staging/rtl8723bs/core/rtw_pwrctrl.c +2 -2
@@ -839,12 +839,12 @@ static void pwr_rpwm_timeout_handler(struct timer_list *t)_set_workitem (&pwrpriv->rpwmtimeoutwi); } -static __inlinevoid register_task_alive (struct pwrctrl_priv *pwrctrl,u32 tag) +static inline void register_task_alive (struct pwrctrl_priv *pwrctrl,u32 tag) { pwrctrl->alives |= tag; } -static __inlinevoid unregister_task_alive (struct pwrctrl_priv *pwrctrl,u32 tag) +static inline void unregister_task_alive (struct pwrctrl_priv *pwrctrl,u32 tag) { pwrctrl->alives &= ~tag; }
drivers/staging/rtl8723bs/core/rtw_wlan_util.c +1 -1
@@ -493,7 +493,7 @@ void set_channel_bwmode(struct adapter *padapter, unsigned char channel, unsignemutex_unlock (&(adapter_to_dvobj (padapter)->setch_mutex)); } -__inlineu8 *get_my_bssid (struct wlan_bssid_ex *pnetwork) +inline u8 *get_my_bssid (struct wlan_bssid_ex *pnetwork) {return pnetwork->MacAddress; }
drivers/staging/rtl8723bs/include/drv_types.h +3 -3
@@ -493,7 +493,7 @@ struct dvobj_priv#define dvobj_to_pwrctl (dvobj) (&(dvobj->pwrctl_priv))#define pwrctl_to_dvobj (pwrctl) container_of(pwrctl, struct dvobj_priv, pwrctl_priv) -__inlinestatic struct device *dvobj_to_dev (struct dvobj_priv *dvobj) +static inline struct device *dvobj_to_dev (struct dvobj_priv *dvobj) {/* todo: get interface type from dvobj and the return the dev accordingly */ #ifdef RTW_DVOBJ_CHIP_HW_TYPE
@@ -651,14 +651,14 @@ struct adapter {/* define RTW_DISABLE_FUNC(padapter, func) (atomic_add(&adapter_to_dvobj(padapter)->disable_func, (func))) */ /* define RTW_ENABLE_FUNC(padapter, func) (atomic_sub(&adapter_to_dvobj(padapter)->disable_func, (func))) */ -__inlinestatic void RTW_DISABLE_FUNC (struct adapter *padapter,int func_bit) +static inline void RTW_DISABLE_FUNC (struct adapter *padapter,int func_bit) {int df =atomic_read (&adapter_to_dvobj (padapter)->disable_func); df |= func_bit;atomic_set (&adapter_to_dvobj (padapter)->disable_func, df); } -__inlinestatic void RTW_ENABLE_FUNC (struct adapter *padapter,int func_bit) +static inline void RTW_ENABLE_FUNC (struct adapter *padapter,int func_bit) {int df =atomic_read (&adapter_to_dvobj (padapter)->disable_func); df &= ~(func_bit);
drivers/staging/rtl8723bs/include/ieee80211.h +3 -3
@@ -858,18 +858,18 @@ enum ieee80211_state {#define IP_FMT "%pI4"#define IP_ARG (x) (x) -extern __inlineint is_multicast_mac_addr (const u8 *addr) +extern inline int is_multicast_mac_addr (const u8 *addr) {return ((addr[0 ] !=0xff ) && (0x01 & addr[0 ])); } -extern __inlineint is_broadcast_mac_addr (const u8 *addr) +extern inline int is_broadcast_mac_addr (const u8 *addr) {return ((addr[0 ] ==0xff ) && (addr[1 ] ==0xff ) && (addr[2 ] ==0xff ) && \ (addr[3 ] ==0xff ) && (addr[4 ] ==0xff ) && (addr[5 ] ==0xff )); } -extern __inlineint is_zero_mac_addr (const u8 *addr) +extern inline int is_zero_mac_addr (const u8 *addr) {return ((addr[0 ] ==0x00 ) && (addr[1 ] ==0x00 ) && (addr[2 ] ==0x00 ) && \ (addr[3 ] ==0x00 ) && (addr[4 ] ==0x00 ) && (addr[5 ] ==0x00 ));
drivers/staging/rtl8723bs/include/osdep_service.h +5 -5
@@ -118,12 +118,12 @@ int _rtw_netif_rx(_nic_hdl ndev, struct sk_buff *skb);extern void _rtw_init_queue (struct __queue *pqueue); -static __inlinevoid thread_enter (char *name) +static inline void thread_enter (char *name) {allow_signal (SIGTERM ); } -__inlinestatic void flush_signals_thread (void ) +static inline void flush_signals_thread (void ) {if (signal_pending (current)) {
@@ -133,7 +133,7 @@ __inline static void flush_signals_thread(void)#define rtw_warn_on (condition) WARN_ON(condition) -__inlinestatic int rtw_bug_check (void *parg1,void *parg2,void *parg3,void *parg4) +static inline int rtw_bug_check (void *parg1,void *parg2,void *parg3,void *parg4) {int ret = true;
@@ -144,7 +144,7 @@ __inline static int rtw_bug_check(void *parg1, void *parg2, void *parg3, void *p#define _RND (sz, r) ((((sz)+((r)-1))/(r))*(r))#define RND4 (x) (((x >> 2) + (((x & 3) == 0) ? 0: 1)) << 2) -__inlinestatic u32 _RND4 (u32 sz) +static inline u32 _RND4 (u32 sz) {u32 val;
@@ -155,7 +155,7 @@ __inline static u32 _RND4(u32 sz) } -__inlinestatic u32 _RND8 (u32 sz) +static inline u32 _RND8 (u32 sz) {u32 val;
drivers/staging/rtl8723bs/include/osdep_service_linux.h +7 -7
@@ -74,12 +74,12 @@typedef struct work_struct _workitem ; -__inlinestatic struct list_head *get_next (struct list_head *list) +static inline struct list_head *get_next (struct list_head *list) {return list->next; } -__inlinestatic struct list_head *get_list_head (struct __queue *queue) +static inline struct list_head *get_list_head (struct __queue *queue) {return (&(queue->queue)); }
@@ -88,28 +88,28 @@ __inline static struct list_head *get_list_head(struct __queue *queue)#define LIST_CONTAINOR (ptr, type, member) \ container_of(ptr, type, member) -__inlinestatic void _set_timer (_timer *ptimer,u32 delay_time) +static inline void _set_timer (_timer *ptimer,u32 delay_time) {mod_timer (ptimer , (jiffies+(delay_time*HZ /1000 ))); } -__inlinestatic void _cancel_timer (_timer *ptimer,u8 *bcancelled) +static inline void _cancel_timer (_timer *ptimer,u8 *bcancelled) {del_timer_sync (ptimer); *bcancelled = true;/* true == 1; false == 0 */ } -__inlinestatic void _init_workitem (_workitem *pwork,void *pfunc,void *cntx) +static inline void _init_workitem (_workitem *pwork,void *pfunc,void *cntx) {INIT_WORK (pwork, pfunc); } -__inlinestatic void _set_workitem (_workitem *pwork) +static inline void _set_workitem (_workitem *pwork) {schedule_work (pwork); } -__inlinestatic void _cancel_workitem_sync (_workitem *pwork) +static inline void _cancel_workitem_sync (_workitem *pwork) {cancel_work_sync (pwork); }
drivers/staging/rtl8723bs/include/rtw_mlme.h +7 -7
@@ -533,13 +533,13 @@ extern sint rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv);extern sint rtw_set_key (struct adapter *adapter,struct security_priv *psecuritypriv,sint keyid,u8 set_tx,bool enqueue);extern sint rtw_set_auth (struct adapter *adapter,struct security_priv *psecuritypriv); -__inlinestatic u8 *get_bssid (struct mlme_priv *pmlmepriv) +static inline u8 *get_bssid (struct mlme_priv *pmlmepriv) {/* if sta_mode:pmlmepriv->cur_network.network.MacAddress => bssid */ /* if adhoc_mode:pmlmepriv->cur_network.network.MacAddress => ibss mac address */ return pmlmepriv->cur_network.network.MacAddress; } -__inlinestatic sint check_fwstate (struct mlme_priv *pmlmepriv,sint state) +static inline sint check_fwstate (struct mlme_priv *pmlmepriv,sint state) {if (pmlmepriv->fw_state & state)return true;
@@ -547,7 +547,7 @@ __inline static sint check_fwstate(struct mlme_priv *pmlmepriv, sint state)return false; } -__inlinestatic sint get_fwstate (struct mlme_priv *pmlmepriv) +static inline sint get_fwstate (struct mlme_priv *pmlmepriv) {return pmlmepriv->fw_state; }
@@ -559,7 +559,7 @@ __inline static sint get_fwstate(struct mlme_priv *pmlmepriv)* ### NOTE:#### (!!!!) * MUST TAKE CARE THAT BEFORE CALLING THIS FUNC, YOU SHOULD HAVE LOCKED pmlmepriv->lock */ -__inlinestatic void set_fwstate (struct mlme_priv *pmlmepriv,sint state) +static inline void set_fwstate (struct mlme_priv *pmlmepriv,sint state) { pmlmepriv->fw_state |= state;/* FOR HW integration */
@@ -568,7 +568,7 @@ __inline static void set_fwstate(struct mlme_priv *pmlmepriv, sint state) } } -__inlinestatic void _clr_fwstate_ (struct mlme_priv *pmlmepriv,sint state) +static inline void _clr_fwstate_ (struct mlme_priv *pmlmepriv,sint state) { pmlmepriv->fw_state &= ~state;/* FOR HW integration */
@@ -581,7 +581,7 @@ __inline static void _clr_fwstate_(struct mlme_priv *pmlmepriv, sint state)* No Limit on the calling context, * therefore set it to be the critical section... */ -__inlinestatic void clr_fwstate (struct mlme_priv *pmlmepriv,sint state) +static inline void clr_fwstate (struct mlme_priv *pmlmepriv,sint state) {spin_lock_bh (&pmlmepriv->lock);if (check_fwstate (pmlmepriv, state) == true)
@@ -589,7 +589,7 @@ __inline static void clr_fwstate(struct mlme_priv *pmlmepriv, sint state)spin_unlock_bh (&pmlmepriv->lock); } -__inlinestatic void set_scanned_network_val (struct mlme_priv *pmlmepriv,sint val) +static inline void set_scanned_network_val (struct mlme_priv *pmlmepriv,sint val) {spin_lock_bh (&pmlmepriv->lock); pmlmepriv->num_of_scanned = val;
drivers/staging/rtl8723bs/include/rtw_recv.h +8 -8
@@ -413,7 +413,7 @@ struct recv_buf *rtw_dequeue_recvbuf (struct __queue *queue);void rtw_reordering_ctrl_timeout_handler (struct timer_list *t); -__inlinestatic u8 *get_rxmem (union recv_frame *precvframe) +static inline u8 *get_rxmem (union recv_frame *precvframe) {/* always return rx_head... */ if (precvframe ==NULL )
@@ -422,7 +422,7 @@ __inline static u8 *get_rxmem(union recv_frame *precvframe)return precvframe->u.hdr.rx_head; } -__inlinestatic u8 *get_recvframe_data (union recv_frame *precvframe) +static inline u8 *get_recvframe_data (union recv_frame *precvframe) {/* alwasy return rx_data */
@@ -433,7 +433,7 @@ __inline static u8 *get_recvframe_data(union recv_frame *precvframe) } -__inlinestatic u8 *recvframe_pull (union recv_frame *precvframe,sint sz) +static inline u8 *recvframe_pull (union recv_frame *precvframe,sint sz) {/* rx_data += sz; move rx_data sz bytes hereafter */
@@ -458,7 +458,7 @@ __inline static u8 *recvframe_pull(union recv_frame *precvframe, sint sz) } -__inlinestatic u8 *recvframe_put (union recv_frame *precvframe,sint sz) +static inline u8 *recvframe_put (union recv_frame *precvframe,sint sz) {/* rx_tai += sz; move rx_tail sz bytes hereafter */
@@ -487,7 +487,7 @@ __inline static u8 *recvframe_put(union recv_frame *precvframe, sint sz) -__inlinestatic u8 *recvframe_pull_tail (union recv_frame *precvframe,sint sz) +static inline u8 *recvframe_pull_tail (union recv_frame *precvframe,sint sz) {/* rmv data from rx_tail (by yitsen) */
@@ -511,7 +511,7 @@ __inline static u8 *recvframe_pull_tail(union recv_frame *precvframe, sint sz) } -__inlinestatic union recv_frame *rxmem_to_recvframe (u8 *rxmem) +static inline union recv_frame *rxmem_to_recvframe (u8 *rxmem) {/* due to the design of 2048 bytes alignment of recv_frame, we can reference the union recv_frame */ /* from any given member of recv_frame. */
@@ -521,13 +521,13 @@ __inline static union recv_frame *rxmem_to_recvframe(u8 *rxmem) } -__inlinestatic sint get_recvframe_len (union recv_frame *precvframe) +static inline sint get_recvframe_len (union recv_frame *precvframe) {return precvframe->u.hdr.len; } -__inlinestatic s32 translate_percentage_to_dbm (u32 SignalStrengthIndex) +static inline s32 translate_percentage_to_dbm (u32 SignalStrengthIndex) {s32 SignalPower;/* in dBm. */
drivers/staging/rtl8723bs/include/sta_info.h +1 -1
@@ -356,7 +356,7 @@ struct sta_priv { }; -__inlinestatic u32 wifi_mac_hash (u8 *mac) +static inline u32 wifi_mac_hash (u8 *mac) {u32 x;
drivers/staging/rtl8723bs/include/wifi.h +7 -7
@@ -355,7 +355,7 @@ enum WIFI_REG_DOMAIN { (addr[4] == 0xff) && (addr[5] == 0xff)) ? true : false \ ) -__inlinestatic int IS_MCAST (unsigned char *da) +static inline int IS_MCAST (unsigned char *da) {if ((*da) &0x01 )return true;
@@ -363,20 +363,20 @@ __inline static int IS_MCAST(unsigned char *da)return false; } -__inlinestatic unsigned char *get_ra (unsigned char *pframe) +static inline unsigned char *get_ra (unsigned char *pframe) {unsigned char *ra; ra =GetAddr1Ptr (pframe);return ra; } -__inlinestatic unsigned char *get_ta (unsigned char *pframe) +static inline unsigned char *get_ta (unsigned char *pframe) {unsigned char *ta; ta =GetAddr2Ptr (pframe);return ta; } -__inlinestatic unsigned char *get_da (unsigned char *pframe) +static inline unsigned char *get_da (unsigned char *pframe) {unsigned char *da;unsigned int to_fr_ds = (GetToDs (pframe) <<1 ) |GetFrDs (pframe);
@@ -400,7 +400,7 @@ __inline static unsigned char * get_da(unsigned char *pframe) } -__inlinestatic unsigned char *get_sa (unsigned char *pframe) +static inline unsigned char *get_sa (unsigned char *pframe) {unsigned char *sa;unsigned int to_fr_ds = (GetToDs (pframe) <<1 ) |GetFrDs (pframe);
@@ -423,7 +423,7 @@ __inline static unsigned char * get_sa(unsigned char *pframe)return sa; } -__inlinestatic unsigned char *get_hdr_bssid (unsigned char *pframe) +static inline unsigned char *get_hdr_bssid (unsigned char *pframe) {unsigned char *sa =NULL ;unsigned int to_fr_ds = (GetToDs (pframe) <<1 ) |GetFrDs (pframe);
@@ -447,7 +447,7 @@ __inline static unsigned char * get_hdr_bssid(unsigned char *pframe) } -__inlinestatic int IsFrameTypeCtrl (unsigned char *pframe) +static inline int IsFrameTypeCtrl (unsigned char *pframe) {if (WIFI_CTRL_TYPE ==GetFrameType (pframe))return true;
drivers/staging/rtl8723bs/include/wlan_bssdef.h +1 -1
@@ -231,7 +231,7 @@ struct wlan_bssid_ex {u8 IEs[MAX_IE_SZ ];/* timestamp, beacon interval, and capability information) */ } __packed; -__inlinestatic uint get_wlan_bssid_ex_sz (struct wlan_bssid_ex *bss) +static inline uint get_wlan_bssid_ex_sz (struct wlan_bssid_ex *bss) {return (sizeof (struct wlan_bssid_ex ) -MAX_IE_SZ + bss->IELength); }
lib/zstd/mem.h +1 -1
@@ -27,7 +27,7 @@/*-**************************************** * Compiler specifics ******************************************/ -#define ZSTD_STATIC static __inline __attribute__((unused)) +#define ZSTD_STATIC static inline __attribute__((unused))/*-************************************************************** * Basic Types
Re: [PATCH v2 1/2] compiler-gcc.h: add gnu_inline to all inline declarations
In reply to Joe PerchesQuoted 37 lines · Joe Perches
Quoted 9 lines · Nick Desaulniers
Functions marked extern inline do not emit an externally visible function when the gnu89 C standard is used. Some KBUILD Makefiles overwrite
KBUILD_CFLAGS. This is an issue for GCC 5.1+ users as without an explicit C standard specified, the default is gnu11. Since c99, the semantics of extern inline have changed such that an externally visible function is always emitted. This can lead to multiple definition errors of extern inline functions at link time of compilation units whose build files have removed an explicit C standard compiler flag for users of GCC 5.1+ or Clang.[]
include/linux/compiler-gcc.h
Quoted 1 line
include/linux/compiler-gcc.h +0
-0[]
Quoted 10 lines
include/linux/compiler-gcc.h +4
-0@@ -72,17 +72,24 @@* -Wunused-function. This turns out to avoid the need for complex #ifdef * directives. Suppress the warning in clang as well by using "unused" * function attribute, which is redundant but not harmful for gcc. +* Prefer gnu_inline, so that extern inline functions do not emit an +* externally visible function. This makes extern inline behave as per gnu89 +* semantics rather than c99. This prevents multiple symbol definition errors +* of extern inline functions at link time. */ #if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \include/linux/compiler-gcc.h line 87
Quoted 10 lines
include/linux/compiler-gcc.h +6
-3!defined(CONFIG_OPTIMIZE_INLINING) || (__GNUC__ < 4) -#define inline inline __attribute__((always_inline,unused)) notrace -#define __inline__ __inline__ __attribute__((always_inline,unused)) notrace -#define __inline __inline __attribute__((always_inline,unused)) notrace +#define inline \ + inline __attribute__((always_inline, unused, gnu_inline)) notrace +#define __inline__ \ + __inline__ __attribute__((always_inline, unused, gnu_inline)) notrace +#define __inline \ + __inline __attribute__((always_inline, unused, gnu_inline)) notracePerhaps these are simpler as
Quoted 2 lines
#define
__inline__inline
#define__inlineinline
Working on this now, going to push v3 soon. I was wondering more about these definitions of inline.
Probably want:
#define __inline__ __inline__ inline
#define __inline __inline inline
These are the only references I found to:
__inline__: https://gcc.gnu.org/onlinedocs/gcc/Inline.html__inline: http://www.keil.com/support/man/docs/armcc/armcc_chr1359124967692.htm
The commit that introduced them was:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a1365647022eb05a5993f270a78e9bef3bf554eb
which was an interesting read.
I get the feeling that the use of __inline__ or __inline (vs inline) in the kernel may be wrong and their use should be eradicated in the follow up patch set, but it would be cool if others have additional insight.
This code in Clang seems to treat them all as the same:
https://github.com/llvm-mirror/clang/blob/1a597eeed3579b4320b62ff55150195482545992/lib/Lex/PPDirectives.cpp#L2285
Signature · 2 lines
Thanks, ~Nick Desaulniers
Re: [PATCH v2 1/2] compiler-gcc.h: add gnu_inline to all inline declarations
Quoted 39 lines · Nick Desaulniers
Quoted 37 lines · Joe Perches
Quoted 9 lines · Nick Desaulniers
Functions marked extern inline do not emit an externally visible function when the gnu89 C standard is used. Some KBUILD Makefiles overwrite
KBUILD_CFLAGS. This is an issue for GCC 5.1+ users as without an explicit C standard specified, the default is gnu11. Since c99, the semantics of extern inline have changed such that an externally visible function is always emitted. This can lead to multiple definition errors of extern inline functions at link time of compilation units whose build files have removed an explicit C standard compiler flag for users of GCC 5.1+ or Clang.[]
include/linux/compiler-gcc.h
Quoted 1 line
include/linux/compiler-gcc.h +0
-0[]
Quoted 10 lines
include/linux/compiler-gcc.h +4
-0@@ -72,17 +72,24 @@* -Wunused-function. This turns out to avoid the need for complex #ifdef * directives. Suppress the warning in clang as well by using "unused" * function attribute, which is redundant but not harmful for gcc. +* Prefer gnu_inline, so that extern inline functions do not emit an +* externally visible function. This makes extern inline behave as per gnu89 +* semantics rather than c99. This prevents multiple symbol definition errors +* of extern inline functions at link time. */ #if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \include/linux/compiler-gcc.h line 87
Quoted 10 lines
include/linux/compiler-gcc.h +6
-3!defined(CONFIG_OPTIMIZE_INLINING) || (__GNUC__ < 4) -#define inline inline __attribute__((always_inline,unused)) notrace -#define __inline__ __inline__ __attribute__((always_inline,unused)) notrace -#define __inline __inline __attribute__((always_inline,unused)) notrace +#define inline \ + inline __attribute__((always_inline, unused, gnu_inline)) notrace +#define __inline__ \ + __inline__ __attribute__((always_inline, unused, gnu_inline)) notrace +#define __inline \ + __inline __attribute__((always_inline, unused, gnu_inline)) notracePerhaps these are simpler as
Quoted 7 lines
Quoted 2 lines
#define
__inline__inline
#define__inlineinlineProbably want:
#define
__inline____inline__inline
#define__inline__inlineinline
Oh, never mind, if my changes to inline add the inline keyword, then we can remove the redefinition __inline__ and __inline. All that to say your original suggestion is better than my follow up.
Signature · 2 lines
Thanks, ~Nick Desaulniers
Re: [PATCH v2 1/2] compiler-gcc.h: add gnu_inline to all inline declarations
In reply to Nick DesaulniersQuoted 4 lines · Nick Desaulniers
I get the feeling that the use of
__inline__or__inline(vs inline) in the kernel may be wrong and their use should be eradicated in the follow up patch set, but it would be cool if others have additional insight.
__inline is easy and useful to remove as it's used in just a few files.
But __inline__ is used in a lot of files and locations:
$ git grep -w --name-only __inline__ | wc -l 154 $ git grep -w __inline__ | wc -l 503
Some of these files are used in asm includes as well where __inline__ may be preferred by gcc
https://gcc.gnu.org/onlinedocs/gcc/Alternate-Keywords.html#Alternate-Keywords
so perhaps asm exclusions would be necessary.
A similar script to sed them is certainly possible but perhaps could cause some conflicts later in a merge cycle. Realistically, this sort of script can only be applied by Linus. Separating out the individual patches by maintainer effectively means the series will never be wholly applied.
Maybe excluding all /asm/ directories:
$ git grep -w --name-only __inline__ | \ grep -vP '(?:/uapi/|/asm/|^scripts/|compiler)' | \ xargs sed -r -i -e 's/\b__inline__\b/inline/g'
This script today results are (-U0 to minimize output):
---
$ git diff -U0 --stat -p Documentation/translations/ja_JP/SubmittingPatches | 4 +-- Documentation/translations/zh_CN/SubmittingPatches | 4 +-- arch/arm/mach-iop32x/include/mach/uncompress.h | 2 +- arch/arm/mach-iop33x/include/mach/uncompress.h | 2 +- arch/arm/mach-ixp4xx/include/mach/uncompress.h | 2 +- arch/ia64/hp/common/sba_iommu.c | 2 +- arch/ia64/hp/sim/simeth.c | 2 +- arch/ia64/oprofile/backtrace.c | 4 +-- arch/m68k/mac/iop.c | 14 +++++----- arch/mips/kernel/binfmt_elfn32.c | 2 +- arch/sh/include/cpu-sh3/cpu/dac.h | 6 ++--- block/partitions/amiga.c | 2 +- drivers/atm/he.c | 6 ++--- drivers/atm/idt77252.c | 6 ++--- drivers/gpu/drm/mga/mga_drv.h | 2 +- drivers/gpu/drm/mga/mga_state.c | 14 +++++----- drivers/gpu/drm/r128/r128_drv.h | 2 +- drivers/gpu/drm/r128/r128_state.c | 14 +++++----- drivers/gpu/drm/via/via_irq.c | 2 +- drivers/gpu/drm/via/via_verifier.c | 30 +++++++++++----------- drivers/isdn/hardware/eicon/platform.h | 14 +++++----- drivers/isdn/i4l/isdn_net.c | 14 +++++----- drivers/isdn/i4l/isdn_net.h | 8 +++--- drivers/media/pci/ivtv/ivtv-ioctl.c | 2 +- drivers/net/ethernet/sun/sungem.c | 8 +++--- drivers/net/ethernet/sun/sunhme.c | 6 ++--- drivers/net/hamradio/baycom_ser_fdx.c | 2 +- drivers/net/wan/lapbether.c | 2 +- drivers/net/wan/n2.c | 4 +-- drivers/parisc/led.c | 4 +-- drivers/parisc/sba_iommu.c | 2 +- drivers/parport/parport_gsc.c | 2 +- drivers/parport/parport_gsc.h | 4 +-- drivers/parport/parport_pc.c | 2 +- drivers/scsi/lpfc/lpfc_scsi.c | 2 +- drivers/scsi/pcmcia/sym53c500_cs.c | 4 +-- drivers/scsi/qla2xxx/qla_inline.h | 2 +- drivers/scsi/qla2xxx/qla_os.c | 4 +-- drivers/staging/ipx/ipx_proc.c | 2 +- drivers/tty/amiserial.c | 2 +- drivers/tty/serial/ip22zilog.c | 2 +- drivers/tty/serial/sunsab.c | 4 +-- drivers/tty/serial/sunzilog.c | 2 +- drivers/video/fbdev/core/fbcon.c | 20 +++++++-------- drivers/video/fbdev/ffb.c | 2 +- drivers/video/fbdev/intelfb/intelfbdrv.c | 10 ++++---- drivers/video/fbdev/intelfb/intelfbhw.c | 2 +- drivers/w1/masters/matrox_w1.c | 4 +-- fs/coda/coda_linux.h | 6 ++--- fs/freevxfs/vxfs_inode.c | 2 +- fs/nfsd/nfsfh.h | 4 +-- include/acpi/platform/acgcc.h | 2 +- include/asm-generic/ide_iops.h | 8 +++--- include/drm/drmP.h | 4 +-- include/drm/drm_legacy.h | 2 +- include/linux/atalk.h | 4 +-- include/linux/ceph/messenger.h | 2 +- include/linux/hdlc.h | 4 +-- include/linux/inetdevice.h | 8 +++--- include/linux/parport.h | 4 +-- include/linux/parport_pc.h | 22 ++++++++-------- include/net/ax25.h | 2 +- include/net/checksum.h | 2 +- include/net/dn_nsp.h | 16 ++++++------ include/net/ip.h | 2 +- include/net/ip6_checksum.h | 2 +- include/net/ipx.h | 10 ++++---- include/net/llc_c_ev.h | 4 +-- include/net/llc_conn.h | 4 +-- include/net/llc_s_ev.h | 2 +- include/net/netrom.h | 8 +++--- include/net/scm.h | 14 +++++----- include/net/udplite.h | 2 +- include/net/x25.h | 8 +++--- include/net/xfrm.h | 18 ++++++------- include/video/newport.h | 12 ++++----- net/appletalk/atalk_proc.c | 4 +-- net/appletalk/ddp.c | 2 +- net/core/neighbour.c | 2 +- net/core/scm.c | 2 +- net/decnet/dn_nsp_in.c | 2 +- net/decnet/dn_nsp_out.c | 2 +- net/decnet/dn_route.c | 2 +- net/decnet/dn_table.c | 4 +-- net/ipv4/igmp.c | 2 +- net/ipv6/af_inet6.c | 2 +- net/ipv6/icmp.c | 4 +-- net/ipv6/udp.c | 4 +-- net/lapb/lapb_iface.c | 4 +-- net/llc/llc_input.c | 2 +- sound/sparc/amd7930.c | 6 ++--- 91 files changed, 240 insertions(+), 240 deletions(-)
Documentation/translations/ja_JP/SubmittingPatches +2 -2
@@ -679,2 +679,2 @@ gcc においては、マクロと同じくらい軽いです。 -「 static inline 」は「 static __inline__ 」や「 extern inline 」や -「 extern __inline__ 」よりも適切です。 +「 static inline 」は「 static inline 」や「 extern inline 」や +「 extern inline 」よりも適切です。
Documentation/translations/zh_CN/SubmittingPatches +2 -2
@@ -380,2 +380,2 @@ Static inline 函数相比宏来说,是好得多的选择。Static inline 函 -应该用 'static inline' 而不是 'static __inline__', 'extern inline' 和 -'extern __inline__' 。 +应该用 'static inline' 而不是 'static inline', 'extern inline' 和 +'extern inline' 。
arch/arm/mach-iop32x/include/mach/uncompress.h +1 -1
@@ -26 +26 @@ static inline void flush(void) -static __inline__void __arch_decomp_setup (unsigned long arch_id) +static inline void __arch_decomp_setup (unsigned long arch_id)
arch/arm/mach-iop33x/include/mach/uncompress.h +1 -1
@@ -26 +26 @@ static inline void flush(void) -static __inline__void __arch_decomp_setup (unsigned long arch_id) +static inline void __arch_decomp_setup (unsigned long arch_id)
arch/arm/mach-ixp4xx/include/mach/uncompress.h +1 -1
@@ -38 +38 @@ static void flush(void) -static __inline__void __arch_decomp_setup (unsigned long arch_id) +static inline void __arch_decomp_setup (unsigned long arch_id)
arch/ia64/hp/common/sba_iommu.c +1 -1
@@ -110 +110 @@ extern int swiotlb_late_init_with_default_size (size_t size); -#define SBA_INLINE __inline__ +#define SBA_INLINE inline
arch/ia64/hp/sim/simeth.c +1 -1
@@ -249 +249 @@ simeth_open(struct net_device *dev) -static __inline__int dev_is_ethdev (struct net_device *dev) +static inline int dev_is_ethdev (struct net_device *dev)
arch/ia64/oprofile/backtrace.c +2 -2
@@ -35 +35 @@ typedef struct -static __inline__int in_ivt_code (unsigned long pc) +static inline int in_ivt_code (unsigned long pc)
@@ -44 +44 @@ static __inline__ int in_ivt_code(unsigned long pc) -static __inline__int next_frame (ia64_backtrace_t *bt) +static inline int next_frame (ia64_backtrace_t *bt)
arch/m68k/mac/iop.c +7 -7
@@ -164 +164 @@ irqreturn_t iop_ism_irq(int, void *); -static __inline__void iop_loadaddr (volatile struct mac_iop *iop,__u16 addr) +static inline void iop_loadaddr (volatile struct mac_iop *iop,__u16 addr)
@@ -170 +170 @@ static __inline__ void iop_loadaddr(volatile struct mac_iop *iop, __u16 addr) -static __inline____u8 iop_readb (volatile struct mac_iop *iop,__u16 addr) +static inline __u8 iop_readb (volatile struct mac_iop *iop,__u16 addr)
@@ -177 +177 @@ static __inline__ __u8 iop_readb(volatile struct mac_iop *iop, __u16 addr) -static __inline__void iop_writeb (volatile struct mac_iop *iop,__u16 addr,__u8 data) +static inline void iop_writeb (volatile struct mac_iop *iop,__u16 addr,__u8 data)
@@ -184 +184 @@ static __inline__ void iop_writeb(volatile struct mac_iop *iop, __u16 addr, __u8 -static __inline__void iop_stop (volatile struct mac_iop *iop) +static inline void iop_stop (volatile struct mac_iop *iop)
@@ -189 +189 @@ static __inline__ void iop_stop(volatile struct mac_iop *iop) -static __inline__void iop_start (volatile struct mac_iop *iop) +static inline void iop_start (volatile struct mac_iop *iop)
@@ -194 +194 @@ static __inline__ void iop_start(volatile struct mac_iop *iop) -static __inline__void iop_bypass (volatile struct mac_iop *iop) +static inline void iop_bypass (volatile struct mac_iop *iop)
@@ -199 +199 @@ static __inline__ void iop_bypass(volatile struct mac_iop *iop) -static __inline__void iop_interrupt (volatile struct mac_iop *iop) +static inline void iop_interrupt (volatile struct mac_iop *iop)
arch/mips/kernel/binfmt_elfn32.c +1 -1
@@ -85 +85 @@ struct elf_prpsinfo32 -static __inline__ void +static inline void
arch/sh/include/cpu-sh3/cpu/dac.h +3 -3
@@ -18 +18 @@ -static __inline__void sh_dac_enable (int channel) +static inline void sh_dac_enable (int channel)
@@ -27 +27 @@ static __inline__ void sh_dac_enable(int channel) -static __inline__void sh_dac_disable (int channel) +static inline void sh_dac_disable (int channel)
@@ -36 +36 @@ static __inline__ void sh_dac_disable(int channel) -static __inline__void sh_dac_output (u8 value,int channel) +static inline void sh_dac_output (u8 value,int channel)
block/partitions/amiga.c +1 -1
@@ -19 +19 @@ -static __inline__ u32 +static inline u32
drivers/atm/he.c +3 -3
@@ -181 +181 @@ static const struct atmdev_ops he_ops = -static __inline__ void +static inline void
@@ -327 +327 @@ he_readl_internal(struct he_dev *he_dev, unsigned addr, unsigned flags) -static __inline__ struct atm_vcc* +static inline struct atm_vcc*
@@ -2053 +2053 @@ he_irq_handler(int irq, void *dev_id) -static __inline__ void +static inline void
drivers/atm/idt77252.c +3 -3
@@ -1786 +1786 @@ set_tct(struct idt77252_dev *card, struct vc_map *vc) -static __inline__ int +static inline int
@@ -1792 +1792 @@ idt77252_fbq_level(struct idt77252_dev *card, int queue) -static __inline__ int +static inline int
@@ -2019 +2019 @@ idt77252_send_oam(struct atm_vcc *vcc, void *cell, int flags) -static __inline__ unsigned int +static inline unsigned int
drivers/gpu/drm/mga/mga_drv.h +1 -1
@@ -664 +664 @@ do { \ -static __inline__int mga_is_idle (drm_mga_private_t *dev_priv) +static inline int mga_is_idle (drm_mga_private_t *dev_priv)
drivers/gpu/drm/mga/mga_state.c +7 -7
@@ -68 +68 @@ static void mga_emit_clip_rect(drm_mga_private_t *dev_priv, -static __inline__void mga_g200_emit_context (drm_mga_private_t *dev_priv) +static inline void mga_g200_emit_context (drm_mga_private_t *dev_priv)
@@ -91 +91 @@ static __inline__ void mga_g200_emit_context(drm_mga_private_t *dev_priv) -static __inline__void mga_g400_emit_context (drm_mga_private_t *dev_priv) +static inline void mga_g400_emit_context (drm_mga_private_t *dev_priv)
@@ -118 +118 @@ static __inline__ void mga_g400_emit_context(drm_mga_private_t *dev_priv) -static __inline__void mga_g200_emit_tex0 (drm_mga_private_t *dev_priv) +static inline void mga_g200_emit_tex0 (drm_mga_private_t *dev_priv)
@@ -146 +146 @@ static __inline__ void mga_g200_emit_tex0(drm_mga_private_t *dev_priv) -static __inline__void mga_g400_emit_tex0 (drm_mga_private_t *dev_priv) +static inline void mga_g400_emit_tex0 (drm_mga_private_t *dev_priv)
@@ -186 +186 @@ static __inline__ void mga_g400_emit_tex0(drm_mga_private_t *dev_priv) -static __inline__void mga_g400_emit_tex1 (drm_mga_private_t *dev_priv) +static inline void mga_g400_emit_tex1 (drm_mga_private_t *dev_priv)
@@ -225 +225 @@ static __inline__ void mga_g400_emit_tex1(drm_mga_private_t *dev_priv) -static __inline__void mga_g200_emit_pipe (drm_mga_private_t *dev_priv) +static inline void mga_g200_emit_pipe (drm_mga_private_t *dev_priv)
@@ -252 +252 @@ static __inline__ void mga_g200_emit_pipe(drm_mga_private_t *dev_priv) -static __inline__void mga_g400_emit_pipe (drm_mga_private_t *dev_priv) +static inline void mga_g400_emit_pipe (drm_mga_private_t *dev_priv)
drivers/gpu/drm/r128/r128_drv.h +1 -1
@@ -420 +420 @@ do { \ -static __inline__void r128_update_ring_snapshot (drm_r128_private_t *dev_priv) +static inline void r128_update_ring_snapshot (drm_r128_private_t *dev_priv)
drivers/gpu/drm/r128/r128_state.c +7 -7
@@ -82 +82 @@ static void r128_emit_clip_rects(drm_r128_private_t *dev_priv, -static __inline__void r128_emit_core (drm_r128_private_t *dev_priv) +static inline void r128_emit_core (drm_r128_private_t *dev_priv)
@@ -97 +97 @@ static __inline__ void r128_emit_core(drm_r128_private_t *dev_priv) -static __inline__void r128_emit_context (drm_r128_private_t *dev_priv) +static inline void r128_emit_context (drm_r128_private_t *dev_priv)
@@ -123 +123 @@ static __inline__ void r128_emit_context(drm_r128_private_t *dev_priv) -static __inline__void r128_emit_setup (drm_r128_private_t *dev_priv) +static inline void r128_emit_setup (drm_r128_private_t *dev_priv)
@@ -139 +139 @@ static __inline__ void r128_emit_setup(drm_r128_private_t *dev_priv) -static __inline__void r128_emit_masks (drm_r128_private_t *dev_priv) +static inline void r128_emit_masks (drm_r128_private_t *dev_priv)
@@ -158 +158 @@ static __inline__ void r128_emit_masks(drm_r128_private_t *dev_priv) -static __inline__void r128_emit_window (drm_r128_private_t *dev_priv) +static inline void r128_emit_window (drm_r128_private_t *dev_priv)
@@ -173 +173 @@ static __inline__ void r128_emit_window(drm_r128_private_t *dev_priv) -static __inline__void r128_emit_tex0 (drm_r128_private_t *dev_priv) +static inline void r128_emit_tex0 (drm_r128_private_t *dev_priv)
@@ -199 +199 @@ static __inline__ void r128_emit_tex0(drm_r128_private_t *dev_priv) -static __inline__void r128_emit_tex1 (drm_r128_private_t *dev_priv) +static inline void r128_emit_tex1 (drm_r128_private_t *dev_priv)
drivers/gpu/drm/via/via_irq.c +1 -1
@@ -155 +155 @@ irqreturn_t via_driver_irq_handler(int irq, void *arg) -static __inline__void viadrv_acknowledge_irqs (drm_via_private_t *dev_priv) +static inline void viadrv_acknowledge_irqs (drm_via_private_t *dev_priv)
drivers/gpu/drm/via/via_verifier.c +15 -15
@@ -238 +238 @@ static hazard_t table3[256]; -static __inline__ int +static inline int
@@ -253 +253 @@ eat_words(const uint32_t **buf, const uint32_t *buf_end, unsigned num_words) -static __inline__ drm_local_map_t *via_drm_lookup_agp_map(drm_via_state_t *seq, +static inline drm_local_map_t *via_drm_lookup_agp_map(drm_via_state_t *seq,
@@ -290 +290 @@ static __inline__ drm_local_map_t *via_drm_lookup_agp_map(drm_via_state_t *seq, -static __inline__int finish_current_sequence (drm_via_state_t * cur_seq) +static inline int finish_current_sequence (drm_via_state_t * cur_seq)
@@ -347 +347 @@ static __inline__ int finish_current_sequence(drm_via_state_t * cur_seq) -static __inline__ int +static inline int
@@ -520 +520 @@ investigate_hazard(uint32_t cmd, hazard_t hz, drm_via_state_t *cur_seq) -static __inline__ int +static inline int
@@ -624 +624 @@ via_check_prim_list(uint32_t const **buffer, const uint32_t * buf_end, -static __inline__ verifier_state_t +static inline verifier_state_t
@@ -716 +716 @@ via_check_header2(uint32_t const **buffer, const uint32_t *buf_end, -static __inline__ verifier_state_t +static inline verifier_state_t
@@ -765 +765 @@ via_parse_header2(drm_via_private_t *dev_priv, uint32_t const **buffer, -static __inline__int verify_mmio_address (uint32_t address) +static inline int verify_mmio_address (uint32_t address)
@@ -783 +783 @@ static __inline__ int verify_mmio_address(uint32_t address) -static __inline__ int +static inline int
@@ -803 +803 @@ verify_video_tail(uint32_t const **buffer, const uint32_t * buf_end, -static __inline__ verifier_state_t +static inline verifier_state_t
@@ -835 +835 @@ via_check_header1(uint32_t const **buffer, const uint32_t * buf_end) -static __inline__ verifier_state_t +static inline verifier_state_t
@@ -853 +853 @@ via_parse_header1(drm_via_private_t *dev_priv, uint32_t const **buffer, -static __inline__ verifier_state_t +static inline verifier_state_t
@@ -886 +886 @@ via_check_vheader5(uint32_t const **buffer, const uint32_t *buf_end) -static __inline__ verifier_state_t +static inline verifier_state_t
@@ -904 +904 @@ via_parse_vheader5(drm_via_private_t *dev_priv, uint32_t const **buffer, -static __inline__ verifier_state_t +static inline verifier_state_t
@@ -941 +941 @@ via_check_vheader6(uint32_t const **buffer, const uint32_t * buf_end) -static __inline__ verifier_state_t +static inline verifier_state_t
drivers/isdn/hardware/eicon/platform.h +7 -7
@@ -162 +162 @@ void diva_xdi_didd_remove_adapter(int card); -static __inline__void *diva_os_malloc (unsigned long flags,unsigned long size) +static inline void *diva_os_malloc (unsigned long flags,unsigned long size)
@@ -171 +171 @@ static __inline__ void *diva_os_malloc(unsigned long flags, unsigned long size) -static __inline__void diva_os_free (unsigned long flags,void *ptr) +static inline void diva_os_free (unsigned long flags,void *ptr)
@@ -188 +188 @@ void diva_os_free_message_buffer(diva_os_message_buffer_s *dmb); -static __inline__void diva_os_sleep (dword mSec) +static inline void diva_os_sleep (dword mSec)
@@ -192 +192 @@ static __inline__ void diva_os_sleep(dword mSec) -static __inline__void diva_os_wait (dword mSec) +static inline void diva_os_wait (dword mSec)
@@ -236 +236 @@ typedef spinlock_t diva_os_spin_lock_t; -static __inline__int diva_os_initialize_spin_lock (spinlock_t *lock,void *unused) { \ +static inline int diva_os_initialize_spin_lock (spinlock_t *lock,void *unused) { \
@@ -238 +238 @@ static __inline__ int diva_os_initialize_spin_lock(spinlock_t *lock, void *unuse -static __inline__ void diva_os_enter_spin_lock(diva_os_spin_lock_t *a, \ +static inline void diva_os_enter_spin_lock(diva_os_spin_lock_t *a, \
@@ -241 +241 @@ static __inline__ void diva_os_enter_spin_lock(diva_os_spin_lock_t *a, \ -static __inline__ void diva_os_leave_spin_lock(diva_os_spin_lock_t *a, \ +static inline void diva_os_leave_spin_lock(diva_os_spin_lock_t *a, \
drivers/isdn/i4l/isdn_net.c +7 -7
@@ -73 +73 @@ -static __inline__int isdn_net_device_started (isdn_net_dev *n) +static inline int isdn_net_device_started (isdn_net_dev *n)
@@ -89 +89 @@ static __inline__ int isdn_net_device_started(isdn_net_dev *n) -static __inline__void isdn_net_device_wake_queue (isdn_net_local *lp) +static inline void isdn_net_device_wake_queue (isdn_net_local *lp)
@@ -101 +101 @@ static __inline__ void isdn_net_device_wake_queue(isdn_net_local *lp) -static __inline__void isdn_net_device_stop_queue (isdn_net_local *lp) +static inline void isdn_net_device_stop_queue (isdn_net_local *lp)
@@ -114 +114 @@ static __inline__ void isdn_net_device_stop_queue(isdn_net_local *lp) -static __inline__int isdn_net_device_busy (isdn_net_local *lp) +static inline int isdn_net_device_busy (isdn_net_local *lp)
@@ -141 +141 @@ static __inline__ int isdn_net_device_busy(isdn_net_local *lp) -static __inline__void isdn_net_inc_frame_cnt (isdn_net_local *lp) +static inline void isdn_net_inc_frame_cnt (isdn_net_local *lp)
@@ -148 +148 @@ static __inline__ void isdn_net_inc_frame_cnt(isdn_net_local *lp) -static __inline__void isdn_net_dec_frame_cnt (isdn_net_local *lp) +static inline void isdn_net_dec_frame_cnt (isdn_net_local *lp)
@@ -161 +161 @@ static __inline__ void isdn_net_dec_frame_cnt(isdn_net_local *lp) -static __inline__void isdn_net_zero_frame_cnt (isdn_net_local *lp) +static inline void isdn_net_zero_frame_cnt (isdn_net_local *lp)
drivers/isdn/i4l/isdn_net.h +4 -4
@@ -67 +67 @@ extern void isdn_net_write_super(isdn_net_local *lp, struct sk_buff *skb); -static __inline__int isdn_net_lp_busy (isdn_net_local *lp) +static inline int isdn_net_lp_busy (isdn_net_local *lp)
@@ -79 +79 @@ static __inline__ int isdn_net_lp_busy(isdn_net_local *lp) -static __inline__isdn_net_local *isdn_net_get_locked_lp (isdn_net_dev *nd) +static inline isdn_net_local *isdn_net_get_locked_lp (isdn_net_dev *nd)
@@ -107 +107 @@ static __inline__ isdn_net_local *isdn_net_get_locked_lp(isdn_net_dev *nd) -static __inline__void isdn_net_add_to_bundle (isdn_net_dev *nd,isdn_net_local *nlp) +static inline void isdn_net_add_to_bundle (isdn_net_dev *nd,isdn_net_local *nlp)
@@ -128 +128 @@ static __inline__ void isdn_net_add_to_bundle(isdn_net_dev *nd, isdn_net_local * -static __inline__void isdn_net_rm_from_bundle (isdn_net_local *lp) +static inline void isdn_net_rm_from_bundle (isdn_net_local *lp)
drivers/media/pci/ivtv/ivtv-ioctl.c +1 -1
@@ -1625 +1625 @@ static int ivtv_try_decoder_cmd(struct file *file, void *fh, struct v4l2_decoder -static __inline__void warn_deprecated_ioctl (const char *name) +static inline void warn_deprecated_ioctl (const char *name)
drivers/net/ethernet/sun/sungem.c +4 -4
@@ -644 +644 @@ static int gem_abnormal_irq(struct net_device *dev, struct gem *gp, u32 gem_stat -static __inline__void gem_tx (struct net_device *dev,struct gem *gp,u32 gem_status) +static inline void gem_tx (struct net_device *dev,struct gem *gp,u32 gem_status)
@@ -714 +714 @@ static __inline__ void gem_tx(struct net_device *dev, struct gem *gp, u32 gem_st -static __inline__void gem_post_rxds (struct gem *gp,int limit) +static inline void gem_post_rxds (struct gem *gp,int limit)
@@ -746 +746 @@ static __inline__ void gem_post_rxds(struct gem *gp, int limit) -static __inline__ struct sk_buff *gem_alloc_skb(struct net_device *dev, int size, +static inline struct sk_buff *gem_alloc_skb(struct net_device *dev, int size,
@@ -989 +989 @@ static void gem_tx_timeout(struct net_device *dev) -static __inline__int gem_intme (int entry) +static inline int gem_intme (int entry)
drivers/net/ethernet/sun/sunhme.c +3 -3
@@ -111 +111 @@ static int txlog_cur_entry; -static __inline__void tx_add_log (struct happy_meal *hp,unsigned int a,unsigned int s) +static inline void tx_add_log (struct happy_meal *hp,unsigned int a,unsigned int s)
@@ -126 +126 @@ static __inline__ void tx_add_log(struct happy_meal *hp, unsigned int a, unsigne -static __inline__void tx_dump_log (void ) +static inline void tx_dump_log (void )
@@ -139 +139 @@ static __inline__ void tx_dump_log(void) -static __inline__void tx_dump_ring (struct happy_meal *hp) +static inline void tx_dump_ring (struct happy_meal *hp)
drivers/net/hamradio/baycom_ser_fdx.c +1 -1
@@ -232 +232 @@ static inline unsigned int hweight8(unsigned int w) -static __inline__void ser12_rx (struct net_device *dev,struct baycom_state *bc,struct timespec64 *ts,unsigned char curs) +static inline void ser12_rx (struct net_device *dev,struct baycom_state *bc,struct timespec64 *ts,unsigned char curs)
drivers/net/wan/lapbether.c +1 -1
@@ -79 +79 @@ static struct lapbethdev *lapbeth_get_x25_dev(struct net_device *dev) -static __inline__int dev_is_ethdev (struct net_device *dev) +static inline int dev_is_ethdev (struct net_device *dev)
drivers/net/wan/n2.c +2 -2
@@ -151 +151 @@ static card_t **new_card = &first_card; -static __inline__u8 sca_get_page (card_t *card) +static inline u8 sca_get_page (card_t *card)
@@ -157 +157 @@ static __inline__ u8 sca_get_page(card_t *card) -static __inline__void openwin (card_t *card,u8 page) +static inline void openwin (card_t *card,u8 page)
drivers/parisc/led.c +2 -2
@@ -352 +352 @@ static void led_LCD_driver(unsigned char leds) -static __inline__int led_get_net_activity (void ) +static inline int led_get_net_activity (void )
@@ -404 +404 @@ static __inline__ int led_get_net_activity(void) -static __inline__int led_get_diskio_activity (void ) +static inline int led_get_diskio_activity (void )
drivers/parisc/sba_iommu.c +1 -1
@@ -92 +92 @@ -#define SBA_INLINE __inline__ +#define SBA_INLINE inline
drivers/parport/parport_gsc.c +1 -1
@@ -79 +79 @@ static int clear_epp_timeout(struct parport *pb) -* parport_xxx_yyy macros. extern __inline__ versions of several +* parport_xxx_yyy macros. extern inline versions of several
drivers/parport/parport_gsc.h +2 -2
@@ -44 +44 @@ -static __inline__unsigned char parport_readb (unsigned long port ) +static inline unsigned char parport_readb (unsigned long port )
@@ -50 +50 @@ static __inline__ unsigned char parport_readb( unsigned long port ) -static __inline__void parport_writeb (unsigned char value,unsigned long port ) +static inline void parport_writeb (unsigned char value,unsigned long port )
drivers/parport/parport_pc.c +1 -1
@@ -228 +228 @@ static int clear_epp_timeout(struct parport *pb) -* parport_xxx_yyy macros. extern __inline__ versions of several +* parport_xxx_yyy macros. extern inline versions of several
drivers/scsi/lpfc/lpfc_scsi.c +1 -1
@@ -4476 +4476 @@ lpfc_info(struct Scsi_Host *host) -static __inline__void lpfc_poll_rearm_timer (struct lpfc_hba * phba) +static inline void lpfc_poll_rearm_timer (struct lpfc_hba * phba)
drivers/scsi/pcmcia/sym53c500_cs.c +2 -2
@@ -244 +244 @@ SYM53C500_int_host_reset(int io_port) -static __inline__ int +static inline int
@@ -299 +299 @@ SYM53C500_pio_read(int fast_pio, int base, unsigned char *request, unsigned int -static __inline__ int +static inline int
drivers/scsi/qla2xxx/qla_inline.h +1 -1
@@ -42 +42 @@ qla24xx_calc_iocbs(scsi_qla_host_t *vha, uint16_t dsds) -static __inline__ uint16_t +static inline uint16_t
drivers/scsi/qla2xxx/qla_os.c +2 -2
@@ -346 +346 @@ struct scsi_transport_template *qla2xxx_transport_vport_template = NULL; -__inline__ void +inline void
@@ -368 +368 @@ qla2x00_restart_timer(scsi_qla_host_t *vha, unsigned long interval) -static __inline__ void +static inline void
drivers/staging/ipx/ipx_proc.c +1 -1
@@ -104 +104 @@ static int ipx_seq_route_show(struct seq_file *seq, void *v) -static __inline__struct sock *ipx_get_socket_idx (loff_t pos) +static inline struct sock *ipx_get_socket_idx (loff_t pos)
drivers/tty/amiserial.c +1 -1
@@ -174 +174 @@ static inline int serial_paranoia_check(struct serial_state *info, -static __inline__void rtsdtr_ctrl (int bits) +static inline void rtsdtr_ctrl (int bits)
drivers/tty/serial/ip22zilog.c +1 -1
@@ -493 +493 @@ static irqreturn_t ip22zilog_interrupt(int irq, void *dev_id) -static __inline__unsigned char ip22zilog_read_channel_status (struct uart_port *port) +static inline unsigned char ip22zilog_read_channel_status (struct uart_port *port)
drivers/tty/serial/sunsab.c +2 -2
@@ -95 +95 @@ static char *sab82532_version[16] = { -static __inline__void sunsab_tec_wait (struct uart_sunsab_port *up) +static inline void sunsab_tec_wait (struct uart_sunsab_port *up)
@@ -103 +103 @@ static __inline__ void sunsab_tec_wait(struct uart_sunsab_port *up) -static __inline__void sunsab_cec_wait (struct uart_sunsab_port *up) +static inline void sunsab_cec_wait (struct uart_sunsab_port *up)
drivers/tty/serial/sunzilog.c +1 -1
@@ -593 +593 @@ static irqreturn_t sunzilog_interrupt(int irq, void *dev_id) -static __inline__unsigned char sunzilog_read_channel_status (struct uart_port *port) +static inline unsigned char sunzilog_read_channel_status (struct uart_port *port)
drivers/video/fbdev/core/fbcon.c +10 -10
@@ -178,4 +178,4 @@ static void fbcon_set_palette(struct vc_data *vc, const unsigned char *table); -static __inline__void ywrap_up (struct vc_data *vc,int count); -static __inline__void ywrap_down (struct vc_data *vc,int count); -static __inline__void ypan_up (struct vc_data *vc,int count); -static __inline__void ypan_down (struct vc_data *vc,int count); +static inline void ywrap_up (struct vc_data *vc,int count); +static inline void ywrap_down (struct vc_data *vc,int count); +static inline void ypan_up (struct vc_data *vc,int count); +static inline void ypan_down (struct vc_data *vc,int count);
@@ -1430 +1430 @@ static void fbcon_set_disp(struct fb_info *info, struct fb_var_screeninfo *var, -static __inline__void ywrap_up (struct vc_data *vc,int count) +static inline void ywrap_up (struct vc_data *vc,int count)
@@ -1449 +1449 @@ static __inline__ void ywrap_up(struct vc_data *vc, int count) -static __inline__void ywrap_down (struct vc_data *vc,int count) +static inline void ywrap_down (struct vc_data *vc,int count)
@@ -1468 +1468 @@ static __inline__ void ywrap_down(struct vc_data *vc, int count) -static __inline__void ypan_up (struct vc_data *vc,int count) +static inline void ypan_up (struct vc_data *vc,int count)
@@ -1492 +1492 @@ static __inline__ void ypan_up(struct vc_data *vc, int count) -static __inline__void ypan_up_redraw (struct vc_data *vc,int t,int count) +static inline void ypan_up_redraw (struct vc_data *vc,int t,int count)
@@ -1516 +1516 @@ static __inline__ void ypan_up_redraw(struct vc_data *vc, int t, int count) -static __inline__void ypan_down (struct vc_data *vc,int count) +static inline void ypan_down (struct vc_data *vc,int count)
@@ -1540 +1540 @@ static __inline__ void ypan_down(struct vc_data *vc, int count) -static __inline__void ypan_down_redraw (struct vc_data *vc,int t,int count) +static inline void ypan_down_redraw (struct vc_data *vc,int t,int count)
drivers/video/fbdev/ffb.c +1 -1
@@ -414 +414 @@ static int ffb_sync(struct fb_info *p) -static __inline__void ffb_rop (struct ffb_par *par,u32 rop) +static inline void ffb_rop (struct ffb_par *par,u32 rop)
drivers/video/fbdev/intelfb/intelfbdrv.c +5 -5
@@ -273 +273 @@ MODULE_PARM_DESC(mode, -static __inline__char *get_opt_string (const char *this_opt,const char *name) +static inline char *get_opt_string (const char *this_opt,const char *name)
@@ -291 +291 @@ static __inline__ char * get_opt_string(const char *this_opt, const char *name) -static __inline__ int get_opt_int(const char *this_opt, const char *name, +static inline int get_opt_int(const char *this_opt, const char *name,
@@ -304 +304 @@ static __inline__ int get_opt_int(const char *this_opt, const char *name, -static __inline__ int get_opt_bool(const char *this_opt, const char *name, +static inline int get_opt_bool(const char *this_opt, const char *name,
@@ -910 +910 @@ static void intelfb_pci_unregister(struct pci_dev *pdev) -__inline__int intelfb_var_to_depth (const struct fb_var_screeninfo *var) +inline int intelfb_var_to_depth (const struct fb_var_screeninfo *var)
@@ -926 +926 @@ __inline__ int intelfb_var_to_depth(const struct fb_var_screeninfo *var) -static __inline__int var_to_refresh (const struct fb_var_screeninfo *var) +static inline int var_to_refresh (const struct fb_var_screeninfo *var)
drivers/video/fbdev/intelfb/intelfbhw.c +1 -1
@@ -1028 +1028 @@ static int calc_pll_params(int index, int clock, u32 *retm1, u32 *retm2, -static __inline__ int check_overflow(u32 value, u32 limit, +static inline int check_overflow(u32 value, u32 limit,
drivers/w1/masters/matrox_w1.c +2 -2
@@ -81 +81 @@ struct matrox_device -static __inline__u8 matrox_w1_read_reg (struct matrox_device *dev,u8 reg) +static inline u8 matrox_w1_read_reg (struct matrox_device *dev,u8 reg)
@@ -92 +92 @@ static __inline__ u8 matrox_w1_read_reg(struct matrox_device *dev, u8 reg) -static __inline__void matrox_w1_write_reg (struct matrox_device *dev,u8 reg,u8 val) +static inline void matrox_w1_write_reg (struct matrox_device *dev,u8 reg,u8 val)
fs/coda/coda_linux.h +3 -3
@@ -85 +85 @@ static inline struct coda_inode_info *ITOC(struct inode *inode) -static __inline__struct CodaFid *coda_i2f (struct inode *inode) +static inline struct CodaFid *coda_i2f (struct inode *inode)
@@ -90 +90 @@ static __inline__ struct CodaFid *coda_i2f(struct inode *inode) -static __inline__char *coda_i2s (struct inode *inode) +static inline char *coda_i2s (struct inode *inode)
@@ -96 +96 @@ static __inline__ char *coda_i2s(struct inode *inode) -static __inline__void coda_flag_inode (struct inode *inode,int flag) +static inline void coda_flag_inode (struct inode *inode,int flag)
fs/freevxfs/vxfs_inode.c +1 -1
@@ -77 +77 @@ vxfs_dumpi(struct vxfs_inode_info *vip, ino_t ino) -static __inline__ umode_t +static inline umode_t
fs/nfsd/nfsfh.h +2 -2
@@ -169 +169 @@ void fh_put(struct svc_fh *); -static __inline__ struct svc_fh * +static inline struct svc_fh *
@@ -185 +185 @@ fh_copy_shallow(struct knfsd_fh *dst, struct knfsd_fh *src) -static __inline__ struct svc_fh * +static inline struct svc_fh *
include/acpi/platform/acgcc.h +1 -1
@@ -29 +29 @@ typedef __builtin_va_list va_list; -#define ACPI_INLINE __inline__ +#define ACPI_INLINE inline
include/asm-generic/ide_iops.h +4 -4
@@ -9 +9 @@ -static __inline__void __ide_mm_insw (void __iomem *port,void *addr,u32 count) +static inline void __ide_mm_insw (void __iomem *port,void *addr,u32 count)
@@ -17 +17 @@ static __inline__ void __ide_mm_insw(void __iomem *port, void *addr, u32 count) -static __inline__void __ide_mm_insl (void __iomem *port,void *addr,u32 count) +static inline void __ide_mm_insl (void __iomem *port,void *addr,u32 count)
@@ -25 +25 @@ static __inline__ void __ide_mm_insl(void __iomem *port, void *addr, u32 count) -static __inline__void __ide_mm_outsw (void __iomem *port,void *addr,u32 count) +static inline void __ide_mm_outsw (void __iomem *port,void *addr,u32 count)
@@ -33 +33 @@ static __inline__ void __ide_mm_outsw(void __iomem *port, void *addr, u32 count) -static __inline__void __ide_mm_outsl (void __iomem * port,void *addr,u32 count) +static inline void __ide_mm_outsl (void __iomem * port,void *addr,u32 count)
include/drm/drmP.h +2 -2
@@ -126 +126 @@ static inline bool drm_drv_uses_atomic_modeset(struct drm_device *dev) -static __inline__ int drm_core_check_feature(struct drm_device *dev, +static inline int drm_core_check_feature(struct drm_device *dev,
@@ -146 +146 @@ static __inline__ int drm_core_check_feature(struct drm_device *dev, -static __inline__bool drm_can_sleep (void ) +static inline bool drm_can_sleep (void )
include/drm/drm_legacy.h +1 -1
@@ -197 +197 @@ void drm_legacy_ioremapfree(struct drm_local_map *map, struct drm_device *dev); -static __inline__ struct drm_local_map *drm_legacy_findmap(struct drm_device *dev, +static inline struct drm_local_map *drm_legacy_findmap(struct drm_device *dev,
include/linux/atalk.h +2 -2
@@ -63 +63 @@ struct ddpehdr { -static __inline__struct ddpehdr *ddp_hdr (struct sk_buff *skb) +static inline struct ddpehdr *ddp_hdr (struct sk_buff *skb)
@@ -91 +91 @@ struct elapaarp { -static __inline__struct elapaarp *aarp_hdr (struct sk_buff *skb) +static inline struct elapaarp *aarp_hdr (struct sk_buff *skb)
include/linux/ceph/messenger.h +1 -1
@@ -82 +82 @@ enum ceph_msg_data_type { -static __inline__bool ceph_msg_data_type_valid (enum ceph_msg_data_type type) +static inline bool ceph_msg_data_type_valid (enum ceph_msg_data_type type)
include/linux/hdlc.h +2 -2
@@ -77 +77 @@ static inline struct hdlc_device* dev_to_hdlc(struct net_device *dev) -static __inline__void debug_frame (const struct sk_buff *skb) +static inline void debug_frame (const struct sk_buff *skb)
@@ -104 +104 @@ int detach_hdlc_protocol(struct net_device *dev); -static __inline__ __be16 hdlc_type_trans(struct sk_buff *skb, +static inline __be16 hdlc_type_trans(struct sk_buff *skb,
include/linux/inetdevice.h +4 -4
@@ -185 +185 @@ struct in_ifaddr *inet_lookup_ifaddr_rcu(struct net *net, __be32 addr); -static __inline__bool inet_ifa_match (__be32 addr,struct in_ifaddr *ifa) +static inline bool inet_ifa_match (__be32 addr,struct in_ifaddr *ifa)
@@ -194 +194 @@ static __inline__ bool inet_ifa_match(__be32 addr, struct in_ifaddr *ifa) -static __inline__bool bad_mask (__be32 mask,__be32 addr) +static inline bool bad_mask (__be32 mask,__be32 addr)
@@ -256 +256 @@ static inline void in_dev_put(struct in_device *idev) -static __inline____be32 inet_make_mask (int logmask) +static inline __be32 inet_make_mask (int logmask)
@@ -263 +263 @@ static __inline__ __be32 inet_make_mask(int logmask) -static __inline__int inet_mask_len (__be32 mask) +static inline int inet_mask_len (__be32 mask)
include/linux/parport.h +2 -2
@@ -388 +388 @@ extern void parport_release(struct pardevice *dev); -static __inline__int parport_yield (struct pardevice *dev) +static inline int parport_yield (struct pardevice *dev)
@@ -406 +406 @@ static __inline__ int parport_yield(struct pardevice *dev) -static __inline__int parport_yield_blocking (struct pardevice *dev) +static inline int parport_yield_blocking (struct pardevice *dev)
include/linux/parport_pc.h +11 -11
@@ -63 +63 @@ struct parport_pc_via_data -static __inline__void parport_pc_write_data (struct parport *p,unsigned char d) +static inline void parport_pc_write_data (struct parport *p,unsigned char d)
@@ -71 +71 @@ static __inline__ void parport_pc_write_data(struct parport *p, unsigned char d) -static __inline__unsigned char parport_pc_read_data (struct parport *p) +static inline unsigned char parport_pc_read_data (struct parport *p)
@@ -128 +128 @@ static inline void dump_parport_state (char *str, struct parport *p) -static __inline__ unsigned char __parport_pc_frob_control (struct parport *p, +static inline unsigned char __parport_pc_frob_control (struct parport *p,
@@ -146 +146 @@ static __inline__ unsigned char __parport_pc_frob_control (struct parport *p, -static __inline__void parport_pc_data_reverse (struct parport *p) +static inline void parport_pc_data_reverse (struct parport *p)
@@ -151 +151 @@ static __inline__ void parport_pc_data_reverse (struct parport *p) -static __inline__void parport_pc_data_forward (struct parport *p) +static inline void parport_pc_data_forward (struct parport *p)
@@ -156 +156 @@ static __inline__ void parport_pc_data_forward (struct parport *p) -static __inline__ void parport_pc_write_control (struct parport *p, +static inline void parport_pc_write_control (struct parport *p,
@@ -174 +174 @@ static __inline__ void parport_pc_write_control (struct parport *p, -static __inline__unsigned char parport_pc_read_control (struct parport *p) +static inline unsigned char parport_pc_read_control (struct parport *p)
@@ -184 +184 @@ static __inline__ unsigned char parport_pc_read_control(struct parport *p) -static __inline__ unsigned char parport_pc_frob_control (struct parport *p, +static inline unsigned char parport_pc_frob_control (struct parport *p,
@@ -211 +211 @@ static __inline__ unsigned char parport_pc_frob_control (struct parport *p, -static __inline__unsigned char parport_pc_read_status (struct parport *p) +static inline unsigned char parport_pc_read_status (struct parport *p)
@@ -217 +217 @@ static __inline__ unsigned char parport_pc_read_status(struct parport *p) -static __inline__void parport_pc_disable_irq (struct parport *p) +static inline void parport_pc_disable_irq (struct parport *p)
@@ -222 +222 @@ static __inline__ void parport_pc_disable_irq(struct parport *p) -static __inline__void parport_pc_enable_irq (struct parport *p) +static inline void parport_pc_enable_irq (struct parport *p)
include/net/ax25.h +1 -1
@@ -273 +273 @@ static inline struct ax25_cb *sk_to_ax25(const struct sock *sk) -static __inline__void ax25_cb_put (ax25_cb *ax25) +static inline void ax25_cb_put (ax25_cb *ax25)
include/net/checksum.h +1 -1
@@ -44 +44 @@ __wsum csum_and_copy_from_user (const void __user *src, void *dst, -static __inline____wsum csum_and_copy_to_user +static inline __wsum csum_and_copy_to_user
include/net/dn_nsp.h +8 -8
@@ -147 +147 @@ struct srcobj_fmt { -static __inline__int dn_before (__u16 seq1,__u16 seq2) +static inline int dn_before (__u16 seq1,__u16 seq2)
@@ -156 +156 @@ static __inline__ int dn_before(__u16 seq1, __u16 seq2) -static __inline__int dn_after (__u16 seq1,__u16 seq2) +static inline int dn_after (__u16 seq1,__u16 seq2)
@@ -164 +164 @@ static __inline__ int dn_after(__u16 seq1, __u16 seq2) -static __inline__int dn_equal (__u16 seq1,__u16 seq2) +static inline int dn_equal (__u16 seq1,__u16 seq2)
@@ -169 +169 @@ static __inline__ int dn_equal(__u16 seq1, __u16 seq2) -static __inline__int dn_before_or_equal (__u16 seq1,__u16 seq2) +static inline int dn_before_or_equal (__u16 seq1,__u16 seq2)
@@ -174 +174 @@ static __inline__ int dn_before_or_equal(__u16 seq1, __u16 seq2) -static __inline__void seq_add (__u16 *seq,__u16 off) +static inline void seq_add (__u16 *seq,__u16 off)
@@ -180 +180 @@ static __inline__ void seq_add(__u16 *seq, __u16 off) -static __inline__int seq_next (__u16 seq1,__u16 seq2) +static inline int seq_next (__u16 seq1,__u16 seq2)
@@ -188 +188 @@ static __inline__ int seq_next(__u16 seq1, __u16 seq2) -static __inline__int sendack (__u16 seq) +static inline int sendack (__u16 seq)
@@ -196 +196 @@ static __inline__ int sendack(__u16 seq) -static __inline__int dn_congested (struct sock *sk) +static inline int dn_congested (struct sock *sk)
include/net/ip.h +1 -1
@@ -523 +523 @@ static inline void ip_ipgre_mc_map(__be32 naddr, const unsigned char *broadcast, -static __inline__void inet_reset_saddr (struct sock *sk) +static inline void inet_reset_saddr (struct sock *sk)
include/net/ip6_checksum.h +1 -1
@@ -58 +58 @@ static inline __wsum ip6_gro_compute_pseudo(struct sk_buff *skb, int proto) -static __inline__ __sum16 tcp_v6_check(int len, +static inline __sum16 tcp_v6_check(int len,
include/net/ipx.h +5 -5
@@ -50 +50 @@ extern int sysctl_ipx_pprop_broadcasting; -static __inline__struct ipxhdr *ipx_hdr (struct sk_buff *skb) +static inline struct ipxhdr *ipx_hdr (struct sk_buff *skb)
@@ -142 +142 @@ const char *ipx_device_name(struct ipx_interface *intrfc); -static __inline__void ipxitf_hold (struct ipx_interface *intrfc) +static inline void ipxitf_hold (struct ipx_interface *intrfc)
@@ -160 +160 @@ int ipxrtr_ioctl(unsigned int cmd, void __user *arg); -static __inline__void ipxitf_put (struct ipx_interface *intrfc) +static inline void ipxitf_put (struct ipx_interface *intrfc)
@@ -166 +166 @@ static __inline__ void ipxitf_put(struct ipx_interface *intrfc) -static __inline__void ipxrtr_hold (struct ipx_route *rt) +static inline void ipxrtr_hold (struct ipx_route *rt)
@@ -171 +171 @@ static __inline__ void ipxrtr_hold(struct ipx_route *rt) -static __inline__void ipxrtr_put (struct ipx_route *rt) +static inline void ipxrtr_put (struct ipx_route *rt)
include/net/llc_c_ev.h +2 -2
@@ -123 +123 @@ struct llc_conn_state_ev { -static __inline__struct llc_conn_state_ev *llc_conn_ev (struct sk_buff *skb) +static inline struct llc_conn_state_ev *llc_conn_ev (struct sk_buff *skb)
@@ -219 +219 @@ int llc_conn_ev_qlfy_set_status_rst_done(struct sock *sk, struct sk_buff *skb); -static __inline__int llc_conn_space (struct sock *sk,struct sk_buff *skb) +static inline int llc_conn_space (struct sock *sk,struct sk_buff *skb)
include/net/llc_conn.h +2 -2
@@ -88 +88 @@ static inline struct llc_sock *llc_sk(const struct sock *sk) -static __inline__void llc_set_backlog_type (struct sk_buff *skb,char type) +static inline void llc_set_backlog_type (struct sk_buff *skb,char type)
@@ -93 +93 @@ static __inline__ void llc_set_backlog_type(struct sk_buff *skb, char type) -static __inline__char llc_backlog_type (struct sk_buff *skb) +static inline char llc_backlog_type (struct sk_buff *skb)
include/net/llc_s_ev.h +1 -1
@@ -47 +47 @@ struct llc_sap_state_ev { -static __inline__struct llc_sap_state_ev *llc_sap_ev (struct sk_buff *skb) +static inline struct llc_sap_state_ev *llc_sap_ev (struct sk_buff *skb)
include/net/netrom.h +4 -4
@@ -126 +126 @@ struct nr_node { -static __inline__void nr_node_put (struct nr_node *nr_node) +static inline void nr_node_put (struct nr_node *nr_node)
@@ -136 +136 @@ static __inline__ void nr_node_put(struct nr_node *nr_node) -static __inline__void nr_neigh_put (struct nr_neigh *nr_neigh) +static inline void nr_neigh_put (struct nr_neigh *nr_neigh)
@@ -148 +148 @@ static __inline__ void nr_neigh_put(struct nr_neigh *nr_neigh) -static __inline__void nr_node_lock (struct nr_node *nr_node) +static inline void nr_node_lock (struct nr_node *nr_node)
@@ -154 +154 @@ static __inline__ void nr_node_lock(struct nr_node *nr_node) -static __inline__void nr_node_unlock (struct nr_node *nr_node) +static inline void nr_node_unlock (struct nr_node *nr_node)
include/net/scm.h +7 -7
@@ -46 +46 @@ struct scm_fp_list *scm_fp_dup(struct scm_fp_list *fpl); -static __inline__void unix_get_peersec_dgram (struct socket *sock,struct scm_cookie *scm) +static inline void unix_get_peersec_dgram (struct socket *sock,struct scm_cookie *scm)
@@ -51 +51 @@ static __inline__ void unix_get_peersec_dgram(struct socket *sock, struct scm_co -static __inline__void unix_get_peersec_dgram (struct socket *sock,struct scm_cookie *scm) +static inline void unix_get_peersec_dgram (struct socket *sock,struct scm_cookie *scm)
@@ -55 +55 @@ static __inline__ void unix_get_peersec_dgram(struct socket *sock, struct scm_co -static __inline__ void scm_set_cred(struct scm_cookie *scm, +static inline void scm_set_cred(struct scm_cookie *scm,
@@ -64 +64 @@ static __inline__ void scm_set_cred(struct scm_cookie *scm, -static __inline__void scm_destroy_cred (struct scm_cookie *scm) +static inline void scm_destroy_cred (struct scm_cookie *scm)
@@ -70 +70 @@ static __inline__ void scm_destroy_cred(struct scm_cookie *scm) -static __inline__void scm_destroy (struct scm_cookie *scm) +static inline void scm_destroy (struct scm_cookie *scm)
@@ -77 +77 @@ static __inline__ void scm_destroy(struct scm_cookie *scm) -static __inline__ int scm_send(struct socket *sock, struct msghdr *msg, +static inline int scm_send(struct socket *sock, struct msghdr *msg,
@@ -112 +112 @@ static inline void scm_passec(struct socket *sock, struct msghdr *msg, struct sc -static __inline__ void scm_recv(struct socket *sock, struct msghdr *msg, +static inline void scm_recv(struct socket *sock, struct msghdr *msg,
include/net/udplite.h +1 -1
@@ -20 +20 @@ extern struct udp_table udplite_table; -static __inline__ int udplite_getfrag(void *from, char *to, int offset, +static inline int udplite_getfrag(void *from, char *to, int offset,
include/net/x25.h +4 -4
@@ -245 +245 @@ void x25_link_free(void); -static __inline__void x25_neigh_hold (struct x25_neigh *nb) +static inline void x25_neigh_hold (struct x25_neigh *nb)
@@ -250 +250 @@ static __inline__ void x25_neigh_hold(struct x25_neigh *nb) -static __inline__void x25_neigh_put (struct x25_neigh *nb) +static inline void x25_neigh_put (struct x25_neigh *nb)
@@ -268 +268 @@ void x25_route_free(void); -static __inline__void x25_route_hold (struct x25_route *rt) +static inline void x25_route_hold (struct x25_route *rt)
@@ -273 +273 @@ static __inline__ void x25_route_hold(struct x25_route *rt) -static __inline__void x25_route_put (struct x25_route *rt) +static inline void x25_route_put (struct x25_route *rt)
include/net/xfrm.h +9 -9
@@ -897 +897 @@ static inline bool addr4_match(__be32 a1, __be32 a2, u8 prefixlen) -static __inline__ +static inline
@@ -924 +924 @@ __be16 xfrm_flowi_sport(const struct flowi *fl, const union flowi_uli *uli) -static __inline__ +static inline
@@ -1303 +1303 @@ static inline int xfrm6_policy_check_reverse(struct sock *sk, int dir, -static __inline__ +static inline
@@ -1315 +1315 @@ xfrm_address_t *xfrm_flowi_daddr(const struct flowi *fl, unsigned short family) -static __inline__ +static inline
@@ -1327 +1327 @@ xfrm_address_t *xfrm_flowi_saddr(const struct flowi *fl, unsigned short family) -static __inline__ +static inline
@@ -1344 +1344 @@ void xfrm_flowi_addr_get(const struct flowi *fl, -static __inline__ int +static inline int
@@ -1354 +1354 @@ __xfrm4_state_addr_check(const struct xfrm_state *x, -static __inline__ int +static inline int
@@ -1366 +1366 @@ __xfrm6_state_addr_check(const struct xfrm_state *x, -static __inline__ int +static inline int
@@ -1380 +1380 @@ xfrm_state_addr_check(const struct xfrm_state *x, -static __inline__ int +static inline int
include/video/newport.h +6 -6
@@ -429 +429 @@ static inline unsigned short newport_vc2_get(struct newport_regs *regs, -static __inline__ void newport_cmap_setaddr(struct newport_regs *regs, +static inline void newport_cmap_setaddr(struct newport_regs *regs,
@@ -440 +440 @@ static __inline__ void newport_cmap_setaddr(struct newport_regs *regs, -static __inline__ void newport_cmap_setrgb(struct newport_regs *regs, +static inline void newport_cmap_setrgb(struct newport_regs *regs,
@@ -453 +453 @@ static __inline__ void newport_cmap_setrgb(struct newport_regs *regs, -static __inline__int newport_wait (struct newport_regs *regs) +static inline int newport_wait (struct newport_regs *regs)
@@ -463 +463 @@ static __inline__ int newport_wait(struct newport_regs *regs) -static __inline__int newport_bfwait (struct newport_regs *regs) +static inline int newport_bfwait (struct newport_regs *regs)
@@ -550 +550 @@ static __inline__ int newport_bfwait(struct newport_regs *regs) -static __inline__ void +static inline void
@@ -561 +561 @@ xmap9FIFOWait (struct newport_regs *rex) -static __inline__ void +static inline void
net/appletalk/atalk_proc.c +2 -2
@@ -20 +20 @@ -static __inline__struct atalk_iface *atalk_get_interface_idx (loff_t pos) +static inline struct atalk_iface *atalk_get_interface_idx (loff_t pos)
@@ -81 +81 @@ static int atalk_seq_interface_show(struct seq_file *seq, void *v) -static __inline__struct atalk_route *atalk_get_route_idx (loff_t pos) +static inline struct atalk_route *atalk_get_route_idx (loff_t pos)
net/appletalk/ddp.c +1 -1
@@ -1280 +1280 @@ static int atalk_getname(struct socket *sock, struct sockaddr *uaddr, -static __inline__int is_ip_over_ddp (struct sk_buff *skb) +static inline int is_ip_over_ddp (struct sk_buff *skb)
net/core/neighbour.c +1 -1
@@ -865 +865 @@ static void neigh_periodic_work(struct work_struct *work) -static __inline__int neigh_max_probes (struct neighbour *n) +static inline int neigh_max_probes (struct neighbour *n)
net/core/scm.c +1 -1
@@ -48 +48 @@ -static __inline__int scm_check_creds (struct ucred *creds) +static inline int scm_check_creds (struct ucred *creds)
net/decnet/dn_nsp_in.c +1 -1
@@ -585 +585 @@ static void dn_nsp_linkservice(struct sock *sk, struct sk_buff *skb) -static __inline__int dn_queue_skb (struct sock *sk,struct sk_buff *skb,int sig,struct sk_buff_head *queue) +static inline int dn_queue_skb (struct sock *sk,struct sk_buff *skb,int sig,struct sk_buff_head *queue)
net/decnet/dn_nsp_out.c +1 -1
@@ -532 +532 @@ void dn_send_conn_conf(struct sock *sk, gfp_t gfp) -static __inline__ void dn_nsp_do_disc(struct sock *sk, unsigned char msgflg, +static inline void dn_nsp_do_disc(struct sock *sk, unsigned char msgflg,
net/decnet/dn_route.c +1 -1
@@ -177 +177 @@ static void dn_dst_ifdown(struct dst_entry *dst, struct net_device *dev, int how -static __inline__unsigned int dn_hash (__le16 src,__le16 dst) +static inline unsigned int dn_hash (__le16 src,__le16 dst)
net/decnet/dn_table.c +2 -2
@@ -408 +408 @@ static void dn_rtmsg_fib(int event, struct dn_fib_node *f, int z, u32 tb_id, -static __inline__ int dn_hash_dump_bucket(struct sk_buff *skb, +static inline int dn_hash_dump_bucket(struct sk_buff *skb,
@@ -437 +437 @@ static __inline__ int dn_hash_dump_bucket(struct sk_buff *skb, -static __inline__ int dn_hash_dump_zone(struct sk_buff *skb, +static inline int dn_hash_dump_zone(struct sk_buff *skb,
net/ipv4/igmp.c +1 -1
@@ -21 +21 @@ -* Alan Cox : Added lots of __inline__ to optimise +* Alan Cox : Added lots of inline to optimise
net/ipv6/af_inet6.c +1 -1
@@ -103 +103 @@ EXPORT_SYMBOL_GPL(ipv6_mod_enabled); -static __inline__struct ipv6_pinfo *inet6_sk_generic (struct sock *sk) +static inline struct ipv6_pinfo *inet6_sk_generic (struct sock *sk)
net/ipv6/icmp.c +2 -2
@@ -114 +114 @@ static const struct inet6_protocol icmpv6_protocol = { -static __inline__struct sock *icmpv6_xmit_lock (struct net *net) +static inline struct sock *icmpv6_xmit_lock (struct net *net)
@@ -129 +129 @@ static __inline__ struct sock *icmpv6_xmit_lock(struct net *net) -static __inline__void icmpv6_xmit_unlock (struct sock *sk) +static inline void icmpv6_xmit_unlock (struct sock *sk)
net/ipv6/udp.c +2 -2
@@ -542 +542 @@ static int __udpv6_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) -static __inline__ void udpv6_err(struct sk_buff *skb, +static inline void udpv6_err(struct sk_buff *skb,
@@ -939 +939 @@ static void udp_v6_early_demux(struct sk_buff *skb) -static __inline__int udpv6_rcv (struct sk_buff *skb) +static inline int udpv6_rcv (struct sk_buff *skb)
net/lapb/lapb_iface.c +2 -2
@@ -55 +55 @@ static void lapb_free_cb(struct lapb_cb *lapb) -static __inline__void lapb_hold (struct lapb_cb *lapb) +static inline void lapb_hold (struct lapb_cb *lapb)
@@ -60 +60 @@ static __inline__ void lapb_hold(struct lapb_cb *lapb) -static __inline__void lapb_put (struct lapb_cb *lapb) +static inline void lapb_put (struct lapb_cb *lapb)
net/llc/llc_input.c +1 -1
@@ -75 +75 @@ void llc_set_station_handler(void (*handler)(struct sk_buff *skb)) -static __inline__int llc_pdu_type (struct sk_buff *skb) +static inline int llc_pdu_type (struct sk_buff *skb)
sound/sparc/amd7930.c +3 -3
@@ -347 +347 @@ static struct snd_amd7930 *amd7930_list; -static __inline__void amd7930_idle (struct snd_amd7930 *amd) +static inline void amd7930_idle (struct snd_amd7930 *amd)
@@ -358 +358 @@ static __inline__ void amd7930_idle(struct snd_amd7930 *amd) -static __inline__void amd7930_enable_ints (struct snd_amd7930 *amd) +static inline void amd7930_enable_ints (struct snd_amd7930 *amd)
@@ -369 +369 @@ static __inline__ void amd7930_enable_ints(struct snd_amd7930 *amd) -static __inline__void amd7930_disable_ints (struct snd_amd7930 *amd) +static inline void amd7930_disable_ints (struct snd_amd7930 *amd)
Re: [PATCH v2 1/2] compiler-gcc.h: add gnu_inline to all inline declarations
Quoted 17 lines · Joe Perches
Quoted 4 lines · Nick Desaulniers
I get the feeling that the use of
__inline__or__inline(vs inline) in the kernel may be wrong and their use should be eradicated in the follow up patch set, but it would be cool if others have additional insight.
__inlineis easy and useful to remove as it's used in just a few files.But
__inline__is used in a lot of files and locations:$ git grep -w --name-only __inline__ | wc -l 154 $ git grep -w __inline__ | wc -l 503
Quoted 6 lines
Some of these files are used in asm includes as
well where__inline__may be preferred by gcchttps://gcc.gnu.org/onlinedocs/gcc/Alternate-Keywords.html#Alternate-Keywords
so perhaps asm exclusions would be necessary.
Oops, just saw this email after sending v3: https://lkml.org/lkml/2018/6/7/1055
Guess I should re-add __inline__ and __inline then to 1/3?
https://lkml.org/lkml/2018/6/7/1060
ie:
+#define __inline__ __inline__ inline
instead of
+#define __inline__ inline
?
On the other hand, I was able to assemble with gcc+binutils and v3 as it stands.
Reading the link you sent, it seems more about compiling with -pedantic or non-gnu C standards being used (I'd call that unlikely for the kernel). So it still seems incorrect to me the use of __inline__ (but I do appreciate the link!) at least in the kernel.
Re: [PATCH v2 1/2] compiler-gcc.h: add gnu_inline to all inline declarations
In reply to Nick DesaulniersQuoted 4 lines · Nick Desaulniers
I get the feeling that the use of
__inline__or__inline(vs inline) in the kernel may be wrong and their use should be eradicated in the follow up patch set, but it would be cool if others have additional insight.
__inline is easy and useful to remove as it's used in just a few files.
But __inline__ is used in a lot of files and locations:
$ git grep -w --name-only __inline__ | wc -l 154 $ git grep -w __inline__ | wc -l 503
Some of these files are used in asm includes as well where __inline__ may be preferred by gcc
https://gcc.gnu.org/onlinedocs/gcc/Alternate-Keywords.html#Alternate-Keywords
so perhaps asm exclusions would be necessary.
A similar script to sed them is certainly possible but perhaps could cause some conflicts later in a merge cycle. Realistically, this sort of script can only be applied by Linus. Separating out the individual patches by maintainer effectively means the series will never be wholly applied.
Maybe excluding all /asm/ directories:
$ git grep -w --name-only __inline__ | \ grep -vP '(?:/uapi/|/asm/|^scripts/|compiler)' | \ xargs sed -r -i -e 's/\b__inline__\b/inline/g'
This script today results are (-U0 to minimize output):
---
$ git diff -U0 --stat -p Documentation/translations/ja_JP/SubmittingPatches | 4 +-- Documentation/translations/zh_CN/SubmittingPatches | 4 +-- arch/arm/mach-iop32x/include/mach/uncompress.h | 2 +- arch/arm/mach-iop33x/include/mach/uncompress.h | 2 +- arch/arm/mach-ixp4xx/include/mach/uncompress.h | 2 +- arch/ia64/hp/common/sba_iommu.c | 2 +- arch/ia64/hp/sim/simeth.c | 2 +- arch/ia64/oprofile/backtrace.c | 4 +-- arch/m68k/mac/iop.c | 14 +++++----- arch/mips/kernel/binfmt_elfn32.c | 2 +- arch/sh/include/cpu-sh3/cpu/dac.h | 6 ++--- block/partitions/amiga.c | 2 +- drivers/atm/he.c | 6 ++--- drivers/atm/idt77252.c | 6 ++--- drivers/gpu/drm/mga/mga_drv.h | 2 +- drivers/gpu/drm/mga/mga_state.c | 14 +++++----- drivers/gpu/drm/r128/r128_drv.h | 2 +- drivers/gpu/drm/r128/r128_state.c | 14 +++++----- drivers/gpu/drm/via/via_irq.c | 2 +- drivers/gpu/drm/via/via_verifier.c | 30 +++++++++++----------- drivers/isdn/hardware/eicon/platform.h | 14 +++++----- drivers/isdn/i4l/isdn_net.c | 14 +++++----- drivers/isdn/i4l/isdn_net.h | 8 +++--- drivers/media/pci/ivtv/ivtv-ioctl.c | 2 +- drivers/net/ethernet/sun/sungem.c | 8 +++--- drivers/net/ethernet/sun/sunhme.c | 6 ++--- drivers/net/hamradio/baycom_ser_fdx.c | 2 +- drivers/net/wan/lapbether.c | 2 +- drivers/net/wan/n2.c | 4 +-- drivers/parisc/led.c | 4 +-- drivers/parisc/sba_iommu.c | 2 +- drivers/parport/parport_gsc.c | 2 +- drivers/parport/parport_gsc.h | 4 +-- drivers/parport/parport_pc.c | 2 +- drivers/scsi/lpfc/lpfc_scsi.c | 2 +- drivers/scsi/pcmcia/sym53c500_cs.c | 4 +-- drivers/scsi/qla2xxx/qla_inline.h | 2 +- drivers/scsi/qla2xxx/qla_os.c | 4 +-- drivers/staging/ipx/ipx_proc.c | 2 +- drivers/tty/amiserial.c | 2 +- drivers/tty/serial/ip22zilog.c | 2 +- drivers/tty/serial/sunsab.c | 4 +-- drivers/tty/serial/sunzilog.c | 2 +- drivers/video/fbdev/core/fbcon.c | 20 +++++++-------- drivers/video/fbdev/ffb.c | 2 +- drivers/video/fbdev/intelfb/intelfbdrv.c | 10 ++++---- drivers/video/fbdev/intelfb/intelfbhw.c | 2 +- drivers/w1/masters/matrox_w1.c | 4 +-- fs/coda/coda_linux.h | 6 ++--- fs/freevxfs/vxfs_inode.c | 2 +- fs/nfsd/nfsfh.h | 4 +-- include/acpi/platform/acgcc.h | 2 +- include/asm-generic/ide_iops.h | 8 +++--- include/drm/drmP.h | 4 +-- include/drm/drm_legacy.h | 2 +- include/linux/atalk.h | 4 +-- include/linux/ceph/messenger.h | 2 +- include/linux/hdlc.h | 4 +-- include/linux/inetdevice.h | 8 +++--- include/linux/parport.h | 4 +-- include/linux/parport_pc.h | 22 ++++++++-------- include/net/ax25.h | 2 +- include/net/checksum.h | 2 +- include/net/dn_nsp.h | 16 ++++++------ include/net/ip.h | 2 +- include/net/ip6_checksum.h | 2 +- include/net/ipx.h | 10 ++++---- include/net/llc_c_ev.h | 4 +-- include/net/llc_conn.h | 4 +-- include/net/llc_s_ev.h | 2 +- include/net/netrom.h | 8 +++--- include/net/scm.h | 14 +++++----- include/net/udplite.h | 2 +- include/net/x25.h | 8 +++--- include/net/xfrm.h | 18 ++++++------- include/video/newport.h | 12 ++++----- net/appletalk/atalk_proc.c | 4 +-- net/appletalk/ddp.c | 2 +- net/core/neighbour.c | 2 +- net/core/scm.c | 2 +- net/decnet/dn_nsp_in.c | 2 +- net/decnet/dn_nsp_out.c | 2 +- net/decnet/dn_route.c | 2 +- net/decnet/dn_table.c | 4 +-- net/ipv4/igmp.c | 2 +- net/ipv6/af_inet6.c | 2 +- net/ipv6/icmp.c | 4 +-- net/ipv6/udp.c | 4 +-- net/lapb/lapb_iface.c | 4 +-- net/llc/llc_input.c | 2 +- sound/sparc/amd7930.c | 6 ++--- 91 files changed, 240 insertions(+), 240 deletions(-)
Documentation/translations/ja_JP/SubmittingPatches +2 -2
@@ -679,2 +679,2 @@ gcc においては、マクロと同じくらい軽いです。 -「 static inline 」は「 static __inline__ 」や「 extern inline 」や -「 extern __inline__ 」よりも適切です。 +「 static inline 」は「 static inline 」や「 extern inline 」や +「 extern inline 」よりも適切です。
Documentation/translations/zh_CN/SubmittingPatches +2 -2
@@ -380,2 +380,2 @@ Static inline 函数相比宏来说,是好得多的选择。Static inline 函 -应该用 'static inline' 而不是 'static __inline__', 'extern inline' 和 -'extern __inline__' 。 +应该用 'static inline' 而不是 'static inline', 'extern inline' 和 +'extern inline' 。
arch/arm/mach-iop32x/include/mach/uncompress.h +1 -1
@@ -26 +26 @@ static inline void flush(void) -static __inline__void __arch_decomp_setup (unsigned long arch_id) +static inline void __arch_decomp_setup (unsigned long arch_id)
arch/arm/mach-iop33x/include/mach/uncompress.h +1 -1
@@ -26 +26 @@ static inline void flush(void) -static __inline__void __arch_decomp_setup (unsigned long arch_id) +static inline void __arch_decomp_setup (unsigned long arch_id)
arch/arm/mach-ixp4xx/include/mach/uncompress.h +1 -1
@@ -38 +38 @@ static void flush(void) -static __inline__void __arch_decomp_setup (unsigned long arch_id) +static inline void __arch_decomp_setup (unsigned long arch_id)
arch/ia64/hp/common/sba_iommu.c +1 -1
@@ -110 +110 @@ extern int swiotlb_late_init_with_default_size (size_t size); -#define SBA_INLINE __inline__ +#define SBA_INLINE inline
arch/ia64/hp/sim/simeth.c +1 -1
@@ -249 +249 @@ simeth_open(struct net_device *dev) -static __inline__int dev_is_ethdev (struct net_device *dev) +static inline int dev_is_ethdev (struct net_device *dev)
arch/ia64/oprofile/backtrace.c +2 -2
@@ -35 +35 @@ typedef struct -static __inline__int in_ivt_code (unsigned long pc) +static inline int in_ivt_code (unsigned long pc)
@@ -44 +44 @@ static __inline__ int in_ivt_code(unsigned long pc) -static __inline__int next_frame (ia64_backtrace_t *bt) +static inline int next_frame (ia64_backtrace_t *bt)
arch/m68k/mac/iop.c +7 -7
@@ -164 +164 @@ irqreturn_t iop_ism_irq(int, void *); -static __inline__void iop_loadaddr (volatile struct mac_iop *iop,__u16 addr) +static inline void iop_loadaddr (volatile struct mac_iop *iop,__u16 addr)
@@ -170 +170 @@ static __inline__ void iop_loadaddr(volatile struct mac_iop *iop, __u16 addr) -static __inline____u8 iop_readb (volatile struct mac_iop *iop,__u16 addr) +static inline __u8 iop_readb (volatile struct mac_iop *iop,__u16 addr)
@@ -177 +177 @@ static __inline__ __u8 iop_readb(volatile struct mac_iop *iop, __u16 addr) -static __inline__void iop_writeb (volatile struct mac_iop *iop,__u16 addr,__u8 data) +static inline void iop_writeb (volatile struct mac_iop *iop,__u16 addr,__u8 data)
@@ -184 +184 @@ static __inline__ void iop_writeb(volatile struct mac_iop *iop, __u16 addr, __u8 -static __inline__void iop_stop (volatile struct mac_iop *iop) +static inline void iop_stop (volatile struct mac_iop *iop)
@@ -189 +189 @@ static __inline__ void iop_stop(volatile struct mac_iop *iop) -static __inline__void iop_start (volatile struct mac_iop *iop) +static inline void iop_start (volatile struct mac_iop *iop)
@@ -194 +194 @@ static __inline__ void iop_start(volatile struct mac_iop *iop) -static __inline__void iop_bypass (volatile struct mac_iop *iop) +static inline void iop_bypass (volatile struct mac_iop *iop)
@@ -199 +199 @@ static __inline__ void iop_bypass(volatile struct mac_iop *iop) -static __inline__void iop_interrupt (volatile struct mac_iop *iop) +static inline void iop_interrupt (volatile struct mac_iop *iop)
arch/mips/kernel/binfmt_elfn32.c +1 -1
@@ -85 +85 @@ struct elf_prpsinfo32 -static __inline__ void +static inline void
arch/sh/include/cpu-sh3/cpu/dac.h +3 -3
@@ -18 +18 @@ -static __inline__void sh_dac_enable (int channel) +static inline void sh_dac_enable (int channel)
@@ -27 +27 @@ static __inline__ void sh_dac_enable(int channel) -static __inline__void sh_dac_disable (int channel) +static inline void sh_dac_disable (int channel)
@@ -36 +36 @@ static __inline__ void sh_dac_disable(int channel) -static __inline__void sh_dac_output (u8 value,int channel) +static inline void sh_dac_output (u8 value,int channel)
block/partitions/amiga.c +1 -1
@@ -19 +19 @@ -static __inline__ u32 +static inline u32
drivers/atm/he.c +3 -3
@@ -181 +181 @@ static const struct atmdev_ops he_ops = -static __inline__ void +static inline void
@@ -327 +327 @@ he_readl_internal(struct he_dev *he_dev, unsigned addr, unsigned flags) -static __inline__ struct atm_vcc* +static inline struct atm_vcc*
@@ -2053 +2053 @@ he_irq_handler(int irq, void *dev_id) -static __inline__ void +static inline void
drivers/atm/idt77252.c +3 -3
@@ -1786 +1786 @@ set_tct(struct idt77252_dev *card, struct vc_map *vc) -static __inline__ int +static inline int
@@ -1792 +1792 @@ idt77252_fbq_level(struct idt77252_dev *card, int queue) -static __inline__ int +static inline int
@@ -2019 +2019 @@ idt77252_send_oam(struct atm_vcc *vcc, void *cell, int flags) -static __inline__ unsigned int +static inline unsigned int
drivers/gpu/drm/mga/mga_drv.h +1 -1
@@ -664 +664 @@ do { \ -static __inline__int mga_is_idle (drm_mga_private_t *dev_priv) +static inline int mga_is_idle (drm_mga_private_t *dev_priv)
drivers/gpu/drm/mga/mga_state.c +7 -7
@@ -68 +68 @@ static void mga_emit_clip_rect(drm_mga_private_t *dev_priv, -static __inline__void mga_g200_emit_context (drm_mga_private_t *dev_priv) +static inline void mga_g200_emit_context (drm_mga_private_t *dev_priv)
@@ -91 +91 @@ static __inline__ void mga_g200_emit_context(drm_mga_private_t *dev_priv) -static __inline__void mga_g400_emit_context (drm_mga_private_t *dev_priv) +static inline void mga_g400_emit_context (drm_mga_private_t *dev_priv)
@@ -118 +118 @@ static __inline__ void mga_g400_emit_context(drm_mga_private_t *dev_priv) -static __inline__void mga_g200_emit_tex0 (drm_mga_private_t *dev_priv) +static inline void mga_g200_emit_tex0 (drm_mga_private_t *dev_priv)
@@ -146 +146 @@ static __inline__ void mga_g200_emit_tex0(drm_mga_private_t *dev_priv) -static __inline__void mga_g400_emit_tex0 (drm_mga_private_t *dev_priv) +static inline void mga_g400_emit_tex0 (drm_mga_private_t *dev_priv)
@@ -186 +186 @@ static __inline__ void mga_g400_emit_tex0(drm_mga_private_t *dev_priv) -static __inline__void mga_g400_emit_tex1 (drm_mga_private_t *dev_priv) +static inline void mga_g400_emit_tex1 (drm_mga_private_t *dev_priv)
@@ -225 +225 @@ static __inline__ void mga_g400_emit_tex1(drm_mga_private_t *dev_priv) -static __inline__void mga_g200_emit_pipe (drm_mga_private_t *dev_priv) +static inline void mga_g200_emit_pipe (drm_mga_private_t *dev_priv)
@@ -252 +252 @@ static __inline__ void mga_g200_emit_pipe(drm_mga_private_t *dev_priv) -static __inline__void mga_g400_emit_pipe (drm_mga_private_t *dev_priv) +static inline void mga_g400_emit_pipe (drm_mga_private_t *dev_priv)
drivers/gpu/drm/r128/r128_drv.h +1 -1
@@ -420 +420 @@ do { \ -static __inline__void r128_update_ring_snapshot (drm_r128_private_t *dev_priv) +static inline void r128_update_ring_snapshot (drm_r128_private_t *dev_priv)
drivers/gpu/drm/r128/r128_state.c +7 -7
@@ -82 +82 @@ static void r128_emit_clip_rects(drm_r128_private_t *dev_priv, -static __inline__void r128_emit_core (drm_r128_private_t *dev_priv) +static inline void r128_emit_core (drm_r128_private_t *dev_priv)
@@ -97 +97 @@ static __inline__ void r128_emit_core(drm_r128_private_t *dev_priv) -static __inline__void r128_emit_context (drm_r128_private_t *dev_priv) +static inline void r128_emit_context (drm_r128_private_t *dev_priv)
@@ -123 +123 @@ static __inline__ void r128_emit_context(drm_r128_private_t *dev_priv) -static __inline__void r128_emit_setup (drm_r128_private_t *dev_priv) +static inline void r128_emit_setup (drm_r128_private_t *dev_priv)
@@ -139 +139 @@ static __inline__ void r128_emit_setup(drm_r128_private_t *dev_priv) -static __inline__void r128_emit_masks (drm_r128_private_t *dev_priv) +static inline void r128_emit_masks (drm_r128_private_t *dev_priv)
@@ -158 +158 @@ static __inline__ void r128_emit_masks(drm_r128_private_t *dev_priv) -static __inline__void r128_emit_window (drm_r128_private_t *dev_priv) +static inline void r128_emit_window (drm_r128_private_t *dev_priv)
@@ -173 +173 @@ static __inline__ void r128_emit_window(drm_r128_private_t *dev_priv) -static __inline__void r128_emit_tex0 (drm_r128_private_t *dev_priv) +static inline void r128_emit_tex0 (drm_r128_private_t *dev_priv)
@@ -199 +199 @@ static __inline__ void r128_emit_tex0(drm_r128_private_t *dev_priv) -static __inline__void r128_emit_tex1 (drm_r128_private_t *dev_priv) +static inline void r128_emit_tex1 (drm_r128_private_t *dev_priv)
drivers/gpu/drm/via/via_irq.c +1 -1
@@ -155 +155 @@ irqreturn_t via_driver_irq_handler(int irq, void *arg) -static __inline__void viadrv_acknowledge_irqs (drm_via_private_t *dev_priv) +static inline void viadrv_acknowledge_irqs (drm_via_private_t *dev_priv)
drivers/gpu/drm/via/via_verifier.c +15 -15
@@ -238 +238 @@ static hazard_t table3[256]; -static __inline__ int +static inline int
@@ -253 +253 @@ eat_words(const uint32_t **buf, const uint32_t *buf_end, unsigned num_words) -static __inline__ drm_local_map_t *via_drm_lookup_agp_map(drm_via_state_t *seq, +static inline drm_local_map_t *via_drm_lookup_agp_map(drm_via_state_t *seq,
@@ -290 +290 @@ static __inline__ drm_local_map_t *via_drm_lookup_agp_map(drm_via_state_t *seq, -static __inline__int finish_current_sequence (drm_via_state_t * cur_seq) +static inline int finish_current_sequence (drm_via_state_t * cur_seq)
@@ -347 +347 @@ static __inline__ int finish_current_sequence(drm_via_state_t * cur_seq) -static __inline__ int +static inline int
@@ -520 +520 @@ investigate_hazard(uint32_t cmd, hazard_t hz, drm_via_state_t *cur_seq) -static __inline__ int +static inline int
@@ -624 +624 @@ via_check_prim_list(uint32_t const **buffer, const uint32_t * buf_end, -static __inline__ verifier_state_t +static inline verifier_state_t
@@ -716 +716 @@ via_check_header2(uint32_t const **buffer, const uint32_t *buf_end, -static __inline__ verifier_state_t +static inline verifier_state_t
@@ -765 +765 @@ via_parse_header2(drm_via_private_t *dev_priv, uint32_t const **buffer, -static __inline__int verify_mmio_address (uint32_t address) +static inline int verify_mmio_address (uint32_t address)
@@ -783 +783 @@ static __inline__ int verify_mmio_address(uint32_t address) -static __inline__ int +static inline int
@@ -803 +803 @@ verify_video_tail(uint32_t const **buffer, const uint32_t * buf_end, -static __inline__ verifier_state_t +static inline verifier_state_t
@@ -835 +835 @@ via_check_header1(uint32_t const **buffer, const uint32_t * buf_end) -static __inline__ verifier_state_t +static inline verifier_state_t
@@ -853 +853 @@ via_parse_header1(drm_via_private_t *dev_priv, uint32_t const **buffer, -static __inline__ verifier_state_t +static inline verifier_state_t
@@ -886 +886 @@ via_check_vheader5(uint32_t const **buffer, const uint32_t *buf_end) -static __inline__ verifier_state_t +static inline verifier_state_t
@@ -904 +904 @@ via_parse_vheader5(drm_via_private_t *dev_priv, uint32_t const **buffer, -static __inline__ verifier_state_t +static inline verifier_state_t
@@ -941 +941 @@ via_check_vheader6(uint32_t const **buffer, const uint32_t * buf_end) -static __inline__ verifier_state_t +static inline verifier_state_t
drivers/isdn/hardware/eicon/platform.h +7 -7
@@ -162 +162 @@ void diva_xdi_didd_remove_adapter(int card); -static __inline__void *diva_os_malloc (unsigned long flags,unsigned long size) +static inline void *diva_os_malloc (unsigned long flags,unsigned long size)
@@ -171 +171 @@ static __inline__ void *diva_os_malloc(unsigned long flags, unsigned long size) -static __inline__void diva_os_free (unsigned long flags,void *ptr) +static inline void diva_os_free (unsigned long flags,void *ptr)
@@ -188 +188 @@ void diva_os_free_message_buffer(diva_os_message_buffer_s *dmb); -static __inline__void diva_os_sleep (dword mSec) +static inline void diva_os_sleep (dword mSec)
@@ -192 +192 @@ static __inline__ void diva_os_sleep(dword mSec) -static __inline__void diva_os_wait (dword mSec) +static inline void diva_os_wait (dword mSec)
@@ -236 +236 @@ typedef spinlock_t diva_os_spin_lock_t; -static __inline__int diva_os_initialize_spin_lock (spinlock_t *lock,void *unused) { \ +static inline int diva_os_initialize_spin_lock (spinlock_t *lock,void *unused) { \
@@ -238 +238 @@ static __inline__ int diva_os_initialize_spin_lock(spinlock_t *lock, void *unuse -static __inline__ void diva_os_enter_spin_lock(diva_os_spin_lock_t *a, \ +static inline void diva_os_enter_spin_lock(diva_os_spin_lock_t *a, \
@@ -241 +241 @@ static __inline__ void diva_os_enter_spin_lock(diva_os_spin_lock_t *a, \ -static __inline__ void diva_os_leave_spin_lock(diva_os_spin_lock_t *a, \ +static inline void diva_os_leave_spin_lock(diva_os_spin_lock_t *a, \
drivers/isdn/i4l/isdn_net.c +7 -7
@@ -73 +73 @@ -static __inline__int isdn_net_device_started (isdn_net_dev *n) +static inline int isdn_net_device_started (isdn_net_dev *n)
@@ -89 +89 @@ static __inline__ int isdn_net_device_started(isdn_net_dev *n) -static __inline__void isdn_net_device_wake_queue (isdn_net_local *lp) +static inline void isdn_net_device_wake_queue (isdn_net_local *lp)
@@ -101 +101 @@ static __inline__ void isdn_net_device_wake_queue(isdn_net_local *lp) -static __inline__void isdn_net_device_stop_queue (isdn_net_local *lp) +static inline void isdn_net_device_stop_queue (isdn_net_local *lp)
@@ -114 +114 @@ static __inline__ void isdn_net_device_stop_queue(isdn_net_local *lp) -static __inline__int isdn_net_device_busy (isdn_net_local *lp) +static inline int isdn_net_device_busy (isdn_net_local *lp)
@@ -141 +141 @@ static __inline__ int isdn_net_device_busy(isdn_net_local *lp) -static __inline__void isdn_net_inc_frame_cnt (isdn_net_local *lp) +static inline void isdn_net_inc_frame_cnt (isdn_net_local *lp)
@@ -148 +148 @@ static __inline__ void isdn_net_inc_frame_cnt(isdn_net_local *lp) -static __inline__void isdn_net_dec_frame_cnt (isdn_net_local *lp) +static inline void isdn_net_dec_frame_cnt (isdn_net_local *lp)
@@ -161 +161 @@ static __inline__ void isdn_net_dec_frame_cnt(isdn_net_local *lp) -static __inline__void isdn_net_zero_frame_cnt (isdn_net_local *lp) +static inline void isdn_net_zero_frame_cnt (isdn_net_local *lp)
drivers/isdn/i4l/isdn_net.h +4 -4
@@ -67 +67 @@ extern void isdn_net_write_super(isdn_net_local *lp, struct sk_buff *skb); -static __inline__int isdn_net_lp_busy (isdn_net_local *lp) +static inline int isdn_net_lp_busy (isdn_net_local *lp)
@@ -79 +79 @@ static __inline__ int isdn_net_lp_busy(isdn_net_local *lp) -static __inline__isdn_net_local *isdn_net_get_locked_lp (isdn_net_dev *nd) +static inline isdn_net_local *isdn_net_get_locked_lp (isdn_net_dev *nd)
@@ -107 +107 @@ static __inline__ isdn_net_local *isdn_net_get_locked_lp(isdn_net_dev *nd) -static __inline__void isdn_net_add_to_bundle (isdn_net_dev *nd,isdn_net_local *nlp) +static inline void isdn_net_add_to_bundle (isdn_net_dev *nd,isdn_net_local *nlp)
@@ -128 +128 @@ static __inline__ void isdn_net_add_to_bundle(isdn_net_dev *nd, isdn_net_local * -static __inline__void isdn_net_rm_from_bundle (isdn_net_local *lp) +static inline void isdn_net_rm_from_bundle (isdn_net_local *lp)
drivers/media/pci/ivtv/ivtv-ioctl.c +1 -1
@@ -1625 +1625 @@ static int ivtv_try_decoder_cmd(struct file *file, void *fh, struct v4l2_decoder -static __inline__void warn_deprecated_ioctl (const char *name) +static inline void warn_deprecated_ioctl (const char *name)
drivers/net/ethernet/sun/sungem.c +4 -4
@@ -644 +644 @@ static int gem_abnormal_irq(struct net_device *dev, struct gem *gp, u32 gem_stat -static __inline__void gem_tx (struct net_device *dev,struct gem *gp,u32 gem_status) +static inline void gem_tx (struct net_device *dev,struct gem *gp,u32 gem_status)
@@ -714 +714 @@ static __inline__ void gem_tx(struct net_device *dev, struct gem *gp, u32 gem_st -static __inline__void gem_post_rxds (struct gem *gp,int limit) +static inline void gem_post_rxds (struct gem *gp,int limit)
@@ -746 +746 @@ static __inline__ void gem_post_rxds(struct gem *gp, int limit) -static __inline__ struct sk_buff *gem_alloc_skb(struct net_device *dev, int size, +static inline struct sk_buff *gem_alloc_skb(struct net_device *dev, int size,
@@ -989 +989 @@ static void gem_tx_timeout(struct net_device *dev) -static __inline__int gem_intme (int entry) +static inline int gem_intme (int entry)
drivers/net/ethernet/sun/sunhme.c +3 -3
@@ -111 +111 @@ static int txlog_cur_entry; -static __inline__void tx_add_log (struct happy_meal *hp,unsigned int a,unsigned int s) +static inline void tx_add_log (struct happy_meal *hp,unsigned int a,unsigned int s)
@@ -126 +126 @@ static __inline__ void tx_add_log(struct happy_meal *hp, unsigned int a, unsigne -static __inline__void tx_dump_log (void ) +static inline void tx_dump_log (void )
@@ -139 +139 @@ static __inline__ void tx_dump_log(void) -static __inline__void tx_dump_ring (struct happy_meal *hp) +static inline void tx_dump_ring (struct happy_meal *hp)
drivers/net/hamradio/baycom_ser_fdx.c +1 -1
@@ -232 +232 @@ static inline unsigned int hweight8(unsigned int w) -static __inline__void ser12_rx (struct net_device *dev,struct baycom_state *bc,struct timespec64 *ts,unsigned char curs) +static inline void ser12_rx (struct net_device *dev,struct baycom_state *bc,struct timespec64 *ts,unsigned char curs)
drivers/net/wan/lapbether.c +1 -1
@@ -79 +79 @@ static struct lapbethdev *lapbeth_get_x25_dev(struct net_device *dev) -static __inline__int dev_is_ethdev (struct net_device *dev) +static inline int dev_is_ethdev (struct net_device *dev)
drivers/net/wan/n2.c +2 -2
@@ -151 +151 @@ static card_t **new_card = &first_card; -static __inline__u8 sca_get_page (card_t *card) +static inline u8 sca_get_page (card_t *card)
@@ -157 +157 @@ static __inline__ u8 sca_get_page(card_t *card) -static __inline__void openwin (card_t *card,u8 page) +static inline void openwin (card_t *card,u8 page)
drivers/parisc/led.c +2 -2
@@ -352 +352 @@ static void led_LCD_driver(unsigned char leds) -static __inline__int led_get_net_activity (void ) +static inline int led_get_net_activity (void )
@@ -404 +404 @@ static __inline__ int led_get_net_activity(void) -static __inline__int led_get_diskio_activity (void ) +static inline int led_get_diskio_activity (void )
drivers/parisc/sba_iommu.c +1 -1
@@ -92 +92 @@ -#define SBA_INLINE __inline__ +#define SBA_INLINE inline
drivers/parport/parport_gsc.c +1 -1
@@ -79 +79 @@ static int clear_epp_timeout(struct parport *pb) -* parport_xxx_yyy macros. extern __inline__ versions of several +* parport_xxx_yyy macros. extern inline versions of several
drivers/parport/parport_gsc.h +2 -2
@@ -44 +44 @@ -static __inline__unsigned char parport_readb (unsigned long port ) +static inline unsigned char parport_readb (unsigned long port )
@@ -50 +50 @@ static __inline__ unsigned char parport_readb( unsigned long port ) -static __inline__void parport_writeb (unsigned char value,unsigned long port ) +static inline void parport_writeb (unsigned char value,unsigned long port )
drivers/parport/parport_pc.c +1 -1
@@ -228 +228 @@ static int clear_epp_timeout(struct parport *pb) -* parport_xxx_yyy macros. extern __inline__ versions of several +* parport_xxx_yyy macros. extern inline versions of several
drivers/scsi/lpfc/lpfc_scsi.c +1 -1
@@ -4476 +4476 @@ lpfc_info(struct Scsi_Host *host) -static __inline__void lpfc_poll_rearm_timer (struct lpfc_hba * phba) +static inline void lpfc_poll_rearm_timer (struct lpfc_hba * phba)
drivers/scsi/pcmcia/sym53c500_cs.c +2 -2
@@ -244 +244 @@ SYM53C500_int_host_reset(int io_port) -static __inline__ int +static inline int
@@ -299 +299 @@ SYM53C500_pio_read(int fast_pio, int base, unsigned char *request, unsigned int -static __inline__ int +static inline int
drivers/scsi/qla2xxx/qla_inline.h +1 -1
@@ -42 +42 @@ qla24xx_calc_iocbs(scsi_qla_host_t *vha, uint16_t dsds) -static __inline__ uint16_t +static inline uint16_t
drivers/scsi/qla2xxx/qla_os.c +2 -2
@@ -346 +346 @@ struct scsi_transport_template *qla2xxx_transport_vport_template = NULL; -__inline__ void +inline void
@@ -368 +368 @@ qla2x00_restart_timer(scsi_qla_host_t *vha, unsigned long interval) -static __inline__ void +static inline void
drivers/staging/ipx/ipx_proc.c +1 -1
@@ -104 +104 @@ static int ipx_seq_route_show(struct seq_file *seq, void *v) -static __inline__struct sock *ipx_get_socket_idx (loff_t pos) +static inline struct sock *ipx_get_socket_idx (loff_t pos)
drivers/tty/amiserial.c +1 -1
@@ -174 +174 @@ static inline int serial_paranoia_check(struct serial_state *info, -static __inline__void rtsdtr_ctrl (int bits) +static inline void rtsdtr_ctrl (int bits)
drivers/tty/serial/ip22zilog.c +1 -1
@@ -493 +493 @@ static irqreturn_t ip22zilog_interrupt(int irq, void *dev_id) -static __inline__unsigned char ip22zilog_read_channel_status (struct uart_port *port) +static inline unsigned char ip22zilog_read_channel_status (struct uart_port *port)
drivers/tty/serial/sunsab.c +2 -2
@@ -95 +95 @@ static char *sab82532_version[16] = { -static __inline__void sunsab_tec_wait (struct uart_sunsab_port *up) +static inline void sunsab_tec_wait (struct uart_sunsab_port *up)
@@ -103 +103 @@ static __inline__ void sunsab_tec_wait(struct uart_sunsab_port *up) -static __inline__void sunsab_cec_wait (struct uart_sunsab_port *up) +static inline void sunsab_cec_wait (struct uart_sunsab_port *up)
drivers/tty/serial/sunzilog.c +1 -1
@@ -593 +593 @@ static irqreturn_t sunzilog_interrupt(int irq, void *dev_id) -static __inline__unsigned char sunzilog_read_channel_status (struct uart_port *port) +static inline unsigned char sunzilog_read_channel_status (struct uart_port *port)
drivers/video/fbdev/core/fbcon.c +10 -10
@@ -178,4 +178,4 @@ static void fbcon_set_palette(struct vc_data *vc, const unsigned char *table); -static __inline__void ywrap_up (struct vc_data *vc,int count); -static __inline__void ywrap_down (struct vc_data *vc,int count); -static __inline__void ypan_up (struct vc_data *vc,int count); -static __inline__void ypan_down (struct vc_data *vc,int count); +static inline void ywrap_up (struct vc_data *vc,int count); +static inline void ywrap_down (struct vc_data *vc,int count); +static inline void ypan_up (struct vc_data *vc,int count); +static inline void ypan_down (struct vc_data *vc,int count);
@@ -1430 +1430 @@ static void fbcon_set_disp(struct fb_info *info, struct fb_var_screeninfo *var, -static __inline__void ywrap_up (struct vc_data *vc,int count) +static inline void ywrap_up (struct vc_data *vc,int count)
@@ -1449 +1449 @@ static __inline__ void ywrap_up(struct vc_data *vc, int count) -static __inline__void ywrap_down (struct vc_data *vc,int count) +static inline void ywrap_down (struct vc_data *vc,int count)
@@ -1468 +1468 @@ static __inline__ void ywrap_down(struct vc_data *vc, int count) -static __inline__void ypan_up (struct vc_data *vc,int count) +static inline void ypan_up (struct vc_data *vc,int count)
@@ -1492 +1492 @@ static __inline__ void ypan_up(struct vc_data *vc, int count) -static __inline__void ypan_up_redraw (struct vc_data *vc,int t,int count) +static inline void ypan_up_redraw (struct vc_data *vc,int t,int count)
@@ -1516 +1516 @@ static __inline__ void ypan_up_redraw(struct vc_data *vc, int t, int count) -static __inline__void ypan_down (struct vc_data *vc,int count) +static inline void ypan_down (struct vc_data *vc,int count)
@@ -1540 +1540 @@ static __inline__ void ypan_down(struct vc_data *vc, int count) -static __inline__void ypan_down_redraw (struct vc_data *vc,int t,int count) +static inline void ypan_down_redraw (struct vc_data *vc,int t,int count)
drivers/video/fbdev/ffb.c +1 -1
@@ -414 +414 @@ static int ffb_sync(struct fb_info *p) -static __inline__void ffb_rop (struct ffb_par *par,u32 rop) +static inline void ffb_rop (struct ffb_par *par,u32 rop)
drivers/video/fbdev/intelfb/intelfbdrv.c +5 -5
@@ -273 +273 @@ MODULE_PARM_DESC(mode, -static __inline__char *get_opt_string (const char *this_opt,const char *name) +static inline char *get_opt_string (const char *this_opt,const char *name)
@@ -291 +291 @@ static __inline__ char * get_opt_string(const char *this_opt, const char *name) -static __inline__ int get_opt_int(const char *this_opt, const char *name, +static inline int get_opt_int(const char *this_opt, const char *name,
@@ -304 +304 @@ static __inline__ int get_opt_int(const char *this_opt, const char *name, -static __inline__ int get_opt_bool(const char *this_opt, const char *name, +static inline int get_opt_bool(const char *this_opt, const char *name,
@@ -910 +910 @@ static void intelfb_pci_unregister(struct pci_dev *pdev) -__inline__int intelfb_var_to_depth (const struct fb_var_screeninfo *var) +inline int intelfb_var_to_depth (const struct fb_var_screeninfo *var)
@@ -926 +926 @@ __inline__ int intelfb_var_to_depth(const struct fb_var_screeninfo *var) -static __inline__int var_to_refresh (const struct fb_var_screeninfo *var) +static inline int var_to_refresh (const struct fb_var_screeninfo *var)
drivers/video/fbdev/intelfb/intelfbhw.c +1 -1
@@ -1028 +1028 @@ static int calc_pll_params(int index, int clock, u32 *retm1, u32 *retm2, -static __inline__ int check_overflow(u32 value, u32 limit, +static inline int check_overflow(u32 value, u32 limit,
drivers/w1/masters/matrox_w1.c +2 -2
@@ -81 +81 @@ struct matrox_device -static __inline__u8 matrox_w1_read_reg (struct matrox_device *dev,u8 reg) +static inline u8 matrox_w1_read_reg (struct matrox_device *dev,u8 reg)
@@ -92 +92 @@ static __inline__ u8 matrox_w1_read_reg(struct matrox_device *dev, u8 reg) -static __inline__void matrox_w1_write_reg (struct matrox_device *dev,u8 reg,u8 val) +static inline void matrox_w1_write_reg (struct matrox_device *dev,u8 reg,u8 val)
fs/coda/coda_linux.h +3 -3
@@ -85 +85 @@ static inline struct coda_inode_info *ITOC(struct inode *inode) -static __inline__struct CodaFid *coda_i2f (struct inode *inode) +static inline struct CodaFid *coda_i2f (struct inode *inode)
@@ -90 +90 @@ static __inline__ struct CodaFid *coda_i2f(struct inode *inode) -static __inline__char *coda_i2s (struct inode *inode) +static inline char *coda_i2s (struct inode *inode)
@@ -96 +96 @@ static __inline__ char *coda_i2s(struct inode *inode) -static __inline__void coda_flag_inode (struct inode *inode,int flag) +static inline void coda_flag_inode (struct inode *inode,int flag)
fs/freevxfs/vxfs_inode.c +1 -1
@@ -77 +77 @@ vxfs_dumpi(struct vxfs_inode_info *vip, ino_t ino) -static __inline__ umode_t +static inline umode_t
fs/nfsd/nfsfh.h +2 -2
@@ -169 +169 @@ void fh_put(struct svc_fh *); -static __inline__ struct svc_fh * +static inline struct svc_fh *
@@ -185 +185 @@ fh_copy_shallow(struct knfsd_fh *dst, struct knfsd_fh *src) -static __inline__ struct svc_fh * +static inline struct svc_fh *
include/acpi/platform/acgcc.h +1 -1
@@ -29 +29 @@ typedef __builtin_va_list va_list; -#define ACPI_INLINE __inline__ +#define ACPI_INLINE inline
include/asm-generic/ide_iops.h +4 -4
@@ -9 +9 @@ -static __inline__void __ide_mm_insw (void __iomem *port,void *addr,u32 count) +static inline void __ide_mm_insw (void __iomem *port,void *addr,u32 count)
@@ -17 +17 @@ static __inline__ void __ide_mm_insw(void __iomem *port, void *addr, u32 count) -static __inline__void __ide_mm_insl (void __iomem *port,void *addr,u32 count) +static inline void __ide_mm_insl (void __iomem *port,void *addr,u32 count)
@@ -25 +25 @@ static __inline__ void __ide_mm_insl(void __iomem *port, void *addr, u32 count) -static __inline__void __ide_mm_outsw (void __iomem *port,void *addr,u32 count) +static inline void __ide_mm_outsw (void __iomem *port,void *addr,u32 count)
@@ -33 +33 @@ static __inline__ void __ide_mm_outsw(void __iomem *port, void *addr, u32 count) -static __inline__void __ide_mm_outsl (void __iomem * port,void *addr,u32 count) +static inline void __ide_mm_outsl (void __iomem * port,void *addr,u32 count)
include/drm/drmP.h +2 -2
@@ -126 +126 @@ static inline bool drm_drv_uses_atomic_modeset(struct drm_device *dev) -static __inline__ int drm_core_check_feature(struct drm_device *dev, +static inline int drm_core_check_feature(struct drm_device *dev,
@@ -146 +146 @@ static __inline__ int drm_core_check_feature(struct drm_device *dev, -static __inline__bool drm_can_sleep (void ) +static inline bool drm_can_sleep (void )
include/drm/drm_legacy.h +1 -1
@@ -197 +197 @@ void drm_legacy_ioremapfree(struct drm_local_map *map, struct drm_device *dev); -static __inline__ struct drm_local_map *drm_legacy_findmap(struct drm_device *dev, +static inline struct drm_local_map *drm_legacy_findmap(struct drm_device *dev,
include/linux/atalk.h +2 -2
@@ -63 +63 @@ struct ddpehdr { -static __inline__struct ddpehdr *ddp_hdr (struct sk_buff *skb) +static inline struct ddpehdr *ddp_hdr (struct sk_buff *skb)
@@ -91 +91 @@ struct elapaarp { -static __inline__struct elapaarp *aarp_hdr (struct sk_buff *skb) +static inline struct elapaarp *aarp_hdr (struct sk_buff *skb)
include/linux/ceph/messenger.h +1 -1
@@ -82 +82 @@ enum ceph_msg_data_type { -static __inline__bool ceph_msg_data_type_valid (enum ceph_msg_data_type type) +static inline bool ceph_msg_data_type_valid (enum ceph_msg_data_type type)
include/linux/hdlc.h +2 -2
@@ -77 +77 @@ static inline struct hdlc_device* dev_to_hdlc(struct net_device *dev) -static __inline__void debug_frame (const struct sk_buff *skb) +static inline void debug_frame (const struct sk_buff *skb)
@@ -104 +104 @@ int detach_hdlc_protocol(struct net_device *dev); -static __inline__ __be16 hdlc_type_trans(struct sk_buff *skb, +static inline __be16 hdlc_type_trans(struct sk_buff *skb,
include/linux/inetdevice.h +4 -4
@@ -185 +185 @@ struct in_ifaddr *inet_lookup_ifaddr_rcu(struct net *net, __be32 addr); -static __inline__bool inet_ifa_match (__be32 addr,struct in_ifaddr *ifa) +static inline bool inet_ifa_match (__be32 addr,struct in_ifaddr *ifa)
@@ -194 +194 @@ static __inline__ bool inet_ifa_match(__be32 addr, struct in_ifaddr *ifa) -static __inline__bool bad_mask (__be32 mask,__be32 addr) +static inline bool bad_mask (__be32 mask,__be32 addr)
@@ -256 +256 @@ static inline void in_dev_put(struct in_device *idev) -static __inline____be32 inet_make_mask (int logmask) +static inline __be32 inet_make_mask (int logmask)
@@ -263 +263 @@ static __inline__ __be32 inet_make_mask(int logmask) -static __inline__int inet_mask_len (__be32 mask) +static inline int inet_mask_len (__be32 mask)
include/linux/parport.h +2 -2
@@ -388 +388 @@ extern void parport_release(struct pardevice *dev); -static __inline__int parport_yield (struct pardevice *dev) +static inline int parport_yield (struct pardevice *dev)
@@ -406 +406 @@ static __inline__ int parport_yield(struct pardevice *dev) -static __inline__int parport_yield_blocking (struct pardevice *dev) +static inline int parport_yield_blocking (struct pardevice *dev)
include/linux/parport_pc.h +11 -11
@@ -63 +63 @@ struct parport_pc_via_data -static __inline__void parport_pc_write_data (struct parport *p,unsigned char d) +static inline void parport_pc_write_data (struct parport *p,unsigned char d)
@@ -71 +71 @@ static __inline__ void parport_pc_write_data(struct parport *p, unsigned char d) -static __inline__unsigned char parport_pc_read_data (struct parport *p) +static inline unsigned char parport_pc_read_data (struct parport *p)
@@ -128 +128 @@ static inline void dump_parport_state (char *str, struct parport *p) -static __inline__ unsigned char __parport_pc_frob_control (struct parport *p, +static inline unsigned char __parport_pc_frob_control (struct parport *p,
@@ -146 +146 @@ static __inline__ unsigned char __parport_pc_frob_control (struct parport *p, -static __inline__void parport_pc_data_reverse (struct parport *p) +static inline void parport_pc_data_reverse (struct parport *p)
@@ -151 +151 @@ static __inline__ void parport_pc_data_reverse (struct parport *p) -static __inline__void parport_pc_data_forward (struct parport *p) +static inline void parport_pc_data_forward (struct parport *p)
@@ -156 +156 @@ static __inline__ void parport_pc_data_forward (struct parport *p) -static __inline__ void parport_pc_write_control (struct parport *p, +static inline void parport_pc_write_control (struct parport *p,
@@ -174 +174 @@ static __inline__ void parport_pc_write_control (struct parport *p, -static __inline__unsigned char parport_pc_read_control (struct parport *p) +static inline unsigned char parport_pc_read_control (struct parport *p)
@@ -184 +184 @@ static __inline__ unsigned char parport_pc_read_control(struct parport *p) -static __inline__ unsigned char parport_pc_frob_control (struct parport *p, +static inline unsigned char parport_pc_frob_control (struct parport *p,
@@ -211 +211 @@ static __inline__ unsigned char parport_pc_frob_control (struct parport *p, -static __inline__unsigned char parport_pc_read_status (struct parport *p) +static inline unsigned char parport_pc_read_status (struct parport *p)
@@ -217 +217 @@ static __inline__ unsigned char parport_pc_read_status(struct parport *p) -static __inline__void parport_pc_disable_irq (struct parport *p) +static inline void parport_pc_disable_irq (struct parport *p)
@@ -222 +222 @@ static __inline__ void parport_pc_disable_irq(struct parport *p) -static __inline__void parport_pc_enable_irq (struct parport *p) +static inline void parport_pc_enable_irq (struct parport *p)
include/net/ax25.h +1 -1
@@ -273 +273 @@ static inline struct ax25_cb *sk_to_ax25(const struct sock *sk) -static __inline__void ax25_cb_put (ax25_cb *ax25) +static inline void ax25_cb_put (ax25_cb *ax25)
include/net/checksum.h +1 -1
@@ -44 +44 @@ __wsum csum_and_copy_from_user (const void __user *src, void *dst, -static __inline____wsum csum_and_copy_to_user +static inline __wsum csum_and_copy_to_user
include/net/dn_nsp.h +8 -8
@@ -147 +147 @@ struct srcobj_fmt { -static __inline__int dn_before (__u16 seq1,__u16 seq2) +static inline int dn_before (__u16 seq1,__u16 seq2)
@@ -156 +156 @@ static __inline__ int dn_before(__u16 seq1, __u16 seq2) -static __inline__int dn_after (__u16 seq1,__u16 seq2) +static inline int dn_after (__u16 seq1,__u16 seq2)
@@ -164 +164 @@ static __inline__ int dn_after(__u16 seq1, __u16 seq2) -static __inline__int dn_equal (__u16 seq1,__u16 seq2) +static inline int dn_equal (__u16 seq1,__u16 seq2)
@@ -169 +169 @@ static __inline__ int dn_equal(__u16 seq1, __u16 seq2) -static __inline__int dn_before_or_equal (__u16 seq1,__u16 seq2) +static inline int dn_before_or_equal (__u16 seq1,__u16 seq2)
@@ -174 +174 @@ static __inline__ int dn_before_or_equal(__u16 seq1, __u16 seq2) -static __inline__void seq_add (__u16 *seq,__u16 off) +static inline void seq_add (__u16 *seq,__u16 off)
@@ -180 +180 @@ static __inline__ void seq_add(__u16 *seq, __u16 off) -static __inline__int seq_next (__u16 seq1,__u16 seq2) +static inline int seq_next (__u16 seq1,__u16 seq2)
@@ -188 +188 @@ static __inline__ int seq_next(__u16 seq1, __u16 seq2) -static __inline__int sendack (__u16 seq) +static inline int sendack (__u16 seq)
@@ -196 +196 @@ static __inline__ int sendack(__u16 seq) -static __inline__int dn_congested (struct sock *sk) +static inline int dn_congested (struct sock *sk)
include/net/ip.h +1 -1
@@ -523 +523 @@ static inline void ip_ipgre_mc_map(__be32 naddr, const unsigned char *broadcast, -static __inline__void inet_reset_saddr (struct sock *sk) +static inline void inet_reset_saddr (struct sock *sk)
include/net/ip6_checksum.h +1 -1
@@ -58 +58 @@ static inline __wsum ip6_gro_compute_pseudo(struct sk_buff *skb, int proto) -static __inline__ __sum16 tcp_v6_check(int len, +static inline __sum16 tcp_v6_check(int len,
include/net/ipx.h +5 -5
@@ -50 +50 @@ extern int sysctl_ipx_pprop_broadcasting; -static __inline__struct ipxhdr *ipx_hdr (struct sk_buff *skb) +static inline struct ipxhdr *ipx_hdr (struct sk_buff *skb)
@@ -142 +142 @@ const char *ipx_device_name(struct ipx_interface *intrfc); -static __inline__void ipxitf_hold (struct ipx_interface *intrfc) +static inline void ipxitf_hold (struct ipx_interface *intrfc)
@@ -160 +160 @@ int ipxrtr_ioctl(unsigned int cmd, void __user *arg); -static __inline__void ipxitf_put (struct ipx_interface *intrfc) +static inline void ipxitf_put (struct ipx_interface *intrfc)
@@ -166 +166 @@ static __inline__ void ipxitf_put(struct ipx_interface *intrfc) -static __inline__void ipxrtr_hold (struct ipx_route *rt) +static inline void ipxrtr_hold (struct ipx_route *rt)
@@ -171 +171 @@ static __inline__ void ipxrtr_hold(struct ipx_route *rt) -static __inline__void ipxrtr_put (struct ipx_route *rt) +static inline void ipxrtr_put (struct ipx_route *rt)
include/net/llc_c_ev.h +2 -2
@@ -123 +123 @@ struct llc_conn_state_ev { -static __inline__struct llc_conn_state_ev *llc_conn_ev (struct sk_buff *skb) +static inline struct llc_conn_state_ev *llc_conn_ev (struct sk_buff *skb)
@@ -219 +219 @@ int llc_conn_ev_qlfy_set_status_rst_done(struct sock *sk, struct sk_buff *skb); -static __inline__int llc_conn_space (struct sock *sk,struct sk_buff *skb) +static inline int llc_conn_space (struct sock *sk,struct sk_buff *skb)
include/net/llc_conn.h +2 -2
@@ -88 +88 @@ static inline struct llc_sock *llc_sk(const struct sock *sk) -static __inline__void llc_set_backlog_type (struct sk_buff *skb,char type) +static inline void llc_set_backlog_type (struct sk_buff *skb,char type)
@@ -93 +93 @@ static __inline__ void llc_set_backlog_type(struct sk_buff *skb, char type) -static __inline__char llc_backlog_type (struct sk_buff *skb) +static inline char llc_backlog_type (struct sk_buff *skb)
include/net/llc_s_ev.h +1 -1
@@ -47 +47 @@ struct llc_sap_state_ev { -static __inline__struct llc_sap_state_ev *llc_sap_ev (struct sk_buff *skb) +static inline struct llc_sap_state_ev *llc_sap_ev (struct sk_buff *skb)
include/net/netrom.h +4 -4
@@ -126 +126 @@ struct nr_node { -static __inline__void nr_node_put (struct nr_node *nr_node) +static inline void nr_node_put (struct nr_node *nr_node)
@@ -136 +136 @@ static __inline__ void nr_node_put(struct nr_node *nr_node) -static __inline__void nr_neigh_put (struct nr_neigh *nr_neigh) +static inline void nr_neigh_put (struct nr_neigh *nr_neigh)
@@ -148 +148 @@ static __inline__ void nr_neigh_put(struct nr_neigh *nr_neigh) -static __inline__void nr_node_lock (struct nr_node *nr_node) +static inline void nr_node_lock (struct nr_node *nr_node)
@@ -154 +154 @@ static __inline__ void nr_node_lock(struct nr_node *nr_node) -static __inline__void nr_node_unlock (struct nr_node *nr_node) +static inline void nr_node_unlock (struct nr_node *nr_node)
include/net/scm.h +7 -7
@@ -46 +46 @@ struct scm_fp_list *scm_fp_dup(struct scm_fp_list *fpl); -static __inline__void unix_get_peersec_dgram (struct socket *sock,struct scm_cookie *scm) +static inline void unix_get_peersec_dgram (struct socket *sock,struct scm_cookie *scm)
@@ -51 +51 @@ static __inline__ void unix_get_peersec_dgram(struct socket *sock, struct scm_co -static __inline__void unix_get_peersec_dgram (struct socket *sock,struct scm_cookie *scm) +static inline void unix_get_peersec_dgram (struct socket *sock,struct scm_cookie *scm)
@@ -55 +55 @@ static __inline__ void unix_get_peersec_dgram(struct socket *sock, struct scm_co -static __inline__ void scm_set_cred(struct scm_cookie *scm, +static inline void scm_set_cred(struct scm_cookie *scm,
@@ -64 +64 @@ static __inline__ void scm_set_cred(struct scm_cookie *scm, -static __inline__void scm_destroy_cred (struct scm_cookie *scm) +static inline void scm_destroy_cred (struct scm_cookie *scm)
@@ -70 +70 @@ static __inline__ void scm_destroy_cred(struct scm_cookie *scm) -static __inline__void scm_destroy (struct scm_cookie *scm) +static inline void scm_destroy (struct scm_cookie *scm)
@@ -77 +77 @@ static __inline__ void scm_destroy(struct scm_cookie *scm) -static __inline__ int scm_send(struct socket *sock, struct msghdr *msg, +static inline int scm_send(struct socket *sock, struct msghdr *msg,
@@ -112 +112 @@ static inline void scm_passec(struct socket *sock, struct msghdr *msg, struct sc -static __inline__ void scm_recv(struct socket *sock, struct msghdr *msg, +static inline void scm_recv(struct socket *sock, struct msghdr *msg,
include/net/udplite.h +1 -1
@@ -20 +20 @@ extern struct udp_table udplite_table; -static __inline__ int udplite_getfrag(void *from, char *to, int offset, +static inline int udplite_getfrag(void *from, char *to, int offset,
include/net/x25.h +4 -4
@@ -245 +245 @@ void x25_link_free(void); -static __inline__void x25_neigh_hold (struct x25_neigh *nb) +static inline void x25_neigh_hold (struct x25_neigh *nb)
@@ -250 +250 @@ static __inline__ void x25_neigh_hold(struct x25_neigh *nb) -static __inline__void x25_neigh_put (struct x25_neigh *nb) +static inline void x25_neigh_put (struct x25_neigh *nb)
@@ -268 +268 @@ void x25_route_free(void); -static __inline__void x25_route_hold (struct x25_route *rt) +static inline void x25_route_hold (struct x25_route *rt)
@@ -273 +273 @@ static __inline__ void x25_route_hold(struct x25_route *rt) -static __inline__void x25_route_put (struct x25_route *rt) +static inline void x25_route_put (struct x25_route *rt)
include/net/xfrm.h +9 -9
@@ -897 +897 @@ static inline bool addr4_match(__be32 a1, __be32 a2, u8 prefixlen) -static __inline__ +static inline
@@ -924 +924 @@ __be16 xfrm_flowi_sport(const struct flowi *fl, const union flowi_uli *uli) -static __inline__ +static inline
@@ -1303 +1303 @@ static inline int xfrm6_policy_check_reverse(struct sock *sk, int dir, -static __inline__ +static inline
@@ -1315 +1315 @@ xfrm_address_t *xfrm_flowi_daddr(const struct flowi *fl, unsigned short family) -static __inline__ +static inline
@@ -1327 +1327 @@ xfrm_address_t *xfrm_flowi_saddr(const struct flowi *fl, unsigned short family) -static __inline__ +static inline
@@ -1344 +1344 @@ void xfrm_flowi_addr_get(const struct flowi *fl, -static __inline__ int +static inline int
@@ -1354 +1354 @@ __xfrm4_state_addr_check(const struct xfrm_state *x, -static __inline__ int +static inline int
@@ -1366 +1366 @@ __xfrm6_state_addr_check(const struct xfrm_state *x, -static __inline__ int +static inline int
@@ -1380 +1380 @@ xfrm_state_addr_check(const struct xfrm_state *x, -static __inline__ int +static inline int
include/video/newport.h +6 -6
@@ -429 +429 @@ static inline unsigned short newport_vc2_get(struct newport_regs *regs, -static __inline__ void newport_cmap_setaddr(struct newport_regs *regs, +static inline void newport_cmap_setaddr(struct newport_regs *regs,
@@ -440 +440 @@ static __inline__ void newport_cmap_setaddr(struct newport_regs *regs, -static __inline__ void newport_cmap_setrgb(struct newport_regs *regs, +static inline void newport_cmap_setrgb(struct newport_regs *regs,
@@ -453 +453 @@ static __inline__ void newport_cmap_setrgb(struct newport_regs *regs, -static __inline__int newport_wait (struct newport_regs *regs) +static inline int newport_wait (struct newport_regs *regs)
@@ -463 +463 @@ static __inline__ int newport_wait(struct newport_regs *regs) -static __inline__int newport_bfwait (struct newport_regs *regs) +static inline int newport_bfwait (struct newport_regs *regs)
@@ -550 +550 @@ static __inline__ int newport_bfwait(struct newport_regs *regs) -static __inline__ void +static inline void
@@ -561 +561 @@ xmap9FIFOWait (struct newport_regs *rex) -static __inline__ void +static inline void
net/appletalk/atalk_proc.c +2 -2
@@ -20 +20 @@ -static __inline__struct atalk_iface *atalk_get_interface_idx (loff_t pos) +static inline struct atalk_iface *atalk_get_interface_idx (loff_t pos)
@@ -81 +81 @@ static int atalk_seq_interface_show(struct seq_file *seq, void *v) -static __inline__struct atalk_route *atalk_get_route_idx (loff_t pos) +static inline struct atalk_route *atalk_get_route_idx (loff_t pos)
net/appletalk/ddp.c +1 -1
@@ -1280 +1280 @@ static int atalk_getname(struct socket *sock, struct sockaddr *uaddr, -static __inline__int is_ip_over_ddp (struct sk_buff *skb) +static inline int is_ip_over_ddp (struct sk_buff *skb)
net/core/neighbour.c +1 -1
@@ -865 +865 @@ static void neigh_periodic_work(struct work_struct *work) -static __inline__int neigh_max_probes (struct neighbour *n) +static inline int neigh_max_probes (struct neighbour *n)
net/core/scm.c +1 -1
@@ -48 +48 @@ -static __inline__int scm_check_creds (struct ucred *creds) +static inline int scm_check_creds (struct ucred *creds)
net/decnet/dn_nsp_in.c +1 -1
@@ -585 +585 @@ static void dn_nsp_linkservice(struct sock *sk, struct sk_buff *skb) -static __inline__int dn_queue_skb (struct sock *sk,struct sk_buff *skb,int sig,struct sk_buff_head *queue) +static inline int dn_queue_skb (struct sock *sk,struct sk_buff *skb,int sig,struct sk_buff_head *queue)
net/decnet/dn_nsp_out.c +1 -1
@@ -532 +532 @@ void dn_send_conn_conf(struct sock *sk, gfp_t gfp) -static __inline__ void dn_nsp_do_disc(struct sock *sk, unsigned char msgflg, +static inline void dn_nsp_do_disc(struct sock *sk, unsigned char msgflg,
net/decnet/dn_route.c +1 -1
@@ -177 +177 @@ static void dn_dst_ifdown(struct dst_entry *dst, struct net_device *dev, int how -static __inline__unsigned int dn_hash (__le16 src,__le16 dst) +static inline unsigned int dn_hash (__le16 src,__le16 dst)
net/decnet/dn_table.c +2 -2
@@ -408 +408 @@ static void dn_rtmsg_fib(int event, struct dn_fib_node *f, int z, u32 tb_id, -static __inline__ int dn_hash_dump_bucket(struct sk_buff *skb, +static inline int dn_hash_dump_bucket(struct sk_buff *skb,
@@ -437 +437 @@ static __inline__ int dn_hash_dump_bucket(struct sk_buff *skb, -static __inline__ int dn_hash_dump_zone(struct sk_buff *skb, +static inline int dn_hash_dump_zone(struct sk_buff *skb,
net/ipv4/igmp.c +1 -1
@@ -21 +21 @@ -* Alan Cox : Added lots of __inline__ to optimise +* Alan Cox : Added lots of inline to optimise
net/ipv6/af_inet6.c +1 -1
@@ -103 +103 @@ EXPORT_SYMBOL_GPL(ipv6_mod_enabled); -static __inline__struct ipv6_pinfo *inet6_sk_generic (struct sock *sk) +static inline struct ipv6_pinfo *inet6_sk_generic (struct sock *sk)
net/ipv6/icmp.c +2 -2
@@ -114 +114 @@ static const struct inet6_protocol icmpv6_protocol = { -static __inline__struct sock *icmpv6_xmit_lock (struct net *net) +static inline struct sock *icmpv6_xmit_lock (struct net *net)
@@ -129 +129 @@ static __inline__ struct sock *icmpv6_xmit_lock(struct net *net) -static __inline__void icmpv6_xmit_unlock (struct sock *sk) +static inline void icmpv6_xmit_unlock (struct sock *sk)
net/ipv6/udp.c +2 -2
@@ -542 +542 @@ static int __udpv6_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) -static __inline__ void udpv6_err(struct sk_buff *skb, +static inline void udpv6_err(struct sk_buff *skb,
@@ -939 +939 @@ static void udp_v6_early_demux(struct sk_buff *skb) -static __inline__int udpv6_rcv (struct sk_buff *skb) +static inline int udpv6_rcv (struct sk_buff *skb)
net/lapb/lapb_iface.c +2 -2
@@ -55 +55 @@ static void lapb_free_cb(struct lapb_cb *lapb) -static __inline__void lapb_hold (struct lapb_cb *lapb) +static inline void lapb_hold (struct lapb_cb *lapb)
@@ -60 +60 @@ static __inline__ void lapb_hold(struct lapb_cb *lapb) -static __inline__void lapb_put (struct lapb_cb *lapb) +static inline void lapb_put (struct lapb_cb *lapb)
net/llc/llc_input.c +1 -1
@@ -75 +75 @@ void llc_set_station_handler(void (*handler)(struct sk_buff *skb)) -static __inline__int llc_pdu_type (struct sk_buff *skb) +static inline int llc_pdu_type (struct sk_buff *skb)
sound/sparc/amd7930.c +3 -3
@@ -347 +347 @@ static struct snd_amd7930 *amd7930_list; -static __inline__void amd7930_idle (struct snd_amd7930 *amd) +static inline void amd7930_idle (struct snd_amd7930 *amd)
@@ -358 +358 @@ static __inline__ void amd7930_idle(struct snd_amd7930 *amd) -static __inline__void amd7930_enable_ints (struct snd_amd7930 *amd) +static inline void amd7930_enable_ints (struct snd_amd7930 *amd)
@@ -369 +369 @@ static __inline__ void amd7930_enable_ints(struct snd_amd7930 *amd) -static __inline__void amd7930_disable_ints (struct snd_amd7930 *amd) +static inline void amd7930_disable_ints (struct snd_amd7930 *amd)
_______________________________________________
Virtualization mailing list [email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Re: [PATCH v2 1/2] compiler-gcc.h: add gnu_inline to all inline declarations
In reply to Joe PerchesQuoted 9 lines · Joe Perches
On Tue, 2018-06-05 at 10:05 -0700, Nick Desaulniers wrote:
And only set once along with:Quoted 1 line
#define
__always_inlineinline __attribute__((always_inline))And perhaps this
__always_inlineshould be updated withgnu_inlineas well
This should pick up the additional attributes from adding inline to the redefinition.
Attributes can be combined via:
__attribute__((a)) __attribute__((b))
or
__attribute__((a, b))
Signature · 2 lines
Thanks, ~Nick Desaulniers
Re: [PATCH v2 1/2] compiler-gcc.h: add gnu_inline to all inline declarations
In reply to Nick DesaulniersQuoted 9 lines · Nick Desaulniers
Functions marked extern inline do not emit an externally visible function when the gnu89 C standard is used. Some KBUILD Makefiles overwrite
KBUILD_CFLAGS. This is an issue for GCC 5.1+ users as without an explicit C standard specified, the default is gnu11. Since c99, the semantics of extern inline have changed such that an externally visible function is always emitted. This can lead to multiple definition errors of extern inline functions at link time of compilation units whose build files have removed an explicit C standard compiler flag for users of GCC 5.1+ or Clang.
[]
include/linux/compiler-gcc.h
Quoted 1 line
include/linux/compiler-gcc.h +0
-0
[]
Quoted 10 lines
include/linux/compiler-gcc.h +4
-0@@ -72,17 +72,24 @@* -Wunused-function. This turns out to avoid the need for complex #ifdef * directives. Suppress the warning in clang as well by using "unused" * function attribute, which is redundant but not harmful for gcc. +* Prefer gnu_inline, so that extern inline functions do not emit an +* externally visible function. This makes extern inline behave as per gnu89 +* semantics rather than c99. This prevents multiple symbol definition errors +* of extern inline functions at link time. */ #if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \
include/linux/compiler-gcc.h line 87
Quoted 10 lines
include/linux/compiler-gcc.h +6
-3!defined(CONFIG_OPTIMIZE_INLINING) || (__GNUC__ < 4) -#define inline inline __attribute__((always_inline,unused)) notrace -#define __inline__ __inline__ __attribute__((always_inline,unused)) notrace -#define __inline __inline __attribute__((always_inline,unused)) notrace +#define inline \ + inline __attribute__((always_inline, unused, gnu_inline)) notrace +#define __inline__ \ + __inline__ __attribute__((always_inline, unused, gnu_inline)) notrace +#define __inline \ + __inline __attribute__((always_inline, unused, gnu_inline)) notrace
Perhaps these are simpler as
#define __inline__ inline
#define __inline inline
include/linux/compiler-gcc.h line 93
Quoted 9 lines
include/linux/compiler-gcc.h +3
-3#else /* A lot of inline functions can cause havoc with function tracing */ -#define inline inline __attribute__((unused)) notrace -#define __inline__ __inline__ __attribute__((unused)) notrace -#define __inline __inline __attribute__((unused)) notrace +#define inline inline __attribute__((unused, gnu_inline)) notrace +#define __inline__ __inline__ __attribute__((unused, gnu_inline)) notrace +#define __inline __inline __attribute__((unused, gnu_inline)) notrace#endif
And only set once along with:
include/linux/compiler-gcc.h line 95
Quoted 1 line
include/linux/compiler-gcc.h +0
-0#define __always_inline inline __attribute__((always_inline))
And perhaps this __always_inline should be updated with gnu_inline as well
PATCH v2 2/2 x86: paravirt: make native_save_fl extern inline
In reply to Nick Desaulniersnative_save_fl() is marked static inline, but by using it as a function pointer in arch/x86/kernel/paravirt.c, it MUST be outlined.
paravirt's use of native_save_fl() also requires that no GPRs other than %rax are clobbered.
Compilers have different heuristics which they use to emit stack guard code, the emittance of which can break paravirt's callee saved assumption by clobbering %rcx.
Marking a function definition extern inline means that if this version cannot be inlined, then the out-of-line version will be preferred. By having the out-of-line version be implemented in assembly, it cannot be instrumented with a stack protector, which might violate custom calling conventions that code like paravirt rely on.
The semantics of extern inline has changed since gnu89. This means that folks using GCC versions >= 5.1 may see symbol redefinition errors at link time for subdirs that override KBUILD_CFLAGS (making the C standard used implicit) regardless of this patch. This has been cleaned up earlier in the patch set, but is left as a note in the commit message for future travelers.
Reports:
https://lkml.org/lkml/2018/5/7/534
https://github.com/ClangBuiltLinux/linux/issues/16
Discussion:
https://bugs.llvm.org/show_bug.cgi?id=37512
https://lkml.org/lkml/2018/5/24/1371
Thanks to the many folks that participated in the discussion.
---
No changes in v2, but here's the discussion of v1:
https://patchwork.kernel.org/patch/10444075/
arch/x86/include/asm/irqflags.h | 2 +- arch/x86/kernel/Makefile | 1 + arch/x86/kernel/irqflags.S | 26 ++++++++++++++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 arch/x86/kernel/irqflags.S
arch/x86/include/asm/irqflags.h +1 -1
@@ -13,7 +13,7 @@* Interrupt control: */ -static inline unsigned long native_save_fl (void ) +extern inline unsigned long native_save_fl (void ) {unsigned long flags;
arch/x86/kernel/Makefile +1 -0
@@ -61,6 +61,7 @@ obj-y += alternative.o i8253.o hw_breakpoint.o obj-y += tsc.o tsc_msr.o io_delay.o rtc.o obj-y += pci-iommu_table.o obj-y += resource.o +obj-y += irqflags.o obj-y += process.o obj-y += fpu/
arch/x86/kernel/irqflags.S new file +26 -0
@@ -0,0 +1,26 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +#include <asm/asm.h> +#include <asm/export.h> +#include <linux/linkage.h> + +/* + * unsigned long native_save_fl(void) + */ +ENTRY(native_save_fl) + pushf + pop %_ASM_AX + ret +ENDPROC(native_save_fl) +EXPORT_SYMBOL(native_save_fl) + +/* + * void native_restore_fl(unsigned long flags) + * %rdi: flags + */ +ENTRY(native_restore_fl) + push %_ASM_DI + popf + ret +ENDPROC(native_restore_fl) +EXPORT_SYMBOL(native_restore_fl)
Signature · 1 line
2.17.1.1185.g55be947832-goog
H. Peter Anvin
reviewerRe: [PATCH v2 2/2] x86: paravirt: make native_save_fl extern inline
Review
Quoted 12 lines · Nick Desaulniers
(quoted diff) +11
-0+ +/* + * void native_restore_fl(unsigned long flags) + * %rdi: flags + */ +ENTRY(native_restore_fl) + push %_ASM_DI + popf + ret +ENDPROC(native_restore_fl) +EXPORT_SYMBOL(native_restore_fl)
To work on i386, this would have to be %_ASM_AX in that case.
Something like this added to <asm/asm.h> might be useful; then you can simply:
push %_ASM_ARG1
Quoted 1 line
From
83a7c1b7167dceee0eb731cf4ae3af7f9b2c05eaMon Sep 17 00:00:00 2001
From: "H. Peter Anvin" <[email protected]>
Date: Tue, 5 Jun 2018 10:21:35 -0700
Subject: [PATCH] x86/asm: add _ASM_ARG* constants for argument registes to
<asm/asm.h>
i386 and x86-64 uses different registers for arguments; make them available so we don't have to #ifdef in the actual code.
Native size and specified size (q, l, w, b) versions are provided.
--- arch/x86/include/asm/asm.h | 59 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+)
arch/x86/include/asm/asm.h +59 -0
@@ -46,6 +46,65 @@#define _ASM_SI __ASM_REG(si)#define _ASM_DI __ASM_REG(di) +#ifndef __x86_64__ +/* 32 bit */ + +#define _ASM_ARG1 _ASM_AX +#define _ASM_ARG2 _ASM_DX +#define _ASM_ARG3 _ASM_CX + +#define _ASM_ARG1L eax +#define _ASM_ARG2L edx +#define _ASM_ARG3L ecx + +#define _ASM_ARG1W ax +#define _ASM_ARG2W dx +#define _ASM_ARG3W cx + +#define _ASM_ARG1B al +#define _ASM_ARG2B dl +#define _ASM_ARG3B cl + +#else +/* 64 bit */ + +#define _ASM_ARG1 _ASM_DI +#define _ASM_ARG2 _ASM_SI +#define _ASM_ARG3 _ASM_DX +#define _ASM_ARG4 _ASM_CX +#define _ASM_ARG5 r8 +#define _ASM_ARG6 r9 + +#define _ASM_ARG1Q rdi +#define _ASM_ARG2Q rsi +#define _ASM_ARG3Q rdx +#define _ASM_ARG4Q rcx +#define _ASM_ARG5Q r8 +#define _ASM_ARG6Q r9 + +#define _ASM_ARG1L edi +#define _ASM_ARG2L esi +#define _ASM_ARG3L edx +#define _ASM_ARG4L ecx +#define _ASM_ARG5L r8d +#define _ASM_ARG6L r9d + +#define _ASM_ARG1W di +#define _ASM_ARG2W di +#define _ASM_ARG3W dx +#define _ASM_ARG4W cx +#define _ASM_ARG5W r8w +#define _ASM_ARG6W r9w + +#define _ASM_ARG1B dil +#define _ASM_ARG2B sil +#define _ASM_ARG3B dl +#define _ASM_ARG4B cl +#define _ASM_ARG5B r8b +#define _ASM_ARG6B r9b + +#endif +/* * Macros to generate condition code outputs from inline assembly, * The output operand must be type "bool".
Signature · 1 line
2.14.4
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
H. Peter Anvin
reviewerRe: [PATCH v2 2/2] x86: paravirt: make native_save_fl extern inline
Quoted 16 lines · H. Peter Anvin
Review
Quoted 12 lines · Nick Desaulniers
(quoted diff) +11
-0+ +/* + * void native_restore_fl(unsigned long flags) + * %rdi: flags + */ +ENTRY(native_restore_fl) + push %_ASM_DI + popf + ret +ENDPROC(native_restore_fl) +EXPORT_SYMBOL(native_restore_fl)To work on i386, this would have to be %_ASM_AX in that case.
Quoted 5 lines
Something like this added to <
asm/asm.h> might be useful; then you can simply:push %_ASM_ARG1
Version with fixed typo...
-hpa
Quoted 1 line
From
9946c03bc6648ea65e6f8e2576c390dca9555288Mon Sep 17 00:00:00 2001
From: "H. Peter Anvin" <[email protected]>
Date: Tue, 5 Jun 2018 10:21:35 -0700
Subject: [PATCH] x86/asm: add _ASM_ARG* constants for argument registes to
<asm/asm.h>
i386 and x86-64 uses different registers for arguments; make them available so we don't have to #ifdef in the actual code.
Native size and specified size (q, l, w, b) versions are provided.
--- arch/x86/include/asm/asm.h | 59 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+)
arch/x86/include/asm/asm.h +59 -0
@@ -46,6 +46,65 @@#define _ASM_SI __ASM_REG(si)#define _ASM_DI __ASM_REG(di) +#ifndef __x86_64__ +/* 32 bit */ + +#define _ASM_ARG1 _ASM_AX +#define _ASM_ARG2 _ASM_DX +#define _ASM_ARG3 _ASM_CX + +#define _ASM_ARG1L eax +#define _ASM_ARG2L edx +#define _ASM_ARG3L ecx + +#define _ASM_ARG1W ax +#define _ASM_ARG2W dx +#define _ASM_ARG3W cx + +#define _ASM_ARG1B al +#define _ASM_ARG2B dl +#define _ASM_ARG3B cl + +#else +/* 64 bit */ + +#define _ASM_ARG1 _ASM_DI +#define _ASM_ARG2 _ASM_SI +#define _ASM_ARG3 _ASM_DX +#define _ASM_ARG4 _ASM_CX +#define _ASM_ARG5 r8 +#define _ASM_ARG6 r9 + +#define _ASM_ARG1Q rdi +#define _ASM_ARG2Q rsi +#define _ASM_ARG3Q rdx +#define _ASM_ARG4Q rcx +#define _ASM_ARG5Q r8 +#define _ASM_ARG6Q r9 + +#define _ASM_ARG1L edi +#define _ASM_ARG2L esi +#define _ASM_ARG3L edx +#define _ASM_ARG4L ecx +#define _ASM_ARG5L r8d +#define _ASM_ARG6L r9d + +#define _ASM_ARG1W di +#define _ASM_ARG2W si +#define _ASM_ARG3W dx +#define _ASM_ARG4W cx +#define _ASM_ARG5W r8w +#define _ASM_ARG6W r9w + +#define _ASM_ARG1B dil +#define _ASM_ARG2B sil +#define _ASM_ARG3B dl +#define _ASM_ARG4B cl +#define _ASM_ARG5B r8b +#define _ASM_ARG6B r9b + +#endif +/* * Macros to generate condition code outputs from inline assembly, * The output operand must be type "bool".
Signature · 1 line
2.14.4
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Re: [PATCH v2 2/2] x86: paravirt: make native_save_fl extern inline
Quoted 17 lines · H. Peter Anvin
Quoted 16 lines · H. Peter Anvin
Review
Quoted 12 lines · Nick Desaulniers
(quoted diff) +11
-0+ +/* + * void native_restore_fl(unsigned long flags) + * %rdi: flags + */ +ENTRY(native_restore_fl) + push %_ASM_DI + popf + ret +ENDPROC(native_restore_fl) +EXPORT_SYMBOL(native_restore_fl)To work on i386, this would have to be %_ASM_AX in that case.
Quoted 7 lines
Quoted 5 lines
Something like this added to <
asm/asm.h> might be useful; then you can simply:push %_ASM_ARG1Version with fixed typo...
Small typo in the commit-subject... s/argument registes/argument registers
- sed@ -
Re: [PATCH v2 2/2] x86: paravirt: make native_save_fl extern inline
In reply to H. Peter AnvinQuoted 15 lines · H. Peter Anvin
Review
Quoted 12 lines · Nick Desaulniers
(quoted diff) +11
-0+ +/* + * void native_restore_fl(unsigned long flags) + * %rdi: flags + */ +ENTRY(native_restore_fl) + push %_ASM_DI + popf + ret +ENDPROC(native_restore_fl) +EXPORT_SYMBOL(native_restore_fl)To work on i386, this would have to be %_ASM_AX in that case.
?
Does the kernel have a different calling convention for 32b x86? How does that work? regparm=3? Does that need to be added to the declaration?
Quoted 6 lines
Something like this added to <
asm/asm.h> might be useful; then you can simply:push %_ASM_ARG1Version with fixed typo...
Oh, nice, thanks! I'll pick this up and add it to my patch set for v3 (or did you want me to review/sign-off now?) I can pick up Sedat's suggestion.
Signature · 2 lines
Thanks, ~Nick Desaulniers
H. Peter Anvin
reviewerRe: [PATCH v2 2/2] x86: paravirt: make native_save_fl extern inline
Quoted 5 lines · Nick Desaulniers
Does the kernel have a different calling convention for 32b x86? How does that work? regparm=3? Does that need to be added to the declaration?
Yes, -mregparm=3. No, doesn't need to be added to the declaration.
Quoted 11 lines
Quoted 6 lines
Something like this added to <
asm/asm.h> might be useful; then you can simply:push %_ASM_ARG1Version with fixed typo...
Oh, nice, thanks! I'll pick this up and add it to my patch set for v3 (or did you want me to review/sign-off now?) I can pick up Sedat's suggestion.
Add it to your patchset and add your own signoff underneath mine.
-hpa
Arnd Bergmann
maintainerRe: [PATCH v2 2/2] x86: paravirt: make native_save_fl extern inline
In reply to Nick DesaulniersQuoted 7 lines · Nick Desaulniers
The semantics of extern inline has changed since gnu89. This means that folks using GCC versions >= 5.1 may see symbol redefinition errors at link time for subdirs that override
KBUILD_CFLAGS(making the C standard used implicit) regardless of this patch. This has been cleaned up earlier in the patch set, but is left as a note in the commit message for future travelers.
I think the keyword you are missing is
__attribute__((gnu_inline))
which forces the gnu89 behavior on all compiler versions. It's been supported since gcc-4.2, so it should not cause problems on any compiler that is able to build an x86 kernel.
Arnd
Arnd Bergmann
maintainerRe: [PATCH v2 2/2] x86: paravirt: make native_save_fl extern inline
Quoted 10 lines · Arnd Bergmann
Quoted 7 lines · Nick Desaulniers
The semantics of extern inline has changed since gnu89. This means that folks using GCC versions >= 5.1 may see symbol redefinition errors at link time for subdirs that override
KBUILD_CFLAGS(making the C standard used implicit) regardless of this patch. This has been cleaned up earlier in the patch set, but is left as a note in the commit message for future travelers.
Quoted 7 lines
I think the keyword you are missing is
__attribute__((gnu_inline))
which forces the gnu89 behavior on all compiler versions. It's been supported since gcc-4.2, so it should not cause problems on any compiler that is able to build an x86 kernel.
Nevermind, I just saw you already posted that.
Arnd
Re: [PATCH v2 2/2] x86: paravirt: make native_save_fl extern inline
Quoted 16 lines · Arnd Bergmann
Quoted 14 lines · Arnd Bergmann
Quoted 7 lines · Nick Desaulniers
The semantics of extern inline has changed since gnu89. This means that folks using GCC versions >= 5.1 may see symbol redefinition errors at link time for subdirs that override
KBUILD_CFLAGS(making the C standard used implicit) regardless of this patch. This has been cleaned up earlier in the patch set, but is left as a note in the commit message for future travelers.I think the keyword you are missing is
__attribute__((gnu_inline))
Quoted 7 lines
Quoted 3 lines
which forces the gnu89 behavior on all compiler versions. It's been supported since gcc-4.2, so it should not cause problems on any compiler that is able to build an x86 kernel.
Nevermind, I just saw you already posted that.
Arnd
That's ok, I appreciate you taking the time to review. Your point made me consider adding the function attribute to just native_save_fl() in this patch, but it seems that that lone function attribute is not used outside of compiler-gcc.h, so it would be good to change all users of inline in one place.
Signature · 2 lines
Thanks, ~Nick Desaulniers
Arnd Bergmann
maintainerRe: [PATCH v2 2/2] x86: paravirt: make native_save_fl extern inline
In reply to Arnd BergmannQuoted 10 lines · Arnd Bergmann
Quoted 7 lines · Nick Desaulniers
The semantics of extern inline has changed since gnu89. This means that folks using GCC versions >= 5.1 may see symbol redefinition errors at link time for subdirs that override
KBUILD_CFLAGS(making the C standard used implicit) regardless of this patch. This has been cleaned up earlier in the patch set, but is left as a note in the commit message for future travelers.
Quoted 7 lines
I think the keyword you are missing is
__attribute__((gnu_inline))
which forces the gnu89 behavior on all compiler versions. It's been supported since gcc-4.2, so it should not cause problems on any compiler that is able to build an x86 kernel.
Nevermind, I just saw you already posted that.
Arnd
Arnd Bergmann
maintainerRe: [PATCH v2 2/2] x86: paravirt: make native_save_fl extern inline
In reply to Nick DesaulniersQuoted 7 lines · Nick Desaulniers
The semantics of extern inline has changed since gnu89. This means that folks using GCC versions >= 5.1 may see symbol redefinition errors at link time for subdirs that override
KBUILD_CFLAGS(making the C standard used implicit) regardless of this patch. This has been cleaned up earlier in the patch set, but is left as a note in the commit message for future travelers.
I think the keyword you are missing is
__attribute__((gnu_inline))
which forces the gnu89 behavior on all compiler versions. It's been supported since gcc-4.2, so it should not cause problems on any compiler that is able to build an x86 kernel.
Arnd