linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: make array bt_uuid_any static const
@ 2022-02-14 21:51 Colin Ian King
  2022-02-16 10:28 ` Marcel Holtmann
  0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2022-02-14 21:51 UTC (permalink / raw)
  To: Marcel Holtmann, Johan Hedberg, David S . Miller, Jakub Kicinski,
	linux-bluetooth, netdev
  Cc: kernel-janitors, linux-kernel

Don't populate the read-only array bt_uuid_any on the stack but
instead make it static const. Also makes the object code a little
smaller.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 net/bluetooth/mgmt.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 914e2f2d3586..4b15b95e61e6 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -2269,7 +2269,9 @@ static int remove_uuid(struct sock *sk, struct hci_dev *hdev, void *data,
 	struct mgmt_cp_remove_uuid *cp = data;
 	struct mgmt_pending_cmd *cmd;
 	struct bt_uuid *match, *tmp;
-	u8 bt_uuid_any[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+	static const u8 bt_uuid_any[] = {
+		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+	};
 	int err, found;
 
 	bt_dev_dbg(hdev, "sock %p", sk);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Bluetooth: make array bt_uuid_any static const
  2022-02-14 21:51 [PATCH] Bluetooth: make array bt_uuid_any static const Colin Ian King
@ 2022-02-16 10:28 ` Marcel Holtmann
  0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2022-02-16 10:28 UTC (permalink / raw)
  To: Colin Ian King
  Cc: Johan Hedberg, David S. Miller, Jakub Kicinski, linux-bluetooth,
	netdev, kernel-janitors, linux-kernel

Hi Colin,

> Don't populate the read-only array bt_uuid_any on the stack but
> instead make it static const. Also makes the object code a little
> smaller.
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
> net/bluetooth/mgmt.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-02-16 10:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-14 21:51 [PATCH] Bluetooth: make array bt_uuid_any static const Colin Ian King
2022-02-16 10:28 ` Marcel Holtmann

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).