Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1715614 > unrolled thread

[PATCH] Bluetooth: make device_type const

Started byBhumika Goyal <bhumirks@gmail.com>
First post2017-08-19 11:30 +0200
Last post2017-08-19 12:00 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] Bluetooth: make device_type const Bhumika Goyal <bhumirks@gmail.com> - 2017-08-19 11:30 +0200
    Re: [PATCH] Bluetooth: make device_type const Marcel Holtmann <marcel@holtmann.org> - 2017-08-19 12:00 +0200

#1715614 — [PATCH] Bluetooth: make device_type const

FromBhumika Goyal <bhumirks@gmail.com>
Date2017-08-19 11:30 +0200
Subject[PATCH] Bluetooth: make device_type const
Message-ID<ug8eR-7Yu-5@gated-at.bofh.it>
Make these const as they are only stored in the type field of a device
structure, which is const.
Done using Coccinelle.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
---
 net/bluetooth/hci_sysfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c
index ca7a35e..aa300f3 100644
--- a/net/bluetooth/hci_sysfs.c
+++ b/net/bluetooth/hci_sysfs.c
@@ -13,7 +13,7 @@ static void bt_link_release(struct device *dev)
 	kfree(conn);
 }
 
-static struct device_type bt_link = {
+static const struct device_type bt_link = {
 	.name    = "link",
 	.release = bt_link_release,
 };
@@ -86,7 +86,7 @@ static void bt_host_release(struct device *dev)
 	module_put(THIS_MODULE);
 }
 
-static struct device_type bt_host = {
+static const struct device_type bt_host = {
 	.name    = "host",
 	.release = bt_host_release,
 };
-- 
1.9.1

[toc] | [next] | [standalone]


#1715619

FromMarcel Holtmann <marcel@holtmann.org>
Date2017-08-19 12:00 +0200
Message-ID<ug8HT-89E-1@gated-at.bofh.it>
In reply to#1715614
Hi Bhumika,

> Make these const as they are only stored in the type field of a device
> structure, which is const.
> Done using Coccinelle.
> 
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
> ---
> net/bluetooth/hci_sysfs.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web