From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Subject: Re: [PATCH v2 1/1] headers: fix circular dependency between linux/sched.h and linux/wait.h Date: Mon, 21 Feb 2011 16:54:37 +0100 Message-ID: <1298303677.24121.1.camel@twins> References: <1298299131-17695-1-git-send-email-dacohen@gmail.com> <1298299131-17695-2-git-send-email-dacohen@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Return-path: In-Reply-To: <1298299131-17695-2-git-send-email-dacohen@gmail.com> Sender: linux-kernel-owner@vger.kernel.org To: David Cohen Cc: linux-kernel@vger.kernel.org, mingo@elte.hu, linux-omap@vger.kernel.org, linux-media@vger.kernel.org, Alexey Dobriyan List-Id: linux-omap@vger.kernel.org On Mon, 2011-02-21 at 16:38 +0200, David Cohen wrote: > Currently sched.h and wait.h have circular dependency between both. > wait.h defines macros wake_up*() which use macros TASK_* defined by > sched.h. But as sched.h indirectly includes wait.h, such wait.h header > file can't include sched.h too. The side effect is when some file > includes wait.h and tries to use its wake_up*() macros, it's necessary > to include sched.h also. > This patch moves all TASK_* macros from linux/sched.h to a new header > file linux/task_state.h. This way, both sched.h and wait.h can include > task_state.h and fix the circular dependency. No need to include sched.h > anymore when wake_up*() macros are used. I think Alexey already told you what you done wrong. Also, I really don't like the task_state.h header, it assumes a lot of things it doesn't include itself and only works because its using macros and not inlines at it probably should.