public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH v2 1/3] Fix compilation errors in crasher.c
@ 2014-02-21  0:05 Sweekar Pinto
  2014-02-21  0:05 ` [LTP] [PATCH v2 2/3] Fix passwordless ssh for network(ssh) dump test Sweekar Pinto
  2014-02-21  0:05 ` [LTP] [PATCH v2 3/3] Change crashkernel param to 256M@128M Sweekar Pinto
  0 siblings, 2 replies; 4+ messages in thread
From: Sweekar Pinto @ 2014-02-21  0:05 UTC (permalink / raw)
  To: ltp-list

-Conditional inclusion of asm.h for kernel > 3.4
-The owner field of proc_dir_entry has been removed from
 kernel ver 2.6.30
-SPIN_LOCK_UNLOCKED is depricated. DEFINE_SPINLOCK is
 available all the way back to 2.6.12, so no need of
 conditional declaration.

Signed-off-by: Sweekar Pinto <sweekar.pinto@oracle.com>
---
 testcases/kdump/lib/crasher/crasher.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/testcases/kdump/lib/crasher/crasher.c b/testcases/kdump/lib/crasher/crasher.c
index bc192dc..fe72986 100644
--- a/testcases/kdump/lib/crasher/crasher.c
+++ b/testcases/kdump/lib/crasher/crasher.c
@@ -25,7 +25,10 @@
 #include <linux/proc_fs.h>
 #include <linux/spinlock.h>
 #include <asm/uaccess.h>
-#include <asm/system.h>
+#include <linux/version.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0)
+# include <asm/system.h>
+#endif
 
 MODULE_LICENSE("GPL");
 
@@ -46,7 +49,7 @@ static int crasher_write(struct file *file, const char *buffer,
 			 unsigned long count, void *data)
 {
 	char value, *a;
-	spinlock_t mylock = SPIN_LOCK_UNLOCKED;
+	DEFINE_SPINLOCK(mylock);
 
 	/* grab the first byte the user gave us, ignore the rest */
 	if (copy_from_user(&value, buffer, 1))
@@ -91,10 +94,11 @@ int crasher_init(void)
 	if ((crasher_proc = create_proc_entry(CRASH, 0, NULL)) == NULL) {
 		return -ENOMEM;
 	}
-
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 30)
+	crasher_proc->owner = THIS_MODULE
+#endif
 	crasher_proc->read_proc = crasher_read;
 	crasher_proc->write_proc = crasher_write;
-	crasher_proc->owner = THIS_MODULE;
 	return 0;
 }
 
-- 
1.7.1


------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

end of thread, other threads:[~2014-02-25 16:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-21  0:05 [LTP] [PATCH v2 1/3] Fix compilation errors in crasher.c Sweekar Pinto
2014-02-21  0:05 ` [LTP] [PATCH v2 2/3] Fix passwordless ssh for network(ssh) dump test Sweekar Pinto
2014-02-21  0:05 ` [LTP] [PATCH v2 3/3] Change crashkernel param to 256M@128M Sweekar Pinto
2014-02-25 16:06   ` chrubis

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