public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] linux/uaccess.h needs to #include linux/kernel.h for might_sleep()
@ 2011-06-15  0:22 David Howells
  2011-06-20 23:42 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: David Howells @ 2011-06-15  0:22 UTC (permalink / raw)
  To: torvalds; +Cc: akpm, linux-am33-list, linux-kernel, David Howells

linux/uaccess.h needs to #include linux/kernel.h to get might_sleep() otherwise
it fails to build on MN10300 allyesconfig.  This fails in a few places with
messages like the following:

In file included from security/keys/trusted.c:14:
include/linux/uaccess.h: In function '__copy_from_user_nocache':
include/linux/uaccess.h:52: error: implicit declaration of function 'might_sleep'

Signed-off-by: David Howells <dhowells@redhat.com>
---

 include/linux/uaccess.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h
index 5ca0951..ab540ed 100644
--- a/include/linux/uaccess.h
+++ b/include/linux/uaccess.h
@@ -2,6 +2,7 @@
 #define __LINUX_UACCESS_H__
 
 #include <linux/preempt.h>
+#include <linux/kernel.h>
 #include <asm/uaccess.h>
 
 /*


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] linux/uaccess.h needs to #include linux/kernel.h for might_sleep()
  2011-06-15  0:22 [PATCH] linux/uaccess.h needs to #include linux/kernel.h for might_sleep() David Howells
@ 2011-06-20 23:42 ` Andrew Morton
  2011-06-21  9:27   ` David Howells
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2011-06-20 23:42 UTC (permalink / raw)
  To: David Howells; +Cc: torvalds, linux-am33-list, linux-kernel

On Wed, 15 Jun 2011 01:22:10 +0100
David Howells <dhowells@redhat.com> wrote:

> linux/uaccess.h needs to #include linux/kernel.h to get might_sleep() otherwise
> it fails to build on MN10300 allyesconfig.  This fails in a few places with
> messages like the following:

uaccess.h doesn't textually refer to might_sleep().

> In file included from security/keys/trusted.c:14:
> include/linux/uaccess.h: In function '__copy_from_user_nocache':
> include/linux/uaccess.h:52: error: implicit declaration of function 'might_sleep'

This happened because of arch/mn10300/include/asm/uaccess.h's

#define __copy_from_user(to, from, n)			\
({							\
	might_sleep();					\
	__copy_from_user_inatomic((to), (from), (n));	\
})

>  include/linux/uaccess.h |    1 +

So I'd suggest that patching the arch header file is the appropriate fix.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] linux/uaccess.h needs to #include linux/kernel.h for might_sleep()
  2011-06-20 23:42 ` Andrew Morton
@ 2011-06-21  9:27   ` David Howells
  0 siblings, 0 replies; 3+ messages in thread
From: David Howells @ 2011-06-21  9:27 UTC (permalink / raw)
  To: Andrew Morton; +Cc: dhowells, torvalds, linux-am33-list, linux-kernel

Andrew Morton <akpm@linux-foundation.org> wrote:

> uaccess.h doesn't textually refer to might_sleep().

Good point.  Whilst the error occurs in linux/uaccess.h, the actual problem is
in a #define in asm/uaccess.h.

David

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-06-21  9:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-15  0:22 [PATCH] linux/uaccess.h needs to #include linux/kernel.h for might_sleep() David Howells
2011-06-20 23:42 ` Andrew Morton
2011-06-21  9:27   ` David Howells

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox