Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp13933457pxu; Mon, 4 Jan 2021 08:18:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJyd1JQ8TH/c+QSVCPla2ooZ5+egX4tyrMtMUGH6semPCjJJelwB1o49pIGHcVukDjkDGzTU X-Received: by 2002:a50:fc0d:: with SMTP id i13mr64356039edr.171.1609777112807; Mon, 04 Jan 2021 08:18:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609777112; cv=none; d=google.com; s=arc-20160816; b=e5DoP82AHj0SyLatQwOrVOIFwXHguvcicWjxq4YtKHsdRbijUXdsDNh78JSE9Kjw50 ZIVh9z0/1prrRdNQPKxrvX2rfaIYa8o4GW4xJsguUNd5cow6AFV6GZO4KmhjA0b8BXL1 BmrK5OUSDYRaOxcRnwJaaNC+De/Y5rpq33Y1XJXCFexHPCjCcg7Sad8VXoBefu6pplJW s8HGrE4j4tZpj2wyUuRMvY7iBhJCCp1bIRCxxbdh70O9APLcqPzih+5zY/OIrEkRrnwM 9FK9uc/7+FA/I2fAyIuk9erb8vU/jlvVQN0PXIlnKfre3BqGXynLBYeSsjveqmVvE7ue rRew== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=X+EnV2MvQ0NiHO8V7KCOsL91vqZqrBKJGYX8al3qqZ4=; b=N+ocsbF5vlGLFHeMXioPfBb2jD6biOA0CVXfN/FNyYoaN2aWPADKjQy8+KPmHiisPt 8qYt4voYLPPtzWJLt1mRH1Yz5jhkS7r23VOzefSNDw4tuIPnJeDczjspKXDwxJ0ongSk 1QmQQQYbX/KqQVbQigK+0zNHPc80+ZTqDS87AW/MRS2EXs0Kpv4leOvQvXP7goqfnG5J 0XYX7fqnTMM34JdulxSie0Y6D0HCjpTl0ByATIQp5PD0wCx2gf07B5keiINaBkNm8na/ NWo9NMSJCQ79B5XW+VMKK6iveEM+aFxsK7M5gpf4PrNwHPM0rSuKLA2N7Ee+QtZ3Gpdb HEbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Yfj3YR/F"; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id us12si29829068ejb.252.2021.01.04.08.18.09; Mon, 04 Jan 2021 08:18:32 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b="Yfj3YR/F"; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727984AbhADP7e (ORCPT + 99 others); Mon, 4 Jan 2021 10:59:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:36580 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727971AbhADP7c (ORCPT ); Mon, 4 Jan 2021 10:59:32 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4F2662250F; Mon, 4 Jan 2021 15:58:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609775910; bh=hwUyeNb9NGkxfnDkBWhFxs4Fh1afjms4BVH6fV3Jk0I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Yfj3YR/FCoVLitocwoucsCup9+3vcDFKXaZzFF+kQ5VOib18orfHRpdUqIdoRS6kM qCiT/ejTKPzNByU1DSMCRqnGGeUOBcKzGx4B5PwlX8hc8tMDzFjFO3RlQPgz6ionYI lgrTS7UY8bhEb+Mz+gX0sPoIK8DxIah5PTyvzyRo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Petr Vorel , Rich Felker , Rich Felker , Peter Korsgaard , Baruch Siach , Florian Weimer , Andrew Morton , Linus Torvalds Subject: [PATCH 4.19 08/35] uapi: move constants from to Date: Mon, 4 Jan 2021 16:57:11 +0100 Message-Id: <20210104155703.796490875@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210104155703.375788488@linuxfoundation.org> References: <20210104155703.375788488@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Petr Vorel commit a85cbe6159ffc973e5702f70a3bd5185f8f3c38d upstream. 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 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 Signed-off-by: Greg Kroah-Hartman --- 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(-) --- 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 */ --- 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 --- 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 */ --- 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 --- 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. */ --- 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 --- 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 --- 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