From patchwork Fri Jan 1 20:27:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 355965 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4CCCBC433E0 for ; Fri, 1 Jan 2021 20:28:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 18F02207AF for ; Fri, 1 Jan 2021 20:28:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727199AbhAAU2p (ORCPT ); Fri, 1 Jan 2021 15:28:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727088AbhAAU2p (ORCPT ); Fri, 1 Jan 2021 15:28:45 -0500 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EAF7FC0613C1 for ; Fri, 1 Jan 2021 12:28:04 -0800 (PST) Received: by mail-ej1-x633.google.com with SMTP id ce23so28869655ejb.8 for ; Fri, 01 Jan 2021 12:28:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=UcmlkgNOk2dFt1Fn8MkJq959qiEnwp/mWHZm27xQmUE=; b=C5ewZGHx4Tnx4bsOcBmzu0E6KK+dvn600PTvqcm01WhdneCYnNlznjWnY9Y1Sf06jd Q5HzoENTl69jbSB8UmW6vTJnYGg4+xv+XOODKgMqOLi4eINHBSrELWfKSPrsSv3ZDLS0 Yr9vArVpDwhoE7nzAmZpsZdDF+MRhA3WH0W9fK5A/qBCwyXjzmbzNqqOSfQ5aMOwmVB0 hLIKFAZvwEyuprdDR9g13n4cM1peRqR776UD7qgdnIu7H7yiNMVauBTN+OwrN9c3MNJF ZPpL32V1/h51/hLzasOFxSY+9e40RbBPLO8Y7rLp3fE2i7bCIG5LtBJnMb9j7FTvz8G/ 5ezA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=UcmlkgNOk2dFt1Fn8MkJq959qiEnwp/mWHZm27xQmUE=; b=Wh85Eo7eL4ooGMW4z0SXfGwRuAnuQqFRzqwicB5tYe/W148K5cS6b4XVba5jOmbmLU 2xrwBsrCEngYiWcEwh+n4ll7lmKBhKj14EBKApC8JRIyGtehtKnLRB3NKa0N/U9ur89c +IOy4dTiKqWAM4B7iH6mElcs54KEXW8eStOe2PGSkX/b9b7HaRj9uBGDk8I7234nI8yV td9rMi07OpThbifHiZQwnRiCfwmi4CzoB0erAnJuDUdFGqTsAOMnvfwdvFjWJ3l0adj/ zpowm18DQwfnsJB1cg1qpBsZEPycRfhagKiSoUti+9hVEyhqpXF4sXrYxmmRwMhU35e/ qBdg== X-Gm-Message-State: AOAM532Qgb5+aVORzrgr5aZp/Oa9OkLX1KglFrsGwnQMhTnTMVCsQ28D Mt/bPXm9TQ+MQUjhAcajKhb3JMs8QL7W6g== X-Google-Smtp-Source: ABdhPJzX7bEHUl52y4EBHn9nmRMdabUYlczJCd2nfCgRjlClh+KR33uVUDOmbf7dxpUwszswukWTUw== X-Received: by 2002:a17:906:edca:: with SMTP id sb10mr58996259ejb.284.1609532883659; Fri, 01 Jan 2021 12:28:03 -0800 (PST) Received: from localhost.localdomain ([62.201.25.198]) by smtp.gmail.com with ESMTPSA id ld2sm21135378ejb.73.2021.01.01.12.28.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Jan 2021 12:28:03 -0800 (PST) From: Petr Vorel To: stable@vger.kernel.org Cc: Petr Vorel , Greg Kroah-Hartman , Sasha Levin , Rich Felker , Peter Korsgaard , Baruch Siach , Florian Weimer , Andrew Morton Subject: [PATCH 1/2] uapi: move constants from to Date: Fri, 1 Jan 2021 21:27:57 +0100 Message-Id: <20210101202758.28291-1-petr.vorel@gmail.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org and include in UAPI headers instead of . commit a85cbe6159ffc973e5702f70a3bd5185f8f3c38d upstream. The reason is to avoid indirect include when using some network headers: or others -> -> . This indirect include causes on MUSL redefinition of struct sysinfo when included both and some of UAPI headers: In file included from x86_64-buildroot-linux-musl/sysroot/usr/include/linux/kernel.h:5, from x86_64-buildroot-linux-musl/sysroot/usr/include/linux/netlink.h:5, from ../include/tst_netlink.h:14, from tst_crypto.c:13: x86_64-buildroot-linux-musl/sysroot/usr/include/linux/sysinfo.h:8:8: error: redefinition of `struct sysinfo' struct sysinfo { ^~~~~~~ In file included from ../include/tst_safe_macros.h:15, from ../include/tst_test.h:93, from tst_crypto.c:11: x86_64-buildroot-linux-musl/sysroot/usr/include/sys/sysinfo.h:10:8: note: originally defined here Link: https://lkml.kernel.org/r/20201015190013.8901-1-petr.vorel@gmail.com Signed-off-by: Petr Vorel Suggested-by: Rich Felker Acked-by: Rich Felker Cc: Peter Korsgaard Cc: Baruch Siach Cc: Florian Weimer Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Hi, could this fix be backported to stable releases? Maybe safer to wait till v5.11 release. Adjusted for stable/linux-5.10.y. Kind regards, Petr include/uapi/linux/const.h | 5 +++++ include/uapi/linux/ethtool.h | 2 +- include/uapi/linux/kernel.h | 9 +-------- include/uapi/linux/lightnvm.h | 2 +- include/uapi/linux/mroute6.h | 2 +- include/uapi/linux/netfilter/x_tables.h | 2 +- include/uapi/linux/netlink.h | 2 +- include/uapi/linux/sysctl.h | 2 +- 8 files changed, 12 insertions(+), 14 deletions(-) diff --git a/include/uapi/linux/const.h b/include/uapi/linux/const.h index 5ed721ad5b19..af2a44c08683 100644 --- a/include/uapi/linux/const.h +++ b/include/uapi/linux/const.h @@ -28,4 +28,9 @@ #define _BITUL(x) (_UL(1) << (x)) #define _BITULL(x) (_ULL(1) << (x)) +#define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (typeof(x))(a) - 1) +#define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask)) + +#define __KERNEL_DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) + #endif /* _UAPI_LINUX_CONST_H */ diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h index 9ca87bc73c44..cde753bb2093 100644 --- a/include/uapi/linux/ethtool.h +++ b/include/uapi/linux/ethtool.h @@ -14,7 +14,7 @@ #ifndef _UAPI_LINUX_ETHTOOL_H #define _UAPI_LINUX_ETHTOOL_H -#include +#include #include #include diff --git a/include/uapi/linux/kernel.h b/include/uapi/linux/kernel.h index 0ff8f7477847..fadf2db71fe8 100644 --- a/include/uapi/linux/kernel.h +++ b/include/uapi/linux/kernel.h @@ -3,13 +3,6 @@ #define _UAPI_LINUX_KERNEL_H #include - -/* - * 'kernel.h' contains some often-used function prototypes etc - */ -#define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (typeof(x))(a) - 1) -#define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask)) - -#define __KERNEL_DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) +#include #endif /* _UAPI_LINUX_KERNEL_H */ diff --git a/include/uapi/linux/lightnvm.h b/include/uapi/linux/lightnvm.h index f9a1be7fc696..ead2e72e5c88 100644 --- a/include/uapi/linux/lightnvm.h +++ b/include/uapi/linux/lightnvm.h @@ -21,7 +21,7 @@ #define _UAPI_LINUX_LIGHTNVM_H #ifdef __KERNEL__ -#include +#include #include #else /* __KERNEL__ */ #include diff --git a/include/uapi/linux/mroute6.h b/include/uapi/linux/mroute6.h index c36177a86516..a1fd6173e2db 100644 --- a/include/uapi/linux/mroute6.h +++ b/include/uapi/linux/mroute6.h @@ -2,7 +2,7 @@ #ifndef _UAPI__LINUX_MROUTE6_H #define _UAPI__LINUX_MROUTE6_H -#include +#include #include #include #include /* For struct sockaddr_in6. */ diff --git a/include/uapi/linux/netfilter/x_tables.h b/include/uapi/linux/netfilter/x_tables.h index a8283f7dbc51..b8c6bb233ac1 100644 --- a/include/uapi/linux/netfilter/x_tables.h +++ b/include/uapi/linux/netfilter/x_tables.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ #ifndef _UAPI_X_TABLES_H #define _UAPI_X_TABLES_H -#include +#include #include #define XT_FUNCTION_MAXNAMELEN 30 diff --git a/include/uapi/linux/netlink.h b/include/uapi/linux/netlink.h index c3816ff7bfc3..3d94269bbfa8 100644 --- a/include/uapi/linux/netlink.h +++ b/include/uapi/linux/netlink.h @@ -2,7 +2,7 @@ #ifndef _UAPI__LINUX_NETLINK_H #define _UAPI__LINUX_NETLINK_H -#include +#include #include /* for __kernel_sa_family_t */ #include diff --git a/include/uapi/linux/sysctl.h b/include/uapi/linux/sysctl.h index 27c1ed2822e6..458179df9b27 100644 --- a/include/uapi/linux/sysctl.h +++ b/include/uapi/linux/sysctl.h @@ -23,7 +23,7 @@ #ifndef _UAPI_LINUX_SYSCTL_H #define _UAPI_LINUX_SYSCTL_H -#include +#include #include #include From patchwork Fri Jan 1 20:27:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 356126 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87E7CC433E6 for ; Fri, 1 Jan 2021 20:28:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4BCC322228 for ; Fri, 1 Jan 2021 20:28:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727213AbhAAU2q (ORCPT ); Fri, 1 Jan 2021 15:28:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727088AbhAAU2q (ORCPT ); Fri, 1 Jan 2021 15:28:46 -0500 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18812C0613CF for ; Fri, 1 Jan 2021 12:28:06 -0800 (PST) Received: by mail-ed1-x534.google.com with SMTP id i24so20900814edj.8 for ; Fri, 01 Jan 2021 12:28:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KEUZAZZ4i9ywnVtXKtjk7HT5a3MIB0wrzjbV5kaLo0M=; b=RDFfaRrnPxdXtI5y+zOu0/CtsebXIzGJ6cvdh+kPgfRQBDe4Tx0uCZt2JkDM7RPhIM N8T/EpxwgQJdNV6eNxf9fuo7QaUs6yU5mCFC6j1R99VCUOxEK39aa0XZZQ7JIzYP2NWz LJGnKfstGPz4KZPrHhTBuWepVwckJxub5RIN52FsxLK2+CaSuEyUJA24QiPMwVXmbnMm u9k24fJmYooeluWfd7Yruw9XhwGxJUd8Sys51P7kMZ6LIeryCAiapydk6h3vtaGxypmQ 1iSaoQlIVdmTBlTpFkTOjNJ0H0W8to2RtCL4OR/qC9HUIVvkCkDopSeCt8piJI2aFF7Y YtOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KEUZAZZ4i9ywnVtXKtjk7HT5a3MIB0wrzjbV5kaLo0M=; b=toYMZeKGfU2Ul3KQdFOQ1dVqPeq7k8xg5AyAKlVjIL5rd6iYO0frQKdu0v9kA6z2vy S/evOUtWV/ysd0IleH9Ie6Bu19L+LWw+X8UHns2A5jU9jhX05dD/A5GMEhQ9BfHw38NG iELcePup3hlR0bLxInEqsae/DT/ZATF2dYn/yrV7UaRBJUFLsgJHGlYPot1nBx/rMvA2 zt+/DFwU4H07blc+Dp6AIsKc/0HQY5CW/EtE0co1ePpNN4VTj9v7H56wDPECyvJy99Ty J5UYJiKLmAKn5NFmpOqKpLfEpsdUrzXZnC0QAxaIrvSwTLbvPQsuQPEngXAYD9zO7QYp 6Rcg== X-Gm-Message-State: AOAM532Atr97H835Ns9oCacN8JrZ9VtGQYSq6WOdyyQMtuI2C/o80pzQ 3C8y3ZgNcK4wGZgA/4+2xwg5c4AhZU4isg== X-Google-Smtp-Source: ABdhPJxx+rYpj+HrVdsE3Y8hcnFslCllxcw02NmDTQoffkMnTgIbUAbVCC+n25Io9m6q2EoJDARcYg== X-Received: by 2002:a50:b223:: with SMTP id o32mr61457902edd.79.1609532884811; Fri, 01 Jan 2021 12:28:04 -0800 (PST) Received: from localhost.localdomain ([62.201.25.198]) by smtp.gmail.com with ESMTPSA id ld2sm21135378ejb.73.2021.01.01.12.28.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Jan 2021 12:28:04 -0800 (PST) From: Petr Vorel To: stable@vger.kernel.org Cc: Arnaldo Carvalho de Melo , Greg Kroah-Hartman , Sasha Levin , Rich Felker , Peter Korsgaard , Baruch Siach , Florian Weimer , Andrew Morton , Petr Vorel Subject: [PATCH 2/2] tools headers UAPI: Sync linux/const.h with the kernel headers Date: Fri, 1 Jan 2021 21:27:58 +0100 Message-Id: <20210101202758.28291-2-petr.vorel@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210101202758.28291-1-petr.vorel@gmail.com> References: <20210101202758.28291-1-petr.vorel@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnaldo Carvalho de Melo commit 7ddcdea5b54492f54700f427f58690cf1e187e5e upstream. To pick up the changes in: a85cbe6159ffc973 ("uapi: move constants from to ") That causes no changes in tooling, just addresses this perf build warning: Warning: Kernel ABI header at 'tools/include/uapi/linux/const.h' differs from latest version at 'include/uapi/linux/const.h' diff -u tools/include/uapi/linux/const.h include/uapi/linux/const.h Cc: Adrian Hunter Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Cc: Petr Vorel Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Petr Vorel --- Fix for previous commit (for stable/linux-5.10.y.). Kind regards, Petr tools/include/uapi/linux/const.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/include/uapi/linux/const.h b/tools/include/uapi/linux/const.h index 5ed721ad5b19..af2a44c08683 100644 --- a/tools/include/uapi/linux/const.h +++ b/tools/include/uapi/linux/const.h @@ -28,4 +28,9 @@ #define _BITUL(x) (_UL(1) << (x)) #define _BITULL(x) (_ULL(1) << (x)) +#define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (typeof(x))(a) - 1) +#define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask)) + +#define __KERNEL_DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) + #endif /* _UAPI_LINUX_CONST_H */