From patchwork Fri Jan 1 20:22:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 355966 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 45855C433DB for ; Fri, 1 Jan 2021 20:23:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F25B922228 for ; Fri, 1 Jan 2021 20:23:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727310AbhAAUXe (ORCPT ); Fri, 1 Jan 2021 15:23:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727306AbhAAUXe (ORCPT ); Fri, 1 Jan 2021 15:23:34 -0500 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A955C061573 for ; Fri, 1 Jan 2021 12:22:53 -0800 (PST) Received: by mail-ej1-x62c.google.com with SMTP id n26so28859705eju.6 for ; Fri, 01 Jan 2021 12:22:53 -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=XFRO8dWkqZuNx2+BqBM7nkOyVcjRycuuFLB3OQd4b5s=; b=tR23Gmq7X4rzYqjBoQlyqiDcJ0i3QGeYVRejZG9ZnGfeHxhZz6M6mZo7/8OK6qF+Vw cLuvHbBwZfWnrPSqtOeHMj+/o7YUQE43bWu/+mTNFY1kq9RxZZjZEJN08vHpxct/jN2c LDyAFW46lLrH1hahOkLTRnRjxI1QCv/o7oaD6EHHcfQzBB9bDN5ZZvAENpoGbiyvMq+N l7P6UdF1dX+rjTxuT8XUkMQSUVjrnqpcXn06Gbwb3c+62LWHA8YmnyvmLt5CYDu1izSY SIXvnnamrWatQQqjQZ3qwsf6IzvbRqzxJ4kA8F0OiSwkWSK2/F9XybNDqpHWTtLuMckB 5BuQ== 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=XFRO8dWkqZuNx2+BqBM7nkOyVcjRycuuFLB3OQd4b5s=; b=gFYsmdiOw6GzyaPRA6leEYAuMojSFNnmkFtUZMhgsugNJpnaVwqJoRcOHPco8gDTUT /sy7EApZ2Rtkyqrs95gM5IjcuXHubU7LW1dLFWr7B792iXCcF8MBexZfxEg7TPzNslFq yLjHyUgDjnFS59s3Ydz1hXT3csjf5rYAh9a+gPqeEX2L2mNABoxQ06OtVWKdG1+F0LlU AcXAzvtGmSR8twvkHw3obAZHeY5+1KG4I70CmajXhWup7V/j1PYEzcLC/dntALv7xAZT 8HyYeFdTIJEbSw82yNcT1FgPkkzY7b00Ev+n0NaEb2VrlcObNWhf2KXHj2jloEbFhWQu eUvQ== X-Gm-Message-State: AOAM5319zy5Ou8+iMudPqrbU+uPwkyxl5TKWE8r4+eTN3x28jE9G7G7E +hS7bBNfnUJlfZeBKZQI8Yei0Qdc9BspyA== X-Google-Smtp-Source: ABdhPJxo/NUA5Ho1tEOZOCg7Q6G6Npp+a9JjZKenJ/wLisTBc4JCzHNg1xJnCca0Ouhg6uSE8qu1Cg== X-Received: by 2002:a17:906:478a:: with SMTP id cw10mr5256999ejc.462.1609532572266; Fri, 01 Jan 2021 12:22:52 -0800 (PST) Received: from localhost.localdomain ([62.201.25.198]) by smtp.gmail.com with ESMTPSA id e27sm21214898ejm.60.2021.01.01.12.22.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Jan 2021 12:22:51 -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:22:44 +0100 Message-Id: <20210101202245.27409-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.4.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 8938b76c4ee3..7857aa413627 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 0a4d73317759..622c78c821aa 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 87aa2a6d9125..cc453ed0e65e 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:22:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 356127 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 4BAB8C433E6 for ; Fri, 1 Jan 2021 20:23:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1B44922255 for ; Fri, 1 Jan 2021 20:23:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727314AbhAAUXf (ORCPT ); Fri, 1 Jan 2021 15:23:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727306AbhAAUXf (ORCPT ); Fri, 1 Jan 2021 15:23:35 -0500 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2AFEC061757 for ; Fri, 1 Jan 2021 12:22:54 -0800 (PST) Received: by mail-ej1-x62e.google.com with SMTP id 6so28865818ejz.5 for ; Fri, 01 Jan 2021 12:22:54 -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=ByznZ0Gm9SIrLSRoWGLA0mAxlw1e3MRKplvzmFgYNVA=; b=aQPXnLsuGXd+yvRf9eTDycWH+QuvKRDGypoSNTYcdq6hwxjaP+Fcb46KpIgEDxxtvT TXiljW8tmngl0sgMfjGFIjF2xuiEvndXfQF5nMxqUhE/y0ryAWEueqnnTJBH+C8NjYV0 GWqKQsKhJVuOYdZd9COTjHdpLZRY4LrQr62wMhtvTlLvoh4fbj5Wn7kKcdYco5nEXSyx 4/9j240vLCXphMGyFjZd8Tz9Stbagr3E3KhpKs3qDZq3M2r5poOHDvdujj8XtHbHwaqz vyDH/g4kMcU3Yswjy0tMiLNqap9rdT4XzmDPxaiIogBRPRs8eNfY7Wev9YLb9HgcDVxt X2JA== 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=ByznZ0Gm9SIrLSRoWGLA0mAxlw1e3MRKplvzmFgYNVA=; b=SYp6tmttIs//dhi68QLnOcIjsEyUJHRZxtoH4nQRRQ5jV1UphVSHRpI5pD26Jx3Bvm 9Py+f+vqiSnHQNNR5ee7zRudY0kWhARn2wDAGx7CqVCwVv1voETxvC0ugnm1+nVO/CSF OlPpWdfgJ5a0Xx9dvEb2J2NSqAwIkz8WdsQZJjtRA53JViis2Pf81w0OEctuzWq462DN dCJFMcoet8CEU5c9it2OAZU5sIPb/ZP+cCLby2GV1XW4wx9eGPwKzkAHmuoHfqZksL1R KG2AzOjWksCe6hevv28wC/G+Nb43oRpKmt4PI6TfV/1Z7EFDP36Xkel+/tiyBWgx3BZr XFoQ== X-Gm-Message-State: AOAM533ifp7H/q78YckEo9oXUE0EusGoV4Z3+gISWGfai/X49RqJYhYS 40qS4WlviV9aq9qpWLBEJK7x9wEUSi+L1A== X-Google-Smtp-Source: ABdhPJxArP0jKH7s4Hz8YJ1o+L+XXxWRWkBU9kKqToG76yVBSrHctWVFYTIrEiyeQrwhiZ4JejQMAQ== X-Received: by 2002:a17:906:6d47:: with SMTP id a7mr59416788ejt.340.1609532573427; Fri, 01 Jan 2021 12:22:53 -0800 (PST) Received: from localhost.localdomain ([62.201.25.198]) by smtp.gmail.com with ESMTPSA id e27sm21214898ejm.60.2021.01.01.12.22.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Jan 2021 12:22:52 -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:22:45 +0100 Message-Id: <20210101202245.27409-2-petr.vorel@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210101202245.27409-1-petr.vorel@gmail.com> References: <20210101202245.27409-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. 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 */