mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: "Stefan Mätje" <Stefan.Maetje@esd.eu>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: Change of set_fs() in uaccess.h breaks this header being self contained for x86 (4.14-rc1)
Date: Sat, 30 Sep 2017 19:31:24 +0100	[thread overview]
Message-ID: <20170930183124.GF21978@ZenIV.linux.org.uk> (raw)
In-Reply-To: <ca709cb0-7151-cceb-be60-1a8ceccca259@esd.eu>

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.

  reply	other threads:[~2017-09-30 18:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-18 18:32 Stefan Mätje
2017-09-30 18:31 ` Al Viro [this message]
2017-10-02 12:16   ` Stefan Mätje

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170930183124.GF21978@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=Stefan.Maetje@esd.eu \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome