Re: [PATCH 1/1] headers: fix circular dependency between linux/sched.h and linux/wait.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 21, 2011 at 1:05 PM, Alexey Dobriyan <adobriyan@xxxxxxxxx> wrote:
> On Mon, Feb 21, 2011 at 12:20 PM, David Cohen <dacohen@xxxxxxxxx> 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_sched.h. This way, both sched.h and wait.h can include
>> task_sched.h and fix the circular dependency. No need to include sched.h
>> anymore when wake_up*() macros are used.
>
> Just include <linux/sched.h> in your driver.

Sounds a reasonable solution for me.

> This include splitting in small pieces is troublesome as well.

But I disagree it's troublesome. It's transparent to everyone else.
The only side effect is to not have to include sched.h when using a
macro define on wait.h.

>
> Why are you moving TASK_COMM_LEN?

This one can be moved back to sched.h.

Br,

David

>
>> Âinclude/linux/sched.h   Â|  61 +-----------------------------------------
>> Âinclude/linux/task_sched.h | Â 64 ++++++++++++++++++++++++++++++++++++++++++++
>> Âinclude/linux/wait.h    |  Â1 +
>> Â3 files changed, 66 insertions(+), 60 deletions(-)
>> Âcreate mode 100644 include/linux/task_sched.h
>
>> --- a/include/linux/sched.h
>> +++ b/include/linux/sched.h
>> +#include <linux/task_sched.h>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux