Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp732945pxu; Thu, 15 Oct 2020 15:21:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyaR2OA5WiaOji3d4Br2YMo+i/1G38MPLFOVPRlSSM5OrJbJwr24JTqKz04CB7A/8jWlYXX X-Received: by 2002:a17:907:20d9:: with SMTP id qq25mr536440ejb.149.1602800467253; Thu, 15 Oct 2020 15:21:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602800467; cv=none; d=google.com; s=arc-20160816; b=Ax36DSztYgnSTVN00rAcW/tIV3hqymgGg1z/5FqPTs9gA3p0BtAM9k22J4qTtpuk+f dckJtpvGcXh8dHehSPm0bgVig/9QJPXzfgohOpOC+hGLzXLHUWij4l2oExBZH8vpBhL8 /rrze4eJFJoonK4pcdjJeP7LkprMB9lkREIQWMoaXzamzwSGYoxEZOwLW/JISuK7suub AydyHFrZYuv+l+lxs9uWD14nYue/WKceKrukeYHVzFYjmrZa4PnJ3u7bSwbTuS6pVOlW HuCsZHUxAC7PlgJyfYLMk2AD4qs8YFyNlywfxPjwq3eViAXFK9radtjuSz1yw0W9KjNL oIsg== 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=LtnFpFZ6Eux9pZL1tvnlYFv1q6tc9+T02TAa4IMAPEs=; b=jO4C3eskCRhDW5g7hUl7bvWmGYsq5eEHeg4Nl1GeyMe4EMYncIdbtW309/i9nM1DlY aXSHqJ/HBj3xp7y02Iff6BjZkklf56UmzMGfKhunrltjKr/vB7288Iz2IiVDXwsiug1t KGQjv3JKac5cm+eXkpeKSHe+Sm9BGFhS3ODFi+0qf6YPZtLIkdpRlaRVvcFEMFx4bkH5 r2sFckkO7iL7AsDdq90hZn9bmdL6BGLMJFDWIQATxbK13WqBBYYHoX8G2DEAE5nJqVE5 r+/PF3enooySFWyXxRjX5cR35ShfnuAWUpSFKhg5yZx/cv0Mdp/IwuAXZQFW33H9+8hZ oSSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MDVAXh5L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g9si214200edr.404.2020.10.15.15.20.43; Thu, 15 Oct 2020 15:21:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MDVAXh5L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S2391299AbgJOTAY (ORCPT + 99 others); Thu, 15 Oct 2020 15:00:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391292AbgJOTAX (ORCPT ); Thu, 15 Oct 2020 15:00:23 -0400 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0AF87C061755; Thu, 15 Oct 2020 12:00:22 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id g12so4910497wrp.10; Thu, 15 Oct 2020 12:00:21 -0700 (PDT) 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=LtnFpFZ6Eux9pZL1tvnlYFv1q6tc9+T02TAa4IMAPEs=; b=MDVAXh5LbJMffglNpS5omNCG8K4I1h2dvPDEEB17Kpi3RMF/07K019/kC99g2XepjS xPikUHiTQ3NtAwmmJd2DF7JQYpAgsVTCjYy2VOe2yZMBV5AF3TOOS8XUqizE/oq7BR/V 03h1ijB8Bp6LLYbzvZIfoeY11WsPEfkwwKP8VexOV1lltRQI9QE+7NEB8Nnr7j0mYKEI vl7H8OrzhRX4va2cDgYvZqrvawG80knndqet4fY4LPH68BrCrOz8lFHJtPvt7tveTpD5 pXXB8goZWxkuVlFVmsBMf8jTnbuNVdxueGe1v1lRki2DEu5vDA+fcWNTfGRnoDYQcVqn GCkw== 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=LtnFpFZ6Eux9pZL1tvnlYFv1q6tc9+T02TAa4IMAPEs=; b=PbooII6D+XTVQuezOY8l6vbUNRRvMDkLiQMU2ywKy+JwPmqSfPhw3yVOxnYHfpWCNI ug44pEC4Vh3v+zT16dbZ8i+98f/K+edQi4aa32d1lso6QrfqUfVPPja1ip9SS+xh4Vku twCmoS+OjmI9A/GO4JtDJ5CDyq4DwfPgYedc3k/I+Uh3PSh/Lldy0WnZ6/IYM4Z4Nrvg TL6U21h1JtVJ9D4YVfBqASTqkAhDIuAKifhRFmMyetpunaadeNXvsMRk9/re2EqCGYIP ZbcWtSePTvfoIQN/gRAX1vIHAPXWuWeyZ3qhYCTWU/AOhqMw0XaJyL03ypUOhS/5htj9 GREw== X-Gm-Message-State: AOAM5334YCYc8+0K7fDQN2/zbIjcG1R/x2eP7lokuOzGum8uPjWmAmQO wIpGdpIZ2BI6P9PB5+Vjc32jo1mjkK01gQ== X-Received: by 2002:a5d:6110:: with SMTP id v16mr6312237wrt.219.1602788420527; Thu, 15 Oct 2020 12:00:20 -0700 (PDT) Received: from dell5510.suse.de ([62.201.25.198]) by smtp.gmail.com with ESMTPSA id r3sm261146wrm.51.2020.10.15.12.00.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Oct 2020 12:00:19 -0700 (PDT) From: Petr Vorel To: linux-kernel@vger.kernel.org Cc: Petr Vorel , Rich Felker , musl@lists.openwall.com, Peter Korsgaard , Baruch Siach , Florian Weimer , linux-api@vger.kernel.org, libc-alpha@sourceware.org Subject: [PATCH v3 1/1] uapi: Move constants from to Date: Thu, 15 Oct 2020 21:00:13 +0200 Message-Id: <20201015190013.8901-1-petr.vorel@gmail.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org and include in UAPI headers instead of . 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 Suggested-by: Rich Felker Signed-off-by: Petr Vorel --- Changes v2->v3: * Move things to instead of creating new header . 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 b4f2d134e713..0a9cced74e6d 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 eac8a6a648ea..7ba6d3b9cdec 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 -- 2.28.0