From: David Herrmann <dh.herrmann@googlemail.com>
To: linux-bluetooth@vger.kernel.org
Cc: johan.hedberg@gmail.com, marcel@holtmann.org,
David Herrmann <dh.herrmann@googlemail.com>
Subject: [PATCH 4/4] Bluetooth: Use proper datatypes in release-callbacks
Date: Fri, 27 Jan 2012 16:47:26 +0100 [thread overview]
Message-ID: <1327679246-2667-5-git-send-email-dh.herrmann@googlemail.com> (raw)
In-Reply-To: <1327679246-2667-1-git-send-email-dh.herrmann@googlemail.com>
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>
---
net/bluetooth/hci_sysfs.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c
index 17e6cd4..bc15429 100644
--- a/net/bluetooth/hci_sysfs.c
+++ b/net/bluetooth/hci_sysfs.c
@@ -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);
}
--
1.7.8.4
next prev parent reply other threads:[~2012-01-27 15:47 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-27 15:47 [PATCH 0/4] Integrate better device support David Herrmann
2012-01-27 15:47 ` [PATCH 1/4] Bluetooth: Introduce to_hci_dev() David Herrmann
2012-01-30 21:55 ` Marcel Holtmann
2012-01-27 15:47 ` [PATCH 2/4] Bluetooth: Remove hci_dev->driver_data David Herrmann
2012-01-27 16:51 ` Anderson Lizardo
2012-01-27 16:56 ` David Herrmann
2012-01-27 17:01 ` [PATCH 2/4 v2] " David Herrmann
2012-01-30 21:57 ` Marcel Holtmann
2012-01-27 15:47 ` [PATCH 3/4] Bluetooth: Introduce to_hci_conn David Herrmann
2012-01-27 17:01 ` Andrei Emeltchenko
2012-01-27 17:20 ` David Herrmann
2012-01-30 21:37 ` Ulisses Furquim
2012-01-30 21:59 ` Marcel Holtmann
2012-01-27 15:47 ` David Herrmann [this message]
2012-01-30 22:00 ` [PATCH 4/4] Bluetooth: Use proper datatypes in release-callbacks Marcel Holtmann
2012-02-06 12:34 ` [PATCH 0/4] Integrate better device support Andrei Emeltchenko
2012-02-06 14:03 ` David Herrmann
2012-02-09 21:12 ` David Herrmann
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=1327679246-2667-5-git-send-email-dh.herrmann@googlemail.com \
--to=dh.herrmann@googlemail.com \
--cc=johan.hedberg@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=marcel@holtmann.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;
as well as URLs for NNTP newsgroup(s).