]> rtime.felk.cvut.cz Git - linux-imx.git/commitdiff
Bluetooth: Use proper datatypes in release-callbacks
authorDavid Herrmann <dh.herrmann@googlemail.com>
Thu, 9 Feb 2012 20:58:34 +0000 (21:58 +0100)
committerJohan Hedberg <johan.hedberg@intel.com>
Mon, 13 Feb 2012 15:01:38 +0000 (17:01 +0200)
This enhances code readability a lot and avoids using void* even though
we know the type of the variable.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
net/bluetooth/hci_sysfs.c

index 17e6cd48ad4d000fe1549c1fad773db41bbd58c8..bc154298979a8278efa4611309e025d663f056bc 100644 (file)
@@ -79,8 +79,8 @@ static const struct attribute_group *bt_link_groups[] = {
 
 static void bt_link_release(struct device *dev)
 {
-       void *data = to_hci_conn(dev);
-       kfree(data);
+       struct hci_conn *conn = to_hci_conn(dev);
+       kfree(conn);
 }
 
 static struct device_type bt_link = {
@@ -368,8 +368,8 @@ static const struct attribute_group *bt_host_groups[] = {
 
 static void bt_host_release(struct device *dev)
 {
-       void *data = to_hci_dev(dev);
-       kfree(data);
+       struct hci_dev *hdev = to_hci_dev(dev);
+       kfree(hdev);
        module_put(THIS_MODULE);
 }