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 1ECDFEB64DD for ; Tue, 4 Jul 2023 08:30:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231641AbjGDIae (ORCPT ); Tue, 4 Jul 2023 04:30:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231601AbjGDIaa (ORCPT ); Tue, 4 Jul 2023 04:30:30 -0400 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54FCFB1 for ; Tue, 4 Jul 2023 01:30:29 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-57704aace46so55115937b3.2 for ; Tue, 04 Jul 2023 01:30:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1688459428; x=1691051428; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=sfzTTTZzhjYlz4coFh9E2qSX1ec2CbvNDkaAXEgpk5k=; b=V8Vsb0Zt5QGQio1EPy5IGW2p8TPoQMJ1oVAgaPnqc8Bl2IMATsQZRlbz2u8dDr8cmo aHvazQfMuSXmNAxqMbzFrwGkp7MBrxzmuYCrK2BwIoCc5U+Ty43eJVT2pdEMJjDL+ma+ aGkT6TxH6vX5m9sWMUsU+RZXMaDJV6vqbQBkD0oyV+3N90lgjPTlbBVuOn0nnzGw2Qvl oXx07SyWAgK2Jt9JjDwEMAQje137bsU9yzAunIxWnc4o7Cqc+Ml1mROlOJXkEFdIsB6l y3z/GPJWMEe5xVO3UZlkoIid/wmLfG7exFCE/PaAAoNH36bzS5cFinGXDw4qlI7NW10j rcHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688459428; x=1691051428; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=sfzTTTZzhjYlz4coFh9E2qSX1ec2CbvNDkaAXEgpk5k=; b=Q3EEDHvitZWwb4wOEXvRGPhWHU8ta2FAU9sSiUlenLARyB0Vky7+3LxfIBgEz9sIZP bRKK4V50fL2BBpHYe/soVmTMwdbW2DBVkPuH0f7UVpdo7/ZS21b//todNuIdN9ZD9cOj QTA6t2tfCLWwqreYePEUPTEHjd/eC1zgrssa9ZW7pL1HeYzeg0WQ3QjinHvwxNOXqGnG 7aHFBr3JanBUmuFPlJ0RZpdXidOq5uUJpT2DxT5pyAJIqdDjtAWVf/NxEhZ3K9uYmbOS 8OlhfNoiJpXIa1ekJSKd7vbQwb6y0rLDgg6Uc2nlicN05jCQAaXnv6sgeiwKtD7wn8wh YhtQ== X-Gm-Message-State: ABy/qLbFOnQVC0rHPKlNJSFC4LppWUNj3Zfu0VGEeuGV9ghEOKtLKnmb F1rgebT2qm5Ill53os7HndzJ2oo+9oni5A== X-Google-Smtp-Source: APBJJlGdBVgj65bby9V434H9tf4LMtH0P8VjOntdbYAYDc6gjGY+BtXP400b2TbEy0J1sOLuNq4qDOqdTr44WQ== X-Received: from slicestar.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:20a1]) (user=davidgow job=sendgmr) by 2002:a05:6902:1813:b0:bc5:2869:d735 with SMTP id cf19-20020a056902181300b00bc52869d735mr77328ybb.13.1688459428478; Tue, 04 Jul 2023 01:30:28 -0700 (PDT) Date: Tue, 4 Jul 2023 16:30:21 +0800 Mime-Version: 1.0 X-Mailer: git-send-email 2.41.0.255.g8b1d071c50-goog Message-ID: <20230704083022.692368-1-davidgow@google.com> Subject: [PATCH 1/2] asm-generic: current: Don't include thread-info.h if building asm From: David Gow To: Richard Weinberger , Anton Ivanov , Johannes Berg , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H . Peter Anvin" , Arnd Bergmann , Noah Goldstein Cc: linux-um@lists.infradead.org, x86@kernel.org, linux-arch@vger.kernel.org, Geert Uytterhoeven , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, David Gow Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 */ -- 2.41.0.255.g8b1d071c50-goog