Re: Change of set_fs() in uaccess.h breaks this header being self contained for x86 (4.14-rc1)
From: Stefan MÃtje
Date: Mon Oct 02 2017 - 08:16:21 EST
Am 30.09.2017 um 20:31 schrieb Al Viro:
> On Mon, Sep 18, 2017 at 08:32:19PM +0200, Stefan MÃtje wrote:
>> there is a change in Linus' mainline kernel
>> that changes the set_fs() macro into an inline function.
>> This breaks the build of an out of kernel driver I maintain with this
>> ./arch/x86/include/asm/uaccess.h: In function âset_fsâ:
>> ./arch/x86/include/asm/uaccess.h:31:9: error: dereferencing pointer to
>> incomplete type
>> set_fs() is referencing the "current" pointer which is of type "struct
>> task_struct" declared in include/linux/sched.h.
>> Before the change set_fs() was a macro. Because I don't use it it was of
>> no concern for me. But now the compiler needs to compile the inline
>> function set_fs() and fails.
>> Should I add the needed <linux/sched.h> myself in my code or will that
>> be changed / fixed in the <asm/uaccess.h> header by including the
>> missing header.
> Use linux/uaccess.h. That's the only file that has any business pulling
> Again, any code that includes asm/uaccess.h directly is wrong and will be
> hurt more and more as the time goes and more and more things get moved
> from arch-dependent into generic parts.
thank you for having a look at this. I had resent my question with a
changed subject here https://lkml.org/lkml/headers/2017/9/19/242 and it
had been answered.
I have changed the include to <linux/uaccess.h> in the meantime.