Skip to contentSkip to conversation

PMU: don't lock_kernel()

RFC In review Johannes Berg 2 participants 2 messages Nov 8, 2007 – Nov 11, 2007 Linux for power macintosh

lore
Share & tools
lore
#0 lore raw

RFC 1/1 PMU: don't lock_kernel()

I see nothing that this lock_kernel() actually protects against so remove it.

Cc Benjamin Herrenschmidt <[email protected]>
---
 drivers/macintosh/via-pmu.c |    3 ---
 1 file changed, 3 deletions(-)
drivers/macintosh/via-pmu.c +0 -3
@@ -33,7 +33,6 @@
 #include <linux/adb.h>
 #include <linux/pmu.h>
 #include <linux/cuda.h>
-#include <linux/smp_lock.h>
 #include <linux/module.h>
 #include <linux/spinlock.h>
 #include <linux/pm.h>
@@ -2436,7 +2435,6 @@ pmu_release(struct inode *inode, struct 
 	struct pmu_private *pp = file->private_data;
 	unsigned long flags;
 
-	lock_kernel();
 	if (pp != 0) {
 		file->private_data = NULL;
 		spin_lock_irqsave(&all_pvt_lock, flags);
@@ -2450,7 +2448,6 @@ pmu_release(struct inode *inode, struct 
 
 		kfree(pp);
 	}
-	unlock_kernel();
 	return 0;
 }
 
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Johannes Berg

I see nothing that this lock_kernel() actually protects against so remove it.

Quoted 31 lines
---
 drivers/macintosh/via-pmu.c |    3 ---
 1 file changed, 3 deletions(-)
drivers/macintosh/via-pmu.c +0 -3
@@ -33,7 +33,6 @@
 #include <linux/adb.h>
 #include <linux/pmu.h>
 #include <linux/cuda.h>
-#include <linux/smp_lock.h>
 #include <linux/module.h>
 #include <linux/spinlock.h>
 #include <linux/pm.h>
@@ -2436,7 +2435,6 @@ pmu_release(struct inode *inode, struct 
 	struct pmu_private *pp = file->private_data;
 	unsigned long flags;
 
-	lock_kernel();
 	if (pp != 0) {
 		file->private_data = NULL;
 		spin_lock_irqsave(&all_pvt_lock, flags);
@@ -2450,7 +2448,6 @@ pmu_release(struct inode *inode, struct 
 
 		kfree(pp);
 	}
-	unlock_kernel();
 	return 0;
 }