* Change of set_fs() in uaccess.h breaks this header being self contained for x86 (4.14-rc1)
@ 2017-09-18 18:32 Stefan Mätje
2017-09-30 18:31 ` Al Viro
0 siblings, 1 reply; 3+ messages in thread
From: Stefan Mätje @ 2017-09-18 18:32 UTC (permalink / raw)
To: linux-kernel
Hi,
there is a change in Linus' mainline kernel
(https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/x86/include/asm/uaccess.h?id=6c51e67b64d169419fb13318035bb442f9176612)
that changes the set_fs() macro into an inline function.
This breaks the build of an out of kernel driver I maintain with this
message:
./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.
Thanks for any advice.
Best regards,
Stefan Mätje
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Change of set_fs() in uaccess.h breaks this header being self contained for x86 (4.14-rc1)
2017-09-18 18:32 Change of set_fs() in uaccess.h breaks this header being self contained for x86 (4.14-rc1) Stefan Mätje
@ 2017-09-30 18:31 ` Al Viro
2017-10-02 12:16 ` Stefan Mätje
0 siblings, 1 reply; 3+ messages in thread
From: Al Viro @ 2017-09-30 18:31 UTC (permalink / raw)
To: Stefan Mätje; +Cc: linux-kernel
On Mon, Sep 18, 2017 at 08:32:19PM +0200, Stefan Mätje wrote:
> Hi,
>
> there is a change in Linus' mainline kernel
> (https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/x86/include/asm/uaccess.h?id=6c51e67b64d169419fb13318035bb442f9176612)
> that changes the set_fs() macro into an inline function.
>
> This breaks the build of an out of kernel driver I maintain with this
> message:
>
> ./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
asm/uaccess.h.
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.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Change of set_fs() in uaccess.h breaks this header being self contained for x86 (4.14-rc1)
2017-09-30 18:31 ` Al Viro
@ 2017-10-02 12:16 ` Stefan Mätje
0 siblings, 0 replies; 3+ messages in thread
From: Stefan Mätje @ 2017-10-02 12:16 UTC (permalink / raw)
To: Al Viro; +Cc: linux-kernel
Am 30.09.2017 um 20:31 schrieb Al Viro:
> On Mon, Sep 18, 2017 at 08:32:19PM +0200, Stefan Mätje wrote:
>> Hi,
>>
>> there is a change in Linus' mainline kernel
>> (https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/x86/include/asm/uaccess.h?id=6c51e67b64d169419fb13318035bb442f9176612)
>> that changes the set_fs() macro into an inline function.
>>
>> This breaks the build of an out of kernel driver I maintain with this
>> message:
>>
>> ./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
> asm/uaccess.h.
>
> 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.
>
Hi,
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.
Best regards,
Stefan Mätje
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-10-02 12:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-18 18:32 Change of set_fs() in uaccess.h breaks this header being self contained for x86 (4.14-rc1) Stefan Mätje
2017-09-30 18:31 ` Al Viro
2017-10-02 12:16 ` Stefan Mätje
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.