[PATCH] raw: Remove the BKL from raw_open

From: John Kacur
Date: Sun Oct 18 2009 - 16:45:34 EST


The BKL was pushed into raw_open with
commit c0bed680f0ca603864375ed5f9fed4296a53aa62

Jonathan's comments were " Put explicit lock_kernel() calls into raw_open(), even though the existing locking looks adequate."

I have to agree, the raw_mutex should provide all the protection needed here.

Signed-off-by: John Kacur <jkacur@xxxxxxxxxx>
---
drivers/char/raw.c | 4 ----
1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/drivers/char/raw.c b/drivers/char/raw.c
index 64acd05..d9cfad1 100644
--- a/drivers/char/raw.c
+++ b/drivers/char/raw.c
@@ -19,7 +19,6 @@
#include <linux/cdev.h>
#include <linux/device.h>
#include <linux/mutex.h>
-#include <linux/smp_lock.h>

#include <asm/uaccess.h>

@@ -54,7 +53,6 @@ static int raw_open(struct inode *inode, struct file *filp)
return 0;
}

- lock_kernel();
mutex_lock(&raw_mutex);

/*
@@ -81,7 +79,6 @@ static int raw_open(struct inode *inode, struct file *filp)
bdev->bd_inode->i_mapping;
filp->private_data = bdev;
mutex_unlock(&raw_mutex);
- unlock_kernel();
return 0;

out2:
@@ -90,7 +87,6 @@ out1:
blkdev_put(bdev, filp->f_mode);
out:
mutex_unlock(&raw_mutex);
- unlock_kernel();
return err;
}

--
1.6.0.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/