Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp941695imm; Fri, 8 Jun 2018 07:36:40 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJegH2ZqSz3lMkNAVOxwZXBqeOphEFR9+tNis0H8dbKesRbyZM9RoSZKbkc7z9COO7H3IY8 X-Received: by 2002:a17:902:680c:: with SMTP id h12-v6mr7042002plk.113.1528468600113; Fri, 08 Jun 2018 07:36:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528468600; cv=none; d=google.com; s=arc-20160816; b=jZG/Ko51fIluTmODJ006C2U4Ez8TCXjc4aalWoIZh5dwyNwWgzAxeO/7CbhQUOwgj5 Xdlet2AJokh+/SYuiXSzFnF3PSHmfNKNL5NM1L+jc3Kirw9L5tbWpNDoIDKMaA26Ek6K LpMZxXS8nBy5x2FsBv84fy3oiv48GDcQ84ke9qVllxtr1HbGwUvXX9W3bODifCTuYGrr qb3XlzJ70YcPAoBacW//Atv7wGps3MnTdHTnomZBcLy6VPZ4j6BJE1jA6cOgP1Boorpc Ro8hwORuFCt8QH2C/dolCUCZp4iQOCPfauadsnKfCh41THIW0l0JvRIvoknoSEzcimgS rwUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:reply-to:mime-version:dkim-signature :arc-authentication-results; bh=7BKoDRRNvG418aZ/I0cOtaRZRkUjaVSOPXsuwmbWVvg=; b=GjzVdSPyWbSxhDhiHr2gpU5rK4OXvd1Un/x/JWKqcXTuPpupMRVBuZJqanf8X4rlcE 23E0IbhVTO/RpYL13Hft3JXGfjIG8GfJoG76Yfs4gJIzvvrfyJ/xPjRiBpxZ2/N8Uz14 arY7hapq7RgWNLvtPJEdoJT5fUG0hRWdJmVv0MQGfE6Rhkj3APuteBPa44PPDzqQT+a2 A38lTX3hVhKMN3jTI1jIm65EQuTrTPTW8bedexGrC90gg5B7CpWiUCcGRyo7nMn7hv57 4jDzMzd26JR04zYDdD+BThOOXRCJMC0aDQVj1+UAKT2yVOb9KwHsSgBdo1FB8sy67VuS PGYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hYF8q4dG; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u4-v6si35132558plj.43.2018.06.08.07.36.25; Fri, 08 Jun 2018 07:36:40 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hYF8q4dG; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752758AbeFHOez (ORCPT + 99 others); Fri, 8 Jun 2018 10:34:55 -0400 Received: from mail-lf0-f68.google.com ([209.85.215.68]:32865 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752676AbeFHOew (ORCPT ); Fri, 8 Jun 2018 10:34:52 -0400 Received: by mail-lf0-f68.google.com with SMTP id y20-v6so20457187lfy.0; Fri, 08 Jun 2018 07:34:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc; bh=7BKoDRRNvG418aZ/I0cOtaRZRkUjaVSOPXsuwmbWVvg=; b=hYF8q4dGNoUis1OmbxRkwSuyX8HxXtT4l9f+asvsgR4shlG/4SpWaC8jvLFb2lfEWc EsyJE3iYmem1R3V2IzVQhY3KJqUupikS/pbGS48nvsTRuV5nvDj1+IFT33PfD8J+sC9T fgnYlTIDrxlux7JxKzgFZrXiE6zJ+gMVKTVnubU/fae/Qxgy/yYDnaW7+c0x5p1XY/PK oVTwjiand2B2IRB9kU/2+omwzPH+p2Mj1yESQKzOQI+fzxZoQFdDNkIPo2ETFaBncdXS WpKFaRJ3Bxllagwu0TXwU38vFVvIc2rTnlS01qEuqZ+CYC9F9hcwEpo2NNQ76tWAdu4q 0i4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=7BKoDRRNvG418aZ/I0cOtaRZRkUjaVSOPXsuwmbWVvg=; b=NuMJKKXGOtqj0V8FU2auOYwz69lM/S6O9Aq/075igWVo17PvFdt/4S1D4SiY2CzZi6 45Vohfj4COZlwco1Ef9BZWVIWnrPtdmYsRX8i67OzHajxP/vzMOdEicT7L7GW9BGq133 +ZyP7B/pQyYZbVsPEdtuW8N+5f2yS2P9/pGbxLCIPbdMRA3n0NjG8bX//A1DlnjvcQ65 9goXTxl+A3vmF+qKMuXPR9tK22egOW07kgXY/ivOIYryAzbDyJeYTvSvlyRRg1ujyIuu sVUSIxYGnkfj1M5P/4RK1rbth6nTIa4ZqQWPPgDWCTyrPuTal+hePk2kYmxFSCmBXP50 0Y/A== X-Gm-Message-State: APt69E1qnWcwC+TBzkkYsmoYyx4Afz0YYZ6J9D50/vjrSzeONfXurQHz mu7mryF5+5uG7PZocP+fyw5y3icsZJ5L7tn2pfo= X-Received: by 2002:a19:188a:: with SMTP id 10-v6mr4333256lfy.26.1528468490963; Fri, 08 Jun 2018 07:34:50 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a19:b87:0:0:0:0:0 with HTTP; Fri, 8 Jun 2018 07:34:50 -0700 (PDT) Reply-To: sedat.dilek@gmail.com In-Reply-To: <5C97550D-BEF4-4069-9373-F7543E3878FB@zytor.com> References: <20180605170532.170361-1-ndesaulniers@google.com> <20180605170532.170361-2-ndesaulniers@google.com> <202492204c2d5bd5ca27307cbca5e44673b739ed.camel@perches.com> <5ad1876557235a089a50e6ed6c558a7dcb0da714.camel@perches.com> <5C97550D-BEF4-4069-9373-F7543E3878FB@zytor.com> From: Sedat Dilek Date: Fri, 8 Jun 2018 16:34:50 +0200 Message-ID: Subject: Re: [PATCH v2 1/2] compiler-gcc.h: add gnu_inline to all inline declarations To: hpa@zytor.com Cc: Joe Perches , 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 6, 2018 at 6:39 PM, wrote: ... >>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. > 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 #endif ... /* Intel compiler defines __GNUC__. So we will overwrite implementations * coming from above header files here */ #ifdef __INTEL_COMPILER # include #endif /* Clang compiler defines __GNUC__. So we will overwrite implementations * coming from above header files here */ #ifdef __clang__ #include #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 directly, include 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@ -