From patchwork Mon Sep 24 15:52:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 10612657 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1370B13A4 for ; Mon, 24 Sep 2018 15:56:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E91DD2A202 for ; Mon, 24 Sep 2018 15:56:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DCBE02A208; Mon, 24 Sep 2018 15:56:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6F7212A202 for ; Mon, 24 Sep 2018 15:56:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731646AbeIXV6p (ORCPT ); Mon, 24 Sep 2018 17:58:45 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:56468 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730347AbeIXV6H (ORCPT ); Mon, 24 Sep 2018 17:58:07 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 42Jpgm09tlz9ttRx; Mon, 24 Sep 2018 17:55:16 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id VEOlbjB9qRxB; Mon, 24 Sep 2018 17:55:15 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 42Jpgl6nlPz9ttRs; Mon, 24 Sep 2018 17:55:15 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 742AA8B7C4; Mon, 24 Sep 2018 17:55:16 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id te0BDsoL9cNA; Mon, 24 Sep 2018 17:55:16 +0200 (CEST) Received: from PO15451.localdomain (po15451.idsi0.si.c-s.fr [172.25.231.3]) by messagerie.si.c-s.fr (Postfix) with ESMTP id A44228B7BA; Mon, 24 Sep 2018 17:55:15 +0200 (CEST) Received: by pc16082vm.idsi0.si.c-s.fr (Postfix, from userid 0) id A7C2270AD4; Mon, 24 Sep 2018 15:52:21 +0000 (UTC) Message-Id: <72d3e8c38f729dc22cb3235319b72f96190e01ee.1537802981.git.christophe.leroy@c-s.fr> In-Reply-To: References: From: Christophe Leroy Subject: [RFC PATCH v1 1/9] timer: fix circular header dependency To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , aneesh.kumar@linux.vnet.ibm.com, npiggin@gmail.com, Thomas Gleixner , Alexander Viro , John Stultz , Stephen Boyd Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-fsdevel@vger.kernel.org Date: Mon, 24 Sep 2018 15:52:21 +0000 (UTC) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When switching powerpc to CONFIG_THREAD_INFO_IN_TASK, include/sched.h has to be included in asm/smp.h for the following change, in order to avoid uncomplete definition of task_struct: -#define raw_smp_processor_id() (current_thread_info()->cpu) +#define raw_smp_processor_id() (current->cpu) But this generates the following compilation error, due to circular header dependency. CC kernel/time/alarmtimer.o In file included from ./arch/powerpc/include/asm/smp.h:31, from ./include/linux/smp.h:64, from ./include/linux/percpu.h:7, from ./include/linux/hrtimer.h:22, from kernel/time/alarmtimer.c:19: ./include/linux/sched.h:558:19: error: field 'dl_timer' has incomplete type struct hrtimer dl_timer; ^~~~~~~~ ./include/linux/sched.h:567:17: error: field 'inactive_timer' has incomplete type struct hrtimer inactive_timer; ^~~~~~~~~~~~~~ make[1]: *** [kernel/time/alarmtimer.o] Error 1 make: *** [kernel/time/alarmtimer.o] Error 2 CC fs/timerfd.o In file included from ./arch/powerpc/include/asm/smp.h:31, from ./include/linux/smp.h:64, from ./include/linux/percpu.h:7, from ./include/linux/hrtimer.h:22, from ./include/linux/alarmtimer.h:6, from fs/timerfd.c:12: ./include/linux/sched.h:558:19: error: field 'dl_timer' has incomplete type struct hrtimer dl_timer; ^~~~~~~~ ./include/linux/sched.h:567:17: error: field 'inactive_timer' has incomplete type struct hrtimer inactive_timer; ^~~~~~~~~~~~~~ make[1]: *** [fs/timerfd.o] Error 1 make: *** [fs/timerfd.o] Error 2 This patch fixes it by including linux/hrtimer.h after linux/sched.h Signed-off-by: Christophe Leroy --- Should it be fixed in powerpc instead ? In that case, how ? Any idea ? fs/timerfd.c | 2 +- kernel/time/alarmtimer.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/timerfd.c b/fs/timerfd.c index d69ad801eb80..0fc01b241382 100644 --- a/fs/timerfd.c +++ b/fs/timerfd.c @@ -9,12 +9,12 @@ * */ -#include #include #include #include #include #include +#include #include #include #include diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c index fa5de5e8de61..5fb75c9b3f06 100644 --- a/kernel/time/alarmtimer.c +++ b/kernel/time/alarmtimer.c @@ -16,11 +16,11 @@ * published by the Free Software Foundation. */ #include -#include #include #include #include #include +#include #include #include #include