Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1556417rwb; Tue, 27 Sep 2022 15:07:30 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6+Djl38NYyOWrm1oSis6QitwhS6BuD3SNbqeq5hPhTEsakY6r3l3XEJohkQZetcQqZMSTd X-Received: by 2002:a17:907:d07:b0:72e:ec79:ad0f with SMTP id gn7-20020a1709070d0700b0072eec79ad0fmr25447211ejc.296.1664316450320; Tue, 27 Sep 2022 15:07:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664316450; cv=none; d=google.com; s=arc-20160816; b=qHw+6+jxFqAfO0duY8ipntZ9s9JzBre/ixD6inHTEv59PRUwhFXezWp1kvPJh+NbY2 k16P5dqplmw5LjJ8bv/Pk9K7rfJQZJ1LIL88elAmBaQV6HKmjIgg/RzFcrJYERJ74QWu pHdJUG8Kk/YxvazHaQ+h/Sry++0jbo7SGspVL/wWJLEZrgaNXZczcfK3wc4QywM+UBVv 1bbftaYdSOm/5bZ1/C38PChp3ovrBvSyGOhvR1U0YHfipheXbILjrQaDm5d/XVPemjP8 rTZ+0L8Z1Da2893c4shQptSmf95f28jQFY9G7KERuKdJ58P3LwpQLegV9cNDGRCGQUiz v/pQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=CNKYzF9I2YeaRkrIIwLDheAxIzD3Zi4Vv2DTzJLGgC4=; b=R+bOmHx+Bvf4cKrqQGDe/+NQULVKxBr3owRTrhQ0yP0IsirOWJkjWElJDBxHqLXxTR gftjBrFi4gs2zPKBJpQupW13jWoI3ScYQ4AUqbnQIstV5Aw8YYKPA0VTMkFE8n1a9AF7 pZh6w9nbsS43KHmtncaSiPtFVV/0J6jNMpoJ6ttiq0bEaVq4CmNeQg44v0dbq28m/NHZ LsySjy9nHPKmK26IwI4KYixqEVzgs/L5gILYwZce9BDKUM7Kl80g+mUJyuKNSQlfh5mc Agdh4cUy5DmFuWLS5Fjr1VRcJoQkt7Q8W/vE5/v0NgSw7hHU1GZr7G8DztFeNl0MPcOX yUUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=UjXxJ7hq; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a70-20020a509ecc000000b0045154775089si2421009edf.625.2022.09.27.15.07.04; Tue, 27 Sep 2022 15:07:30 -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=@gmail.com header.s=20210112 header.b=UjXxJ7hq; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229610AbiI0VxK (ORCPT + 99 others); Tue, 27 Sep 2022 17:53:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230307AbiI0VxI (ORCPT ); Tue, 27 Sep 2022 17:53:08 -0400 Received: from mail-qv1-xf32.google.com (mail-qv1-xf32.google.com [IPv6:2607:f8b0:4864:20::f32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FC6B5A2F8; Tue, 27 Sep 2022 14:53:05 -0700 (PDT) Received: by mail-qv1-xf32.google.com with SMTP id r14so179638qvn.3; Tue, 27 Sep 2022 14:53:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=CNKYzF9I2YeaRkrIIwLDheAxIzD3Zi4Vv2DTzJLGgC4=; b=UjXxJ7hqnfs5LWBwU6bEJtVaB6IMJjv2C3Q7CnqHdQXyrQl91wIAs04byCTvAd+PiY uUCX/3R9PAik6ZuNV5EHt2vSksJxuobZ8whkTsRm41xNHkuQ1pebDWpgFKhM9aglzjU1 mudTkiAe55dfLrOh1LKV+efzBONM3bB1XrTbFPNKFZUg4L90qEMOgGnHFoU1YMsIOmA5 7H0WIM2WCgiGmsLpjZ6MD8BRxRjo55WcCIWUGLUnL/rRWplt1IW3+AgsUoMjI+GO3r48 p3uKPepGDNsYbyZLKUD1/Fwh4sN6VBaLiGfppeKM+dH/PYyA4Mxjpi6VcYG43fi1CZIT Tk0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=CNKYzF9I2YeaRkrIIwLDheAxIzD3Zi4Vv2DTzJLGgC4=; b=lrM+pfOCmnKneep6AhG6BOntGNWZUsftFvRp0/aXldb4JybGirsfk6jSj6nWcfcQBI r6BE8wShG7LF0xhTz3bJ1p9hZyBfH5ExzOTMOFNVggMttfMMFIVcGDNKlnyQll403yTm 87lT77VASJD9QSWt0EvDzGwoTUOxX4uR+ujxRtULBWm23EYN4JKU4ibY2FmiDle/S1Tm OB80145M66RgOpZmgz999KFG5InNH3bIMk3D+qZb7kWN0+ITsYu8fReXPMGwtFdCnAOI Gx2Dae6PDbbVo8ehmEiT6daEHob+yOph/RATZxuD7pVhrMn+9TTC2E/El45C3PmxdvH0 dNSQ== X-Gm-Message-State: ACrzQf2bwsfUihTfoJb1zFWjVf0RjH+jsrT5DVE0sZcGmlslp+oyUfWa TH+72ElYjtSQ0aOXimygpdHRwhjum0M= X-Received: by 2002:a05:6214:29e3:b0:4ad:5de4:accd with SMTP id jv3-20020a05621429e300b004ad5de4accdmr23214994qvb.60.1664315584032; Tue, 27 Sep 2022 14:53:04 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id k13-20020a05620a414d00b006ce1bfbd603sm1850805qko.124.2022.09.27.14.53.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Sep 2022 14:53:03 -0700 (PDT) From: Florian Fainelli To: linux-kernel@vger.kernel.org Cc: Matt Redfearn , =?UTF-8?q?Petr=20Van=C4=9Bk?= , Florian Fainelli , Nathan Chancellor , Nick Desaulniers , Tom Rix , Justin Stitt , Andrew Morton , Denys Vlasenko , Ingo Molnar , llvm@lists.linux.dev (open list:CLANG/LLVM BUILD SUPPORT), Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , linux-perf-users@vger.kernel.org (open list:PERFORMANCE EVENTS SUBSYSTEM), mmayer@broadcom.com, Khem Raj , Philippe Ombredanne , Kate Stewart , Greg Kroah-Hartman , Thomas Gleixner Subject: [PATCH] include/uapi/linux/swab: Fix potentially missing __always_inline Date: Tue, 27 Sep 2022 14:52:56 -0700 Message-Id: <20220927215256.528619-1-f.fainelli@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 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 --- 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