From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA122C3A59F for ; Thu, 29 Aug 2019 16:29:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 88E332339E for ; Thu, 29 Aug 2019 16:29:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727590AbfH2Q3l (ORCPT ); Thu, 29 Aug 2019 12:29:41 -0400 Received: from smtprelay0220.hostedemail.com ([216.40.44.220]:46344 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727046AbfH2Q3l (ORCPT ); Thu, 29 Aug 2019 12:29:41 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay02.hostedemail.com (Postfix) with ESMTP id 085D2AC08; Thu, 29 Aug 2019 16:29:40 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: bun06_1836a53334c20 X-Filterd-Recvd-Size: 4954 Received: from XPS-9350.home (cpe-23-242-196-136.socal.res.rr.com [23.242.196.136]) (Authenticated sender: joe@perches.com) by omf02.hostedemail.com (Postfix) with ESMTPA; Thu, 29 Aug 2019 16:29:25 +0000 (UTC) Message-ID: <4232843e9fe0444c1c975ac6be4cb81a67f9f6ef.camel@perches.com> Subject: Re: [RFC PATCH 1/5] treewide: replace __inline__ by inline From: Joe Perches To: Rasmus Villemoes , x86@kernel.org, linux-kernel@vger.kernel.org Cc: Ingo Molnar , Thomas Gleixner , "H. Peter Anvin" , Nadav Amit , Linus Torvalds , Miguel Ojeda , ndesaulniers@google.com Date: Thu, 29 Aug 2019 09:29:23 -0700 In-Reply-To: <20190829083233.24162-2-linux@rasmusvillemoes.dk> References: <20190829083233.24162-1-linux@rasmusvillemoes.dk> <20190829083233.24162-2-linux@rasmusvillemoes.dk> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.32.1-2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2019-08-29 at 10:32 +0200, Rasmus Villemoes wrote: > Currently, compiler_types.h #defines __inline__ as inline. However, > that defeats the purpose of gcc providing __inline__ as an alternate > spelling of that keyword - namely, that it is always accessible under > that name, even if one chooses to #define inline, which we also do in > order to attach attribute(gnu_inline), and sometimes imply > attribute(always_inline), etc. > > Note that it is quite possible that some header file defines a static > inline function before the include chain has reached compiler_types.h, > but in that case both the existing __inline__ as well as the new > inline spelling refer to gcc's keyword, and the redefinitions in > compiler_types.h have no effect anyway. > > For those static inline definitions that appear after compiler_types.h > has been processed, this is obviously a no-op due to the #define > __inline__ inline. > > We will need to be able to use the __inline__ keyword to make use of > the "asm inline()" feature from gcc 9. This is preparation for > removing the #define. > > Generated by > > git grep --files-with-matches -w __inline__ | \ > grep -vE '^(usr|Documentation|scripts)/' | \ > grep -v /uapi/ | \ > xargs sed -i -e 's/static *__inline__/static inline/' bikeshed: Perhaps better to use xargs sed -i -e 's/\b__inline__\b/inline/g' As static and __inline__ do not have to be on the same line. for instance: (and I didn't look thoroughly) This misses one of the uses of __static__ in drivers/scsi/qla2xx/qla_os.c The patch has: > diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c [] > @@ -342,7 +342,7 @@ qla2x00_restart_timer(scsi_qla_host_t *vha, unsigned long interval) > mod_timer(&vha->timer, jiffies + interval * HZ); > } > > -static __inline__ void > +static inline void > qla2x00_stop_timer(scsi_qla_host_t *vha) > { > del_timer_sync(&vha->timer); But the code is: drivers/scsi/qla2xxx/qla_os.c-318-/* TODO Convert to inlines drivers/scsi/qla2xxx/qla_os.c-319- * drivers/scsi/qla2xxx/qla_os.c-320- * Timer routines drivers/scsi/qla2xxx/qla_os.c-321- */ drivers/scsi/qla2xxx/qla_os.c-322- drivers/scsi/qla2xxx/qla_os.c:323:__inline__ void drivers/scsi/qla2xxx/qla_os.c-324-qla2x00_start_timer(scsi_qla_host_t *vha, unsigned long interval) drivers/scsi/qla2xxx/qla_os.c-325-{ drivers/scsi/qla2xxx/qla_os.c-326- timer_setup(&vha->timer, qla2x00_timer, 0); drivers/scsi/qla2xxx/qla_os.c-327- vha->timer.expires = jiffies + interval * HZ; drivers/scsi/qla2xxx/qla_os.c-328- add_timer(&vha->timer); -- drivers/scsi/qla2xxx/qla_os.c-340- } drivers/scsi/qla2xxx/qla_os.c-341- drivers/scsi/qla2xxx/qla_os.c-342- mod_timer(&vha->timer, jiffies + interval * HZ); drivers/scsi/qla2xxx/qla_os.c-343-} drivers/scsi/qla2xxx/qla_os.c-344- drivers/scsi/qla2xxx/qla_os.c:345:static __inline__ void drivers/scsi/qla2xxx/qla_os.c-346-qla2x00_stop_timer(scsi_qla_host_t *vha) drivers/scsi/qla2xxx/qla_os.c-347-{ drivers/scsi/qla2xxx/qla_os.c-348- del_timer_sync(&vha->timer); drivers/scsi/qla2xxx/qla_os.c-349- vha->timer_active = 0; drivers/scsi/qla2xxx/qla_os.c-350-} The possible impacted files using 's/\b__inline__\b/inline/' $ git grep -w '__inline__' -- '*.[ch]' | grep -vP 'static\s+__inline__' (only hand selected matches) arch/alpha/include/asm/compiler.h:#undef __inline__ arch/alpha/include/asm/floppy.h:__inline__ void virtual_dma_init(void) arch/ia64/hp/common/sba_iommu.c:#define SBA_INLINE __inline__ drivers/parisc/sba_iommu.c:#define SBA_INLINE __inline__ drivers/scsi/qla2xxx/qla_os.c:__inline__ void drivers/video/fbdev/intelfb/intelfbdrv.c:__inline__ int intelfb_var_to_depth(const struct fb_var_screeninfo *var)