Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp13927801pxu; Mon, 4 Jan 2021 08:10:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJy7DSZq7WgqUw26pl7b/OBD5l/3dL31XRQas/meZODdjuP4wBOAMgKK6KqcFi1tUx/cXZCB X-Received: by 2002:a17:906:4c85:: with SMTP id q5mr66864864eju.375.1609776647635; Mon, 04 Jan 2021 08:10:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609776647; cv=none; d=google.com; s=arc-20160816; b=WUO63TtGk0hfmyFUDBoj8rWWyxvUd8dygSa9BO6QvqVIq0in+FnYzJrj5iITKutOSc XMh83TtBygdgHyNeivxB4fd5uBYkSD1utiUt2Mvj54aZ5ShkCn3nh6kQw5BiXR0TfgxR wGVcslX/YrGPdMHCPwfdc09yFb4yAFFGNVMFluMrrBc6RwIaJ0cKNKCyQLjOM88p60rn O18syICqy11vRVwz2iXnDWi/bxmCKi4WAdGVLkKM1rq40VveUs8NUBzliIuRMjnvxsH1 3aW/A4gkChT/lbqkmyvol5vZ0ITsUzKMYx+QGC14aNfp3HdzwSrtcCYhlxpgQXF2JxSK 1WLQ== 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=Y+OS0yXGgkoxFb/iAq+oGWzksqfcBP63ezVslzUWHM3FyYzbBirMw4rMHRJWD6DMIK XH/MbSms5+n+luC8Tqr1fen9gr2so9I2FiIKDp4aawgBEdT7L0+um8zNBKAH8oUZOhtI wUccM1uc8YGar+JshTQ5gM9UYeEuiFpDdGKpQUiYeDdv5TOMoJ0nWbWWQMqsIZogBWNC 2j64X2SF0s0kYVDGUe3D5STNaI9O4E5JbJewjpEBTqzaVJ50ss43GO7cbFN7KtDGU58x IzaW9nGgkVm9T5Vc/QGWVdB+W4KOfA+qkgddX1HSlJym2P8hLZPHc2BbAkfOVW22EH7e Lnog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0EvYAzp5; 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 k17si28443556ejc.181.2021.01.04.08.10.24; Mon, 04 Jan 2021 08:10:47 -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=0EvYAzp5; 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 S1729202AbhADQHs (ORCPT + 99 others); Mon, 4 Jan 2021 11:07:48 -0500 Received: from mail.kernel.org ([198.145.29.99]:38936 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728710AbhADQB6 (ORCPT ); Mon, 4 Jan 2021 11:01:58 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6202520769; Mon, 4 Jan 2021 16:01:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609776102; bh=hwUyeNb9NGkxfnDkBWhFxs4Fh1afjms4BVH6fV3Jk0I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0EvYAzp5s2uWLsz4J+5ti9gv4SyP3JBaeIhoBXrukALh3aHpEcF3QLYVVru0G9MlQ k54CBupm1wMnW+Q3svdIkNgr/b7XIvT8XONoMdp8g6chdcYdyKRzhw+K03WtXZNkSD tAygkbdZJUSsg/SlRvg3UWI1CjbisPdW96IwhESg= 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 5.10 22/63] uapi: move constants from to Date: Mon, 4 Jan 2021 16:57:15 +0100 Message-Id: <20210104155709.897542552@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210104155708.800470590@linuxfoundation.org> References: <20210104155708.800470590@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