Commit 2dd106887d6503819f2cedc408497023547439bb

Authored by David Herrmann
Committed by Johan Hedberg
1 parent 3dc07322b1

Bluetooth: Use proper datatypes in release-callbacks

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>

Showing 1 changed file with 4 additions and 4 deletions Side-by-side Diff

net/bluetooth/hci_sysfs.c
... ... @@ -79,8 +79,8 @@
79 79  
80 80 static void bt_link_release(struct device *dev)
81 81 {
82   - void *data = to_hci_conn(dev);
83   - kfree(data);
  82 + struct hci_conn *conn = to_hci_conn(dev);
  83 + kfree(conn);
84 84 }
85 85  
86 86 static struct device_type bt_link = {
... ... @@ -368,8 +368,8 @@
368 368  
369 369 static void bt_host_release(struct device *dev)
370 370 {
371   - void *data = to_hci_dev(dev);
372   - kfree(data);
  371 + struct hci_dev *hdev = to_hci_dev(dev);
  372 + kfree(hdev);
373 373 module_put(THIS_MODULE);
374 374 }
375 375