login
Header Space

 
 

[PATCH 2/6] Add semaphore.h to kernel_lock.c

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <linux-kernel@...>, <sfr@...>, <lenb@...>, <dhowells@...>, <peterz@...>, <mingo@...>, <harvey.harrison@...>
Cc: Matthew Wilcox <matthew@...>, Matthew Wilcox <willy@...>
Date: Friday, March 14, 2008 - 4:44 pm

kernel_lock.c uses DECLARE_MUTEX, up() and down() without explicitly
including asm/semaphore.h.  This is fragile and leaves it vulnerable
to breakage during header reorganisations.

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
---
 lib/kernel_lock.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/lib/kernel_lock.c b/lib/kernel_lock.c
index 812dbf0..fbc11a3 100644
--- a/lib/kernel_lock.c
+++ b/lib/kernel_lock.c
@@ -8,6 +8,7 @@
 #include <linux/smp_lock.h>
 #include <linux/module.h>
 #include <linux/kallsyms.h>
+#include <asm/semaphore.h>
 
 /*
  * The 'big kernel semaphore'
-- 
1.5.4.3

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Updated generic semaphore patch set, Matthew Wilcox, (Fri Mar 14, 4:42 pm)
Re: Updated generic semaphore patch set, Harvey Harrison, (Fri Mar 14, 5:23 pm)
Re: Updated generic semaphore patch set, Johannes Weiner, (Fri Mar 14, 7:37 pm)
Re: Updated generic semaphore patch set, Harvey Harrison, (Fri Mar 14, 4:59 pm)
[PATCH 1/6] Fix quota.h includes, Matthew Wilcox, (Fri Mar 14, 4:44 pm)
[PATCH 2/6] Add semaphore.h to kernel_lock.c, Matthew Wilcox, (Fri Mar 14, 4:44 pm)
[PATCH 3/6] Generic semaphore implementation, Matthew Wilcox, (Fri Mar 14, 4:44 pm)
[PATCH 4/6] Introduce down_killable(), Matthew Wilcox, (Fri Mar 14, 4:44 pm)
[PATCH 5/6] Add down_timeout and change ACPI to use it, Matthew Wilcox, (Fri Mar 14, 4:44 pm)
[PATCH 6/6] Simplify semaphore implementation, Matthew Wilcox, (Fri Mar 14, 4:44 pm)
speck-geostationary