lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 23 Oct 2009 21:29:35 -0200
From:	Thadeu Lima de Souza Cascardo <cascardo@...oscopio.com>
To:	linux-bluetooth@...r.kernel.org
Cc:	linux-kernel@...r.kernel.org, marcel@...tmann.org,
	Thadeu Lima de Souza Cascardo <cascardo@...oscopio.com>
Subject: [PATCH] bluetooth: remove useless variable in virtual hci driver

Commit ac28494c has removed the option to give a minor number as
parameter for VHCI driver. Remove the variable used for that parameter.
Print the error code when registering the device fails, instead of the
requested minor number (which would always be MISC_DYNAMIC_MINOR).

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@...oscopio.com>
---
 drivers/bluetooth/hci_vhci.c |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/drivers/bluetooth/hci_vhci.c b/drivers/bluetooth/hci_vhci.c
index d5cde6d..74c094c 100644
--- a/drivers/bluetooth/hci_vhci.c
+++ b/drivers/bluetooth/hci_vhci.c
@@ -41,8 +41,6 @@
 
 #define VERSION "1.3"
 
-static int minor = MISC_DYNAMIC_MINOR;
-
 struct vhci_data {
 	struct hci_dev *hdev;
 
@@ -292,7 +290,7 @@ static const struct file_operations vhci_fops = {
 	.release	= vhci_release,
 };
 
-static struct miscdevice vhci_miscdev= {
+static struct miscdevice vhci_miscdev = {
 	.name	= "vhci",
 	.fops	= &vhci_fops,
 	.minor	= MISC_DYNAMIC_MINOR,
@@ -300,10 +298,13 @@ static struct miscdevice vhci_miscdev= {
 
 static int __init vhci_init(void)
 {
+	int r;
+
 	BT_INFO("Virtual HCI driver ver %s", VERSION);
 
-	if (misc_register(&vhci_miscdev) < 0) {
-		BT_ERR("Can't register misc device with minor %d", minor);
+	r = misc_register(&vhci_miscdev);
+	if (r < 0) {
+		BT_ERR("Can't register misc device: %d", r);
 		return -EIO;
 	}
 
@@ -312,8 +313,10 @@ static int __init vhci_init(void)
 
 static void __exit vhci_exit(void)
 {
-	if (misc_deregister(&vhci_miscdev) < 0)
-		BT_ERR("Can't unregister misc device with minor %d", minor);
+	int r;
+	r = misc_deregister(&vhci_miscdev);
+	if (r < 0)
+		BT_ERR("Can't unregister misc device: %d", r);
 }
 
 module_init(vhci_init);
-- 
1.6.3.3

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ