Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1165205imm; Wed, 6 Jun 2018 11:27:47 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJLyo/K/t5k1AOhafLZq/E93i4J+zl08cw1Q7IqTkMTiyHdCbpLG7Prsu23uFMHO/kUbjIY X-Received: by 2002:a62:3ad8:: with SMTP id v85-v6mr3542570pfj.184.1528309667453; Wed, 06 Jun 2018 11:27:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528309667; cv=none; d=google.com; s=arc-20160816; b=rnOmgnNNHpnaWtIdhgv9RhHcTJD5yX3g4VVwWVrbvnf+pz95Qs5eUTdBz5h8WqoVmM ccqqx7wWL+FNyLgPqK7tA2EdvIMIscuNjULvO9irdCda9AP0wDymsn3UfqfGFHL0wTg3 a5UBEKuBhHoATGyvqKlUAy82WXzjeDKToGaN31Ej8IMLWXTUj94DmcDfvT4s8EIQfp0L Hqfk1H4/pSIGWMZoUBNPXAkYrMztIh/trxqPdkdajUDZVSnU2QHWUN64sZo6hthwRN/9 aDujFV+nP0aZHKILc7Apy94k99MglVO7wgs30QSYSTD6AbGSgtSKTsg2Tj3WOhWGwgZz l8Jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:from:cc:to:subject :content-transfer-encoding:mime-version:references:in-reply-to :user-agent:date:arc-authentication-results; bh=Eby8/QWngNBghhm4IogzUwHsY7/qkBqMdN7vwOpW3vA=; b=0Sn3gMQXoLBRcMiOXdUCZSn1bArektBiEyd3J4AX44X9/ktWyVrdLpiMKk5Puew9DW TTydNSNJ8Ho2E2efj5KwcFSsROJuKGgT6OB+IGHIF17SvNyjm5+aVA+l429VGYpET07e Ykz4ZhX9053ivGsfzYEbKvf6UzYYW9hEVNRBPrW8kOcpRsP6FwpW0Ny+xlLOymXhFmOQ nHDjYBZtu14mwHTdd1LQ/3slGM7rRLu01MfTYkSHDEccoxJnL80B6Dw+L6XzJvGGzHNE c86LdY+ERjqCwGxm4o/4IUj4HOqg2dx2OkSbqgsjRLQ3xK4cvXcFa9Sm4MszUIVes0bN Wchw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w21-v6si50652808plp.199.2018.06.06.11.27.33; Wed, 06 Jun 2018 11:27:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933492AbeFFQlw convert rfc822-to-8bit (ORCPT + 99 others); Wed, 6 Jun 2018 12:41:52 -0400 Received: from terminus.zytor.com ([198.137.202.136]:37503 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932724AbeFFQlu (ORCPT ); Wed, 6 Jun 2018 12:41:50 -0400 Received: from [10.235.187.101] (73-93-154-149-static.hfc.comcastbusiness.net [73.93.154.149] (may be forged)) (authenticated bits=0) by mail.zytor.com (8.15.2/8.15.2) with ESMTPSA id w56GdX981849207 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Wed, 6 Jun 2018 09:39:33 -0700 Date: Wed, 06 Jun 2018 09:39:25 -0700 User-Agent: K-9 Mail for Android In-Reply-To: References: <20180605170532.170361-1-ndesaulniers@google.com> <20180605170532.170361-2-ndesaulniers@google.com> <202492204c2d5bd5ca27307cbca5e44673b739ed.camel@perches.com> <5ad1876557235a089a50e6ed6c558a7dcb0da714.camel@perches.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Subject: Re: [PATCH v2 1/2] compiler-gcc.h: add gnu_inline to all inline declarations To: sedat.dilek@gmail.com, Sedat Dilek , Joe Perches CC: Nick Desaulniers , akpm@linux-foundation.org, ard.biesheuvel@linaro.org, aryabinin@virtuozzo.com, akataria@vmware.com, boris.ostrovsky@oracle.com, brijesh.singh@amd.com, caoj.fnst@cn.fujitsu.com, gregkh@linuxfoundation.org, jan.kiszka@siemens.com, jarkko.sakkinen@linux.intel.com, jgross@suse.com, jpoimboe@redhat.com, kirill.shutemov@linux.intel.com, mingo@redhat.com, mjg59@google.com, mka@chromium.org, pombredanne@nexb.com, rostedt@goodmis.org, tglx@linutronix.de, thomas.lendacky@amd.com, tweek@google.com, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, virtualization@lists.linux-foundation.org, astrachan@google.com, manojgupta@google.com, ghackmann@google.com, tstellar@redhat.com, keescook@google.com, yamada.masahiro@socionext.com, michal.lkml@markovi.net, linux-kbuild@vger.kernel.org, geert@linux-m68k.org, will.deacon@arm.com, mawilcox@microsoft.com, Arnd Bergmann , rientjes@google.com From: hpa@zytor.com Message-ID: <5C97550D-BEF4-4069-9373-F7543E3878FB@zytor.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On June 6, 2018 1:05:45 AM PDT, Sedat Dilek wrote: >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? > >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 - 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. -- Sent from my Android device with K-9 Mail. Please excuse my brevity.