mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alessio Igor Bogani <abogani@texware.it>
To: linux-usb@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
	Alessio Igor Bogani <abogani@texware.it>,
	Greg Kroah-Hartman <gregkh@suse.de>,
	Johan Hovold <jhovold@gmail.com>, Alan Cox <alan@linux.intel.com>,
	Daniel Mack <daniel@caiaq.de>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH] USB: ftdi_sio: Remove BKL
Date: Tue,  2 Feb 2010 14:58:14 +0100	[thread overview]
Message-ID: <1265119094-3356-1-git-send-email-abogani@texware.it> (raw)

Seems to me that BKL don't protect nothing here anymore. So I would want suggest to remove it.

Signed-off-by: Alessio Igor Bogani <abogani@texware.it>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Johan Hovold <jhovold@gmail.com>
Cc: Alan Cox <alan@linux.intel.com>
Cc: Daniel Mack <daniel@caiaq.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 drivers/usb/serial/ftdi_sio.c |    7 -------
 1 files changed, 0 insertions(+), 7 deletions(-)

diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 216f187..592dc5f 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -33,7 +33,6 @@
 #include <linux/errno.h>
 #include <linux/init.h>
 #include <linux/slab.h>
-#include <linux/smp_lock.h>
 #include <linux/tty.h>
 #include <linux/tty_driver.h>
 #include <linux/tty_flip.h>
@@ -1210,7 +1209,6 @@ static int set_serial_info(struct tty_struct *tty,
 	if (copy_from_user(&new_serial, newinfo, sizeof(new_serial)))
 		return -EFAULT;
 
-	lock_kernel();
 	old_priv = *priv;
 
 	/* Do error checking and permission checking */
@@ -1218,7 +1216,6 @@ static int set_serial_info(struct tty_struct *tty,
 	if (!capable(CAP_SYS_ADMIN)) {
 		if (((new_serial.flags & ~ASYNC_USR_MASK) !=
 		     (priv->flags & ~ASYNC_USR_MASK))) {
-			unlock_kernel();
 			return -EPERM;
 		}
 		priv->flags = ((priv->flags & ~ASYNC_USR_MASK) |
@@ -1229,7 +1226,6 @@ static int set_serial_info(struct tty_struct *tty,
 
 	if ((new_serial.baud_base != priv->baud_base) &&
 	    (new_serial.baud_base < 9600)) {
-	    	unlock_kernel();
 		return -EINVAL;
 	}
 
@@ -1259,11 +1255,8 @@ check_and_exit:
 	     (priv->flags & ASYNC_SPD_MASK)) ||
 	    (((priv->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST) &&
 	     (old_priv.custom_divisor != priv->custom_divisor))) {
-		unlock_kernel();
 		change_speed(tty, port);
 	}
-	else
-		unlock_kernel();
 	return 0;
 
 } /* set_serial_info */
-- 
1.6.3.3


             reply	other threads:[~2010-02-02 14:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-02 13:58 Alessio Igor Bogani [this message]
2010-02-02 14:13 ` Alan Cox
2010-02-02 15:18   ` [PATCH] USB: ftdi_sio: Replace BKL with a mutex Alessio Igor Bogani

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1265119094-3356-1-git-send-email-abogani@texware.it \
    --to=abogani@texware.it \
    --cc=akpm@linux-foundation.org \
    --cc=alan@linux.intel.com \
    --cc=daniel@caiaq.de \
    --cc=gregkh@suse.de \
    --cc=jhovold@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®