From patchwork Thu Oct 1 19:52:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 40628 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6568A398583E; Thu, 1 Oct 2020 19:53:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6568A398583E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1601581980; bh=PJc6n7J9BQbGIPDfHST0UIzxn6TBz7z+s2UfbvXIFRE=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=dT72tKWZHb9Lq0o5U191C2G3Y0a+V0TAieMalO8YyA/BfwrmOSgD5eUaR1ZVjgM/F oJ4YmMnWZIKS+kS59QoOwI2/0NSO+yZznWlocaQfzFAwbna1uGfKztFBRQALH4xH3T hjeaJj+hxXSmH4xYZu6eWs1hys1hNtBEZY0E7DpQ= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by sourceware.org (Postfix) with ESMTPS id 52B7C384607B for ; Thu, 1 Oct 2020 19:52:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 52B7C384607B Received: by mail-wr1-x443.google.com with SMTP id o5so29522wrn.13 for ; Thu, 01 Oct 2020 12:52:49 -0700 (PDT) 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=PJc6n7J9BQbGIPDfHST0UIzxn6TBz7z+s2UfbvXIFRE=; b=eZZtH/MQ157DOaUXKqgUyTYfvDzofV70SHXNkkM/2E9qVLFoejgUEYtGcSqpMOmade NgGjZrrG0WUq6G/s+GRZP17yxstClQ+7sPQq6YC7iO872CiUAGUUvD7EZeORkCU2K2B9 5JKoPs8SpN8wxuQibqk8X7MLxQk6KEonguJWWwt9ZxpJcPABUa3xpzm5rwjAP1kwDKY9 wtCBE2ojLxBzNpe0BzLLXQhPhWEuURYIUahBz4m0A6d5AmRkwmIeoqMTHiiVH2PAtIO4 dLgfBMB/YxKLVMwhDkH5svKG5A/PsOUv4cG4vdcpS10Qi9gxGrTKBlSH6/4ii7du1ZcT cEMA== X-Gm-Message-State: AOAM533gWuEKxTPTgiR2e6NClL+SQhFg7pj0SDxCnwRJA5bGamx+xRAh QFr91ZvpUyiUg+I8z5it17Y= X-Google-Smtp-Source: ABdhPJwrqilKtnbwHnlpFsAI1/LHcHpR2zkDVvpGWVT4AWBa0cBmXi7MfQjKytkpgKTcRoJVSkbCXA== X-Received: by 2002:a5d:40cd:: with SMTP id b13mr10840302wrq.297.1601581968344; Thu, 01 Oct 2020 12:52:48 -0700 (PDT) Received: from dell5510.suse.de ([62.201.25.198]) by smtp.gmail.com with ESMTPSA id o129sm1500691wmb.25.2020.10.01.12.52.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Oct 2020 12:52:47 -0700 (PDT) To: linux-kernel@vger.kernel.org Subject: [PATCH 1/1] uapi: Don't include in Date: Thu, 1 Oct 2020 21:52:31 +0200 Message-Id: <20201001195231.17226-1-petr.vorel@gmail.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Petr Vorel via Libc-alpha From: Petr Vorel Reply-To: Petr Vorel Cc: Florian Weimer , Michal Kubecek , Peter Korsgaard , libc-alpha@sourceware.org, musl@lists.openwall.com, Baruch Siach , Stephen Hemminger , linux-api@vger.kernel.org, "David S . Miller" Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" + update code where needed (include in code which included only to get struct sysinfo or SI_LOAD_SHIFT). The reason is to avoid indirect include when using some network headers: or others [1] -> -> . This indirect include causes redefinition of struct sysinfo when included both and some of network 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 [1] or , , , Suggested-by: Rich Felker Signed-off-by: Petr Vorel --- Hi, this looks to be long standing problem: python-psutil [2], iproute2 [3], even for glibc in the past [4] and it tried to be solved before [5]. This will require glibc fix after: +++ sysdeps/unix/sysv/linux/sys/sysinfo.h @@ -21,7 +21,7 @@ #include /* Get sysinfo structure from kernel header. */ -#include +#include __BEGIN_DECLS Kind regards, Petr [2] https://git.buildroot.net/buildroot/commit/?id=ab930190d7754b7f5fdda115b2069d00f1320861 [3] http://patchwork.ozlabs.org/project/netdev/patch/602128d22db86bd67e11dec8fe40a73832c222c9.1559230347.git.baruch@tkos.co.il/ [4] https://www.mail-archive.com/busybox@busybox.net/msg15363.html [5] https://lore.kernel.org/patchwork/patch/449607/ drivers/scsi/mpt3sas/mpt3sas_base.c | 2 +- fs/eventpoll.c | 2 +- fs/proc/meminfo.c | 2 +- include/linux/mm.h | 1 + include/uapi/linux/kernel.h | 2 -- kernel/debug/kdb/kdb_main.c | 2 +- kernel/sys.c | 2 +- mm/page_alloc.c | 2 +- net/ipv4/inetpeer.c | 2 +- net/rds/ib_recv.c | 2 +- 10 files changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c index 8062bd99add8..6c84c92e5112 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_base.c +++ b/drivers/scsi/mpt3sas/mpt3sas_base.c @@ -43,7 +43,7 @@ * USA. */ -#include +#include #include #include #include diff --git a/fs/eventpoll.c b/fs/eventpoll.c index 8107e06d7f6f..a4c2e199f9ea 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c @@ -7,7 +7,7 @@ */ #include -#include +#include #include #include #include diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c index 887a5532e449..c80e42e1eaf9 100644 --- a/fs/proc/meminfo.c +++ b/fs/proc/meminfo.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include #include -#include +#include #include #include #include diff --git a/include/linux/mm.h b/include/linux/mm.h index b2f370f0b420..4ac1af86db59 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -7,6 +7,7 @@ #ifdef __KERNEL__ #include +#include #include #include #include diff --git a/include/uapi/linux/kernel.h b/include/uapi/linux/kernel.h index 0ff8f7477847..e95f8cd801cd 100644 --- a/include/uapi/linux/kernel.h +++ b/include/uapi/linux/kernel.h @@ -2,8 +2,6 @@ #ifndef _UAPI_LINUX_KERNEL_H #define _UAPI_LINUX_KERNEL_H -#include - /* * 'kernel.h' contains some often-used function prototypes etc */ diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c index 5c7949061671..3193b9dd90e8 100644 --- a/kernel/debug/kdb/kdb_main.c +++ b/kernel/debug/kdb/kdb_main.c @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/kernel/sys.c b/kernel/sys.c index ab6c409b1159..9a3ee7ba84a7 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/mm/page_alloc.c b/mm/page_alloc.c index fab5e97dc9ca..42e14c5392a6 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/net/ipv4/inetpeer.c b/net/ipv4/inetpeer.c index ff327a62c9ce..1c7385dab1c4 100644 --- a/net/ipv4/inetpeer.c +++ b/net/ipv4/inetpeer.c @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/net/rds/ib_recv.c b/net/rds/ib_recv.c index 694d411dc72f..81425a2863e0 100644 --- a/net/rds/ib_recv.c +++ b/net/rds/ib_recv.c @@ -30,7 +30,7 @@ * SOFTWARE. * */ -#include +#include #include #include #include