Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1284229rwb; Wed, 28 Sep 2022 16:17:02 -0700 (PDT) X-Google-Smtp-Source: AMsMyM568QY5JT0nD0UjZA85r2pTGPNxbBZ2nitCSfKs588kz+NapOp6eMQJq8yZWu4yKBQHBuaP X-Received: by 2002:a17:90b:1c07:b0:200:9728:b8cd with SMTP id oc7-20020a17090b1c0700b002009728b8cdmr13215428pjb.139.1664407022247; Wed, 28 Sep 2022 16:17:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664407022; cv=none; d=google.com; s=arc-20160816; b=EUVg/W4jNpEWPMyfCn1WMZ0uPNvguyAYv8PF6BBUp8BhiOIgsyehw0si0dnCahwNzF 16BR/Sv8XDiX5tIOtAGkY4IA+3m0mNeo55sRXtOWAEGyCQxMZCifjur9UrG7FIdLNMgD ZelDNV2686Al4GsWusR24BtfQAUORSajlg8hNnGxlImeq7TWPUbn0a66OfLXmAA5IsWn NVJtMSetrUAgDF8u9wt4mK2P4I7UPxQZ+JJcqEGzpKDmL3/NMGtmfEUMka/sSvSkaHB/ BC9hJPNRzTaioaHBdwf4Jeb6DJ9Ubjlt0vrl5IZgr/x451IGCpTKXgnB4VKFdV8BR3DI Exdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=W9H89DoOz6LkzZEqFUWesSLvgP7e4IrtZljvYfhsUKQ=; b=IsKZkjTM42l44GrpYjQ6CHXVE67JLedfY7iNPxtGmR6drMYgqxdcpIbOPm0WR62+g4 5csknUXJeWtNmwuDeAfgRMZT+fXuXk5WK7Jc2m2swUwJn32fX5c1s0dr1qv8boDK6i0u AiXrLjINDudqdFC4juj3bQhY0a5pH5A5wzDlEKG/KY1XVFIvd1MFk9+vY/sdoII8/AK2 PjZlxo7sI6yiRdF75gk3fyjUf88vX9IyrXegVdHLvGa93Tq/cCQRugdemwydUXXZybfM HBxxLJ/r8Q1VATYLt5rxctY1FRnkKSySqyuKjAlreqE2xvHy27fT2WL9X9nV/SXeHtaX r1lQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="qtKvpq/M"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n129-20020a634087000000b0041b63205786si6185038pga.293.2022.09.28.16.16.50; Wed, 28 Sep 2022 16:17:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="qtKvpq/M"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234594AbiI1WhI (ORCPT + 99 others); Wed, 28 Sep 2022 18:37:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234428AbiI1Wgn (ORCPT ); Wed, 28 Sep 2022 18:36:43 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63F235FF64; Wed, 28 Sep 2022 15:36:09 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id DEA4FB82146; Wed, 28 Sep 2022 22:36:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 50F51C433C1; Wed, 28 Sep 2022 22:36:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664404565; bh=3ZkYJjVGuAToHzBzl/eiZQGP9nl9Lz8aoqrcQ6zQ2uM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qtKvpq/MUwe5t3E4qnfpcWmZ+pcS4X4n2SsF/DqlSmrRrDWMnk/FLftXgyTKLbd3m vf5onz4ySjHSRPWg90lJAptiotaelTd1i/CYikPGvR6S3fjnLg44rhwRDmZhL8vWft 8fgBaB/JZ0fJBXAIQAphj/RKrXXvh8tAme/Te94gYrUrSm+2/10sIdAi1sGA/GoFb+ w+E0XnEn4LevLs1JvLEaqDFEflvwhWNXQTRpQn++dtp5R3F4x8n3l6DyEkl79MWEOr fcM/sZ3XXaO2EUoP/Kkt8FDn9nNMAUDD7J0uENSVy0/jAtD0M4sYt0aC3VwCNTKLHB y8OuB2Bu+VdNw== Date: Wed, 28 Sep 2022 15:36:02 -0700 From: Nathan Chancellor To: Florian Fainelli Cc: linux-kernel@vger.kernel.org, Matt Redfearn , Petr =?utf-8?B?VmFuxJtr?= , Nick Desaulniers , Tom Rix , Justin Stitt , Andrew Morton , Denys Vlasenko , Ingo Molnar , "open list:CLANG/LLVM BUILD SUPPORT" , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , "open list:PERFORMANCE EVENTS SUBSYSTEM" , mmayer@broadcom.com, Khem Raj , Philippe Ombredanne , Kate Stewart , Greg Kroah-Hartman , Thomas Gleixner Subject: Re: [PATCH] include/uapi/linux/swab: Fix potentially missing __always_inline Message-ID: References: <20220927215256.528619-1-f.fainelli@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220927215256.528619-1-f.fainelli@gmail.com> X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Florian, On Tue, Sep 27, 2022 at 02:52:56PM -0700, Florian Fainelli wrote: > From: Matt Redfearn > > Commit bc27fb68aaad ("include/uapi/linux/byteorder, swab: force inlining > of some byteswap operations") added __always_inline to swab functions > and commit 283d75737837 ("uapi/linux/stddef.h: Provide __always_inline to > userspace headers") added a definition of __always_inline for use in > exported headers when the kernel's compiler.h is not available. > > However, since swab.h does not include stddef.h, if the header soup does > not indirectly include it, the definition of __always_inline is missing, > resulting in a compilation failure, which was observed compiling the > perf tool using exported headers containing this commit: > > In file included from /usr/include/linux/byteorder/little_endian.h:12:0, > from /usr/include/asm/byteorder.h:14, > from tools/include/uapi/linux/perf_event.h:20, > from perf.h:8, > from builtin-bench.c:18: > /usr/include/linux/swab.h:160:8: error: unknown type name `__always_inline' > static __always_inline __u16 __swab16p(const __u16 *p) > > Fix this by replacing the inclusion of linux/compiler.h with > linux/stddef.h to ensure that we pick up that definition if required, > without relying on it's indirect inclusion. compiler.h is then included > indirectly, via stddef.h. > > Fixes: 283d75737837 ("uapi/linux/stddef.h: Provide __always_inline to userspace headers") > Signed-off-by: Matt Redfearn > Reviewed-by: Petr Vaněk > Signed-off-by: Florian Fainelli I took this through my kernel build matrix and did not see any new issues. Tested-by: Nathan Chancellor Cheers, Nathan > --- > Apologies for the insanely long CC list. I encountered this problem > again while attempting to build perf with a LLVM 13 toolchain using > musl-libc. Not sure why it did not get picked up last time? > > Khem did submit an alternative patch a few years ago, too which also did > not get picked up: > > https://lore.kernel.org/lkml/20180913005654.39976-1-raj.khem@gmail.com/ > > include/uapi/linux/swab.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/uapi/linux/swab.h b/include/uapi/linux/swab.h > index 0723a9cce747..01717181339e 100644 > --- a/include/uapi/linux/swab.h > +++ b/include/uapi/linux/swab.h > @@ -3,7 +3,7 @@ > #define _UAPI_LINUX_SWAB_H > > #include > -#include > +#include > #include > #include > > -- > 2.25.1 > >