linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Emil Velikov via B4 Relay <devnull+emil.l.velikov.gmail.com@kernel.org>
To: linux-bluetooth@vger.kernel.org
Cc: Emil Velikov <emil.velikov@collabora.com>
Subject: [PATCH BlueZ 04/20] monitor: const annotate misc arrays
Date: Tue, 16 Jan 2024 14:00:29 +0000	[thread overview]
Message-ID: <20240116-const-v1-4-17c87978f40b@gmail.com> (raw)
In-Reply-To: <20240116-const-v1-0-17c87978f40b@gmail.com>

From: Emil Velikov <emil.velikov@collabora.com>

---
 monitor/att.c    | 8 ++++----
 monitor/avctp.c  | 2 +-
 monitor/intel.c  | 2 +-
 monitor/l2cap.c  | 2 +-
 monitor/rfcomm.c | 2 +-
 monitor/sdp.c    | 4 ++--
 6 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/monitor/att.c b/monitor/att.c
index d016e58df..ac0d881fd 100644
--- a/monitor/att.c
+++ b/monitor/att.c
@@ -2581,7 +2581,7 @@ static void media_state_notify(const struct l2cap_frame *frame)
 	print_media_state(frame);
 }
 
-struct media_cp_opcode {
+static const struct media_cp_opcode {
 	uint8_t opcode;
 	const char *opcode_str;
 } media_cp_opcode_table[] = {
@@ -2739,7 +2739,7 @@ static void content_control_id_read(const struct l2cap_frame *frame)
 
 static const struct pa_sync_state_decoder {
 	uint8_t code;
-	char *value;
+	const char *value;
 } pa_sync_state_decoders[] = {
 	{ 0x00, "Not synchronized to PA" },
 	{ 0x01, "SyncInfo Request" },
@@ -2750,7 +2750,7 @@ static const struct pa_sync_state_decoder {
 
 static const struct cp_pa_sync_state_decoder {
 	uint8_t code;
-	char *value;
+	const char *value;
 } cp_pa_sync_state_decoders[] = {
 	{ 0x00, "Do not synchronize to PA" },
 	{ 0x01, "Synchronize to PA - PAST available" },
@@ -2759,7 +2759,7 @@ static const struct cp_pa_sync_state_decoder {
 
 static const struct big_enc_decoder {
 	uint8_t code;
-	char *value;
+	const char *value;
 } big_enc_decoders[] = {
 	{ 0x00, "Not encrypted" },
 	{ 0x01, "Broadcast_Code required" },
diff --git a/monitor/avctp.c b/monitor/avctp.c
index fb2628282..c59e93b20 100644
--- a/monitor/avctp.c
+++ b/monitor/avctp.c
@@ -1802,7 +1802,7 @@ response:
 }
 
 
-static struct {
+static const struct {
 	const char *str;
 	bool reserved;
 } features_table[] = {
diff --git a/monitor/intel.c b/monitor/intel.c
index 0191987d4..1b2414290 100644
--- a/monitor/intel.c
+++ b/monitor/intel.c
@@ -1798,7 +1798,7 @@ static const struct vendor_evt vendor_prefix_evt_table[] = {
 	{ }
 };
 
-const uint8_t intel_vendor_prefix[] = {0x87, 0x80};
+static const uint8_t intel_vendor_prefix[] = {0x87, 0x80};
 #define INTEL_VENDOR_PREFIX_SIZE sizeof(intel_vendor_prefix)
 
 /*
diff --git a/monitor/l2cap.c b/monitor/l2cap.c
index 8f3d8e65b..dff183bd0 100644
--- a/monitor/l2cap.c
+++ b/monitor/l2cap.c
@@ -718,7 +718,7 @@ static void print_config_result(uint16_t result)
 	print_field("Result: %s (0x%4.4x)", str, le16_to_cpu(result));
 }
 
-static struct {
+static const struct {
 	uint8_t type;
 	uint8_t len;
 	const char *str;
diff --git a/monitor/rfcomm.c b/monitor/rfcomm.c
index 02300a8b5..a855152c6 100644
--- a/monitor/rfcomm.c
+++ b/monitor/rfcomm.c
@@ -32,7 +32,7 @@
 #include "sdp.h"
 #include "rfcomm.h"
 
-static char *cr_str[] = {
+static const char *cr_str[] = {
 	"RSP",
 	"CMD"
 };
diff --git a/monitor/sdp.c b/monitor/sdp.c
index daf9a9da8..2c69dc83b 100644
--- a/monitor/sdp.c
+++ b/monitor/sdp.c
@@ -167,7 +167,7 @@ static struct {
 	{ }
 };
 
-static struct {
+static const struct {
 	uint8_t index;
 	uint8_t bits;
 	uint8_t size;
@@ -322,7 +322,7 @@ static uint32_t get_bytes(const uint8_t *data, uint32_t size)
 	return 0;
 }
 
-static struct {
+static const struct {
 	uint16_t id;
 	const char *str;
 } attribute_table[] = {

-- 
2.43.0


  parent reply	other threads:[~2024-01-16 14:00 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-16 14:00 [PATCH BlueZ 00/20] Constify all the things Emil Velikov via B4 Relay
2024-01-16 14:00 ` [PATCH BlueZ 01/20] src: const annotate the bluetooth plugin API Emil Velikov via B4 Relay
2024-01-16 18:37   ` Constify all the things bluez.test.bot
2024-01-16 14:00 ` [PATCH BlueZ 02/20] monitor: const annotate util_ltv_debugger instances and API Emil Velikov via B4 Relay
2024-01-16 14:00 ` [PATCH BlueZ 03/20] monitor: const annotate cmd/handler tables Emil Velikov via B4 Relay
2024-01-16 14:00 ` Emil Velikov via B4 Relay [this message]
2024-01-16 14:00 ` [PATCH BlueZ 05/20] monitor: const annotate intel_version_tlv_desc::type_str and API Emil Velikov via B4 Relay
2024-01-16 14:00 ` [PATCH BlueZ 06/20] monitor: const annotate type_table and related API Emil Velikov via B4 Relay
2024-01-16 14:00 ` [PATCH BlueZ 07/20] profiles: annotate immutable data as const Emil Velikov via B4 Relay
2024-01-16 14:00 ` [PATCH BlueZ 08/20] attrib: " Emil Velikov via B4 Relay
2024-01-16 14:00 ` [PATCH BlueZ 09/20] client: annotate struct option instances " Emil Velikov via B4 Relay
2024-01-16 14:00 ` [PATCH BlueZ 10/20] emulator: const annotate rfcomm_crc_table[] Emil Velikov via B4 Relay
2024-01-16 14:00 ` [PATCH BlueZ 11/20] gobex: const annotate RO arrays, use G_N_ELEMENTS Emil Velikov via B4 Relay
2024-01-16 14:00 ` [PATCH BlueZ 12/20] lib: const annotate hci_map instances and related API Emil Velikov via B4 Relay
2024-01-16 14:00 ` [PATCH BlueZ 13/20] lib: const annotate tupla instances and API Emil Velikov via B4 Relay
2024-01-16 14:00 ` [PATCH BlueZ 14/20] mesh: const annotate misc data Emil Velikov via B4 Relay
2024-01-16 14:00 ` [PATCH BlueZ 15/20] obexd: remove obex_mime_type_driver::set_io_watch Emil Velikov via B4 Relay
2024-01-16 14:00 ` [PATCH BlueZ 16/20] obexd: const obex_mime_type_driver instances and API Emil Velikov via B4 Relay
2024-01-16 14:00 ` [PATCH BlueZ 17/20] obexd: const obex_service_driver " Emil Velikov via B4 Relay
2024-01-16 14:00 ` [PATCH BlueZ 18/20] obexd: const obex_transport_driver " Emil Velikov via B4 Relay
2024-01-16 14:00 ` [PATCH BlueZ 19/20] obexd: const annotate misc immutable data Emil Velikov via B4 Relay
2024-01-16 14:00 ` [PATCH BlueZ 20/20] obexd: const annotate obex_plugin_desc entrypoint Emil Velikov via B4 Relay
2024-01-22 23:53 ` [PATCH BlueZ 00/20] Constify all the things patchwork-bot+bluetooth

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=20240116-const-v1-4-17c87978f40b@gmail.com \
    --to=devnull+emil.l.velikov.gmail.com@kernel.org \
    --cc=emil.l.velikov@gmail.com \
    --cc=emil.velikov@collabora.com \
    --cc=linux-bluetooth@vger.kernel.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).