From: Emil Velikov <emil.l.velikov@gmail.com>
To: linux-bluetooth@vger.kernel.org
Cc: Emil Velikov <emil.velikov@collabora.com>
Subject: [PATCH BlueZ 09/20] client: annotate struct option instances as const
Date: Tue, 16 Jan 2024 14:00:34 +0000 [thread overview]
Message-ID: <20240116-const-v1-9-17c87978f40b@gmail.com> (raw)
In-Reply-To: <20240116-const-v1-0-17c87978f40b@gmail.com>
From: Emil Velikov <emil.velikov@collabora.com>
---
client/mgmt.c | 40 ++++++++++++++++++++--------------------
1 file changed, 20 insertions(+), 20 deletions(-)
diff --git a/client/mgmt.c b/client/mgmt.c
index e9ebb3d93..6fd43887d 100644
--- a/client/mgmt.c
+++ b/client/mgmt.c
@@ -2203,7 +2203,7 @@ static void get_flags_rsp(uint8_t status, uint16_t len, const void *param,
bt_shell_noninteractive_quit(EXIT_SUCCESS);
}
-static struct option get_flags_options[] = {
+static const struct option get_flags_options[] = {
{ "help", 0, 0, 'h' },
{ "type", 1, 0, 't' },
{ 0, 0, 0, 0 }
@@ -2272,7 +2272,7 @@ static void set_flags_rsp(uint8_t status, uint16_t len, const void *param,
bt_shell_noninteractive_quit(EXIT_SUCCESS);
}
-static struct option set_flags_options[] = {
+static const struct option set_flags_options[] = {
{ "help", 0, 0, 'h' },
{ "type", 1, 0, 't' },
{ "flags", 1, 0, 'f' },
@@ -2678,7 +2678,7 @@ static void disconnect_rsp(uint8_t status, uint16_t len, const void *param,
bt_shell_noninteractive_quit(EXIT_SUCCESS);
}
-static struct option disconnect_options[] = {
+static const struct option disconnect_options[] = {
{ "help", 0, 0, 'h' },
{ "type", 1, 0, 't' },
{ 0, 0, 0, 0 }
@@ -2783,7 +2783,7 @@ static void find_service_rsp(uint8_t status, uint16_t len, const void *param,
discovery = true;
}
-static struct option find_service_options[] = {
+static const struct option find_service_options[] = {
{ "help", no_argument, 0, 'h' },
{ "le-only", no_argument, 0, 'l' },
{ "bredr-only", no_argument, 0, 'b' },
@@ -2880,7 +2880,7 @@ static void find_rsp(uint8_t status, uint16_t len, const void *param,
discovery = true;
}
-static struct option find_options[] = {
+static const struct option find_options[] = {
{ "help", 0, 0, 'h' },
{ "le-only", 1, 0, 'l' },
{ "bredr-only", 1, 0, 'b' },
@@ -2952,7 +2952,7 @@ static void stop_find_rsp(uint8_t status, uint16_t len, const void *param,
bt_shell_noninteractive_quit(EXIT_SUCCESS);
}
-static struct option stop_find_options[] = {
+static const struct option stop_find_options[] = {
{ "help", 0, 0, 'h' },
{ "le-only", 1, 0, 'l' },
{ "bredr-only", 1, 0, 'b' },
@@ -3074,7 +3074,7 @@ static void register_pair_callbacks(struct mgmt *mgmt, uint16_t index)
passkey_notify, mgmt, NULL);
}
-static struct option pair_options[] = {
+static const struct option pair_options[] = {
{ "help", 0, 0, 'h' },
{ "capability", 1, 0, 'c' },
{ "type", 1, 0, 't' },
@@ -3169,7 +3169,7 @@ static void cancel_pair_rsp(uint8_t status, uint16_t len, const void *param,
bt_shell_noninteractive_quit(EXIT_SUCCESS);
}
-static struct option cancel_pair_options[] = {
+static const struct option cancel_pair_options[] = {
{ "help", 0, 0, 'h' },
{ "type", 1, 0, 't' },
{ 0, 0, 0, 0 }
@@ -3251,7 +3251,7 @@ static void unpair_rsp(uint8_t status, uint16_t len, const void *param,
bt_shell_noninteractive_quit(EXIT_SUCCESS);
}
-static struct option unpair_options[] = {
+static const struct option unpair_options[] = {
{ "help", 0, 0, 'h' },
{ "type", 1, 0, 't' },
{ 0, 0, 0, 0 }
@@ -3378,7 +3378,7 @@ static void irks_rsp(uint8_t status, uint16_t len, const void *param,
bt_shell_noninteractive_quit(EXIT_SUCCESS);
}
-static struct option irks_options[] = {
+static const struct option irks_options[] = {
{ "help", 0, 0, 'h' },
{ "local", 1, 0, 'l' },
{ "file", 1, 0, 'f' },
@@ -3492,7 +3492,7 @@ static void block_rsp(uint16_t op, uint16_t id, uint8_t status, uint16_t len,
bt_shell_noninteractive_quit(EXIT_SUCCESS);
}
-static struct option block_options[] = {
+static const struct option block_options[] = {
{ "help", 0, 0, 'h' },
{ "type", 1, 0, 't' },
{ 0, 0, 0, 0 }
@@ -3736,7 +3736,7 @@ static void remote_oob_rsp(uint8_t status, uint16_t len, const void *param,
print("Remote OOB data added for %s (%u)", addr, rp->type);
}
-static struct option remote_oob_opt[] = {
+static const struct option remote_oob_opt[] = {
{ "help", 0, 0, '?' },
{ "type", 1, 0, 't' },
{ 0, 0, 0, 0 }
@@ -3979,7 +3979,7 @@ static void conn_info_rsp(uint8_t status, uint16_t len, const void *param,
bt_shell_noninteractive_quit(EXIT_SUCCESS);
}
-static struct option conn_info_options[] = {
+static const struct option conn_info_options[] = {
{ "help", 0, 0, 'h' },
{ "type", 1, 0, 't' },
{ 0, 0, 0, 0 }
@@ -4150,7 +4150,7 @@ static void add_device_rsp(uint8_t status, uint16_t len, const void *param,
bt_shell_noninteractive_quit(EXIT_SUCCESS);
}
-static struct option add_device_options[] = {
+static const struct option add_device_options[] = {
{ "help", 0, 0, 'h' },
{ "action", 1, 0, 'a' },
{ "type", 1, 0, 't' },
@@ -4223,7 +4223,7 @@ static void remove_device_rsp(uint8_t status, uint16_t len, const void *param,
bt_shell_noninteractive_quit(EXIT_SUCCESS);
}
-static struct option del_device_options[] = {
+static const struct option del_device_options[] = {
{ "help", 0, 0, 'h' },
{ "type", 1, 0, 't' },
{ 0, 0, 0, 0 }
@@ -4477,7 +4477,7 @@ static void advsize_usage(void)
"\t -n, --local-name \"local-name\" flag");
}
-static struct option advsize_options[] = {
+static const struct option advsize_options[] = {
{ "help", 0, 0, 'h' },
{ "connectable", 0, 0, 'c' },
{ "general-discov", 0, 0, 'g' },
@@ -4597,7 +4597,7 @@ static void add_adv_usage(void)
"\tadd-adv -u 180d -u 180f -d 080954657374204C45 1");
}
-static struct option add_adv_options[] = {
+static const struct option add_adv_options[] = {
{ "help", 0, 0, 'h' },
{ "uuid", 1, 0, 'u' },
{ "adv-data", 1, 0, 'd' },
@@ -4935,7 +4935,7 @@ static void add_ext_adv_params_usage(void)
"\tadd-ext-adv-params -r 0x801 -x 0x802 -P 2M -g 1");
}
-static struct option add_ext_adv_params_options[] = {
+static const struct option add_ext_adv_params_options[] = {
{ "help", 0, 0, 'h' },
{ "duration", 1, 0, 'd' },
{ "timeout", 1, 0, 't' },
@@ -5113,7 +5113,7 @@ static void add_ext_adv_data_usage(void)
"\tadd-ext-adv-data -u 180d -u 180f -d 080954657374204C45 1");
}
-static struct option add_ext_adv_data_options[] = {
+static const struct option add_ext_adv_data_options[] = {
{ "help", 0, 0, 'h' },
{ "uuid", 1, 0, 'u' },
{ "adv-data", 1, 0, 'd' },
@@ -5557,7 +5557,7 @@ static bool str2pattern(struct mgmt_adv_pattern *pattern, const char *str)
return true;
}
-static struct option add_monitor_rssi_options[] = {
+static const struct option add_monitor_rssi_options[] = {
{ "help", 0, 0, 'h' },
{ "high-threshold", 1, 0, 'R' },
{ "low-threshold", 1, 0, 'r' },
--
2.43.0
WARNING: multiple messages have this Message-ID (diff)
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 09/20] client: annotate struct option instances as const
Date: Tue, 16 Jan 2024 14:00:34 +0000 [thread overview]
Message-ID: <20240116-const-v1-9-17c87978f40b@gmail.com> (raw)
In-Reply-To: <20240116-const-v1-0-17c87978f40b@gmail.com>
From: Emil Velikov <emil.velikov@collabora.com>
---
client/mgmt.c | 40 ++++++++++++++++++++--------------------
1 file changed, 20 insertions(+), 20 deletions(-)
diff --git a/client/mgmt.c b/client/mgmt.c
index e9ebb3d93..6fd43887d 100644
--- a/client/mgmt.c
+++ b/client/mgmt.c
@@ -2203,7 +2203,7 @@ static void get_flags_rsp(uint8_t status, uint16_t len, const void *param,
bt_shell_noninteractive_quit(EXIT_SUCCESS);
}
-static struct option get_flags_options[] = {
+static const struct option get_flags_options[] = {
{ "help", 0, 0, 'h' },
{ "type", 1, 0, 't' },
{ 0, 0, 0, 0 }
@@ -2272,7 +2272,7 @@ static void set_flags_rsp(uint8_t status, uint16_t len, const void *param,
bt_shell_noninteractive_quit(EXIT_SUCCESS);
}
-static struct option set_flags_options[] = {
+static const struct option set_flags_options[] = {
{ "help", 0, 0, 'h' },
{ "type", 1, 0, 't' },
{ "flags", 1, 0, 'f' },
@@ -2678,7 +2678,7 @@ static void disconnect_rsp(uint8_t status, uint16_t len, const void *param,
bt_shell_noninteractive_quit(EXIT_SUCCESS);
}
-static struct option disconnect_options[] = {
+static const struct option disconnect_options[] = {
{ "help", 0, 0, 'h' },
{ "type", 1, 0, 't' },
{ 0, 0, 0, 0 }
@@ -2783,7 +2783,7 @@ static void find_service_rsp(uint8_t status, uint16_t len, const void *param,
discovery = true;
}
-static struct option find_service_options[] = {
+static const struct option find_service_options[] = {
{ "help", no_argument, 0, 'h' },
{ "le-only", no_argument, 0, 'l' },
{ "bredr-only", no_argument, 0, 'b' },
@@ -2880,7 +2880,7 @@ static void find_rsp(uint8_t status, uint16_t len, const void *param,
discovery = true;
}
-static struct option find_options[] = {
+static const struct option find_options[] = {
{ "help", 0, 0, 'h' },
{ "le-only", 1, 0, 'l' },
{ "bredr-only", 1, 0, 'b' },
@@ -2952,7 +2952,7 @@ static void stop_find_rsp(uint8_t status, uint16_t len, const void *param,
bt_shell_noninteractive_quit(EXIT_SUCCESS);
}
-static struct option stop_find_options[] = {
+static const struct option stop_find_options[] = {
{ "help", 0, 0, 'h' },
{ "le-only", 1, 0, 'l' },
{ "bredr-only", 1, 0, 'b' },
@@ -3074,7 +3074,7 @@ static void register_pair_callbacks(struct mgmt *mgmt, uint16_t index)
passkey_notify, mgmt, NULL);
}
-static struct option pair_options[] = {
+static const struct option pair_options[] = {
{ "help", 0, 0, 'h' },
{ "capability", 1, 0, 'c' },
{ "type", 1, 0, 't' },
@@ -3169,7 +3169,7 @@ static void cancel_pair_rsp(uint8_t status, uint16_t len, const void *param,
bt_shell_noninteractive_quit(EXIT_SUCCESS);
}
-static struct option cancel_pair_options[] = {
+static const struct option cancel_pair_options[] = {
{ "help", 0, 0, 'h' },
{ "type", 1, 0, 't' },
{ 0, 0, 0, 0 }
@@ -3251,7 +3251,7 @@ static void unpair_rsp(uint8_t status, uint16_t len, const void *param,
bt_shell_noninteractive_quit(EXIT_SUCCESS);
}
-static struct option unpair_options[] = {
+static const struct option unpair_options[] = {
{ "help", 0, 0, 'h' },
{ "type", 1, 0, 't' },
{ 0, 0, 0, 0 }
@@ -3378,7 +3378,7 @@ static void irks_rsp(uint8_t status, uint16_t len, const void *param,
bt_shell_noninteractive_quit(EXIT_SUCCESS);
}
-static struct option irks_options[] = {
+static const struct option irks_options[] = {
{ "help", 0, 0, 'h' },
{ "local", 1, 0, 'l' },
{ "file", 1, 0, 'f' },
@@ -3492,7 +3492,7 @@ static void block_rsp(uint16_t op, uint16_t id, uint8_t status, uint16_t len,
bt_shell_noninteractive_quit(EXIT_SUCCESS);
}
-static struct option block_options[] = {
+static const struct option block_options[] = {
{ "help", 0, 0, 'h' },
{ "type", 1, 0, 't' },
{ 0, 0, 0, 0 }
@@ -3736,7 +3736,7 @@ static void remote_oob_rsp(uint8_t status, uint16_t len, const void *param,
print("Remote OOB data added for %s (%u)", addr, rp->type);
}
-static struct option remote_oob_opt[] = {
+static const struct option remote_oob_opt[] = {
{ "help", 0, 0, '?' },
{ "type", 1, 0, 't' },
{ 0, 0, 0, 0 }
@@ -3979,7 +3979,7 @@ static void conn_info_rsp(uint8_t status, uint16_t len, const void *param,
bt_shell_noninteractive_quit(EXIT_SUCCESS);
}
-static struct option conn_info_options[] = {
+static const struct option conn_info_options[] = {
{ "help", 0, 0, 'h' },
{ "type", 1, 0, 't' },
{ 0, 0, 0, 0 }
@@ -4150,7 +4150,7 @@ static void add_device_rsp(uint8_t status, uint16_t len, const void *param,
bt_shell_noninteractive_quit(EXIT_SUCCESS);
}
-static struct option add_device_options[] = {
+static const struct option add_device_options[] = {
{ "help", 0, 0, 'h' },
{ "action", 1, 0, 'a' },
{ "type", 1, 0, 't' },
@@ -4223,7 +4223,7 @@ static void remove_device_rsp(uint8_t status, uint16_t len, const void *param,
bt_shell_noninteractive_quit(EXIT_SUCCESS);
}
-static struct option del_device_options[] = {
+static const struct option del_device_options[] = {
{ "help", 0, 0, 'h' },
{ "type", 1, 0, 't' },
{ 0, 0, 0, 0 }
@@ -4477,7 +4477,7 @@ static void advsize_usage(void)
"\t -n, --local-name \"local-name\" flag");
}
-static struct option advsize_options[] = {
+static const struct option advsize_options[] = {
{ "help", 0, 0, 'h' },
{ "connectable", 0, 0, 'c' },
{ "general-discov", 0, 0, 'g' },
@@ -4597,7 +4597,7 @@ static void add_adv_usage(void)
"\tadd-adv -u 180d -u 180f -d 080954657374204C45 1");
}
-static struct option add_adv_options[] = {
+static const struct option add_adv_options[] = {
{ "help", 0, 0, 'h' },
{ "uuid", 1, 0, 'u' },
{ "adv-data", 1, 0, 'd' },
@@ -4935,7 +4935,7 @@ static void add_ext_adv_params_usage(void)
"\tadd-ext-adv-params -r 0x801 -x 0x802 -P 2M -g 1");
}
-static struct option add_ext_adv_params_options[] = {
+static const struct option add_ext_adv_params_options[] = {
{ "help", 0, 0, 'h' },
{ "duration", 1, 0, 'd' },
{ "timeout", 1, 0, 't' },
@@ -5113,7 +5113,7 @@ static void add_ext_adv_data_usage(void)
"\tadd-ext-adv-data -u 180d -u 180f -d 080954657374204C45 1");
}
-static struct option add_ext_adv_data_options[] = {
+static const struct option add_ext_adv_data_options[] = {
{ "help", 0, 0, 'h' },
{ "uuid", 1, 0, 'u' },
{ "adv-data", 1, 0, 'd' },
@@ -5557,7 +5557,7 @@ static bool str2pattern(struct mgmt_adv_pattern *pattern, const char *str)
return true;
}
-static struct option add_monitor_rssi_options[] = {
+static const struct option add_monitor_rssi_options[] = {
{ "help", 0, 0, 'h' },
{ "high-threshold", 1, 0, 'R' },
{ "low-threshold", 1, 0, 'r' },
--
2.43.0
next prev parent reply other threads:[~2024-01-16 14:00 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-16 14:00 [PATCH BlueZ 00/20] Constify all the things Emil Velikov
2024-01-16 14:00 ` Emil Velikov via B4 Relay
2024-01-16 14:00 ` [PATCH BlueZ 01/20] src: const annotate the bluetooth plugin API Emil Velikov
2024-01-16 14:00 ` 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
2024-01-16 14:00 ` Emil Velikov via B4 Relay
2024-01-16 14:00 ` [PATCH BlueZ 03/20] monitor: const annotate cmd/handler tables Emil Velikov
2024-01-16 14:00 ` Emil Velikov via B4 Relay
2024-01-16 14:00 ` [PATCH BlueZ 04/20] monitor: const annotate misc arrays Emil Velikov
2024-01-16 14:00 ` Emil Velikov via B4 Relay
2024-01-16 14:00 ` [PATCH BlueZ 05/20] monitor: const annotate intel_version_tlv_desc::type_str and API Emil Velikov
2024-01-16 14:00 ` Emil Velikov via B4 Relay
2024-01-16 14:00 ` [PATCH BlueZ 06/20] monitor: const annotate type_table and related API Emil Velikov
2024-01-16 14:00 ` Emil Velikov via B4 Relay
2024-01-16 14:00 ` [PATCH BlueZ 07/20] profiles: annotate immutable data as const Emil Velikov
2024-01-16 14:00 ` Emil Velikov via B4 Relay
2024-01-16 14:00 ` [PATCH BlueZ 08/20] attrib: " Emil Velikov
2024-01-16 14:00 ` Emil Velikov via B4 Relay
2024-01-16 14:00 ` Emil Velikov [this message]
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
2024-01-16 14:00 ` 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
2024-01-16 14:00 ` 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
2024-01-16 14:00 ` Emil Velikov via B4 Relay
2024-01-16 14:00 ` [PATCH BlueZ 13/20] lib: const annotate tupla instances and API Emil Velikov
2024-01-16 14:00 ` Emil Velikov via B4 Relay
2024-01-16 14:00 ` [PATCH BlueZ 14/20] mesh: const annotate misc data Emil Velikov
2024-01-16 14:00 ` 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
2024-01-16 14:00 ` 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
2024-01-16 14:00 ` Emil Velikov via B4 Relay
2024-01-16 14:00 ` [PATCH BlueZ 17/20] obexd: const obex_service_driver " Emil Velikov
2024-01-16 14:00 ` Emil Velikov via B4 Relay
2024-01-16 14:00 ` [PATCH BlueZ 18/20] obexd: const obex_transport_driver " Emil Velikov
2024-01-16 14:00 ` Emil Velikov via B4 Relay
2024-01-16 14:00 ` [PATCH BlueZ 19/20] obexd: const annotate misc immutable data Emil Velikov
2024-01-16 14:00 ` Emil Velikov via B4 Relay
2024-01-16 14:00 ` [PATCH BlueZ 20/20] obexd: const annotate obex_plugin_desc entrypoint Emil Velikov
2024-01-16 14:00 ` 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-9-17c87978f40b@gmail.com \
--to=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.