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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C80A3EE49A6 for ; Sun, 20 Aug 2023 00:20:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229633AbjHTATf convert rfc822-to-8bit (ORCPT ); Sat, 19 Aug 2023 20:19:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229763AbjHTATQ (ORCPT ); Sat, 19 Aug 2023 20:19:16 -0400 Received: from lithops.sigma-star.at (lithops.sigma-star.at [195.201.40.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B343ACFE22; Sat, 19 Aug 2023 14:17:49 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id 6015C63DB7E5; Sat, 19 Aug 2023 23:17:48 +0200 (CEST) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 4g8WFByNW1hB; Sat, 19 Aug 2023 23:17:48 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id DB93163DB801; Sat, 19 Aug 2023 23:17:47 +0200 (CEST) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id V-A1eIJKOCYu; Sat, 19 Aug 2023 23:17:47 +0200 (CEST) Received: from lithops.sigma-star.at (lithops.sigma-star.at [195.201.40.130]) by lithops.sigma-star.at (Postfix) with ESMTP id ABF7E63DB7E5; Sat, 19 Aug 2023 23:17:47 +0200 (CEST) Date: Sat, 19 Aug 2023 23:17:47 +0200 (CEST) From: Richard Weinberger To: davidgow Cc: anton ivanov , Johannes Berg , tglx , mingo , bp , dave hansen , hpa , Arnd Bergmann , Noah Goldstein , linux-um , x86 , linux-arch , Geert Uytterhoeven , linux-kselftest , linux-kernel Message-ID: <1999963356.6490608.1692479867613.JavaMail.zimbra@nod.at> In-Reply-To: <20230704083022.692368-1-davidgow@google.com> References: <20230704083022.692368-1-davidgow@google.com> Subject: Re: [PATCH 1/2] asm-generic: current: Don't include thread-info.h if building asm MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-Originating-IP: [195.201.40.130] X-Mailer: Zimbra 8.8.12_GA_3807 (ZimbraWebClient - FF97 (Linux)/8.8.12_GA_3809) Thread-Topic: asm-generic: current: Don't include thread-info.h if building asm Thread-Index: nVjiU4WyfVH2A7QVxS/nlClMU8OkNw== Precedence: bulk List-ID: X-Mailing-List: linux-arch@vger.kernel.org ----- Ursprüngliche Mail ----- > Von: "davidgow" > asm/current.h is included by some assembly files (either directly, or > indirectly). This works on some architectures (such as x86), as their > implementation of current.h is careful to not include any C, but the > asm-generic version includes linux/thread-info.h unconditionally, which > leads to errors when either C code or non-asm-compatible preprocessor > directives are included. > > Just wrap the contents behind an #ifndef __ASSEMBLY__ to avoid any C > code making its way in. > > Signed-off-by: David Gow > --- > > This is requrired for patch #2 here, as UML uses this asm-generic > header, but works with x86 assembly files which are expecting the x86 > current.h, which is assembly-friendly. > > --- > include/asm-generic/current.h | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/include/asm-generic/current.h b/include/asm-generic/current.h > index 3a2e224b9fa0..9c2aeecbd05a 100644 > --- a/include/asm-generic/current.h > +++ b/include/asm-generic/current.h > @@ -2,9 +2,11 @@ > #ifndef __ASM_GENERIC_CURRENT_H > #define __ASM_GENERIC_CURRENT_H > > +#ifndef __ASSEMBLY__ > #include > > #define get_current() (current_thread_info()->task) > #define current get_current() > +#endif > > #endif /* __ASM_GENERIC_CURRENT_H */ I'm fine with the UML side of this change but the generic part needs Arnd's ACK. Thanks, //richard