Constify all the things
Subsystems (2)
cover Constify all the things
Hello list,
Here is series#2 of the paper cut fixes. Here we annotate a handful of the data as constant alongside updating all the respective APIs.
There's nothing particularly existing or controversial here, despite the size of the series. That said, I'm not 100% sure that all code-paths have been (runtime) tested.
As always - any input will be appreciated.
Thanks
Emil
---
Emil Velikov (20):
src: const annotate the bluetooth plugin API
monitor: const annotate util_ltv_debugger instances and API
monitor: const annotate cmd/handler tables
monitor: const annotate misc arrays
monitor: const annotate intel_version_tlv_desc::type_str and API
monitor: const annotate type_table and related API
profiles: annotate immutable data as const
attrib: annotate immutable data as const
client: annotate struct option instances as const
emulator: const annotate rfcomm_crc_table[]
gobex: const annotate RO arrays, use G_N_ELEMENTS
lib: const annotate hci_map instances and related API
lib: const annotate tupla instances and API
mesh: const annotate misc data
obexd: remove obex_mime_type_driver::set_io_watch
obexd: const obex_mime_type_driver instances and API
obexd: const obex_service_driver instances and API
obexd: const obex_transport_driver instances and API
obexd: const annotate misc immutable data
obexd: const annotate obex_plugin_desc entrypoint
attrib/gatttool.c | 8 +++--- attrib/interactive.c | 2 +- client/mgmt.c | 42 ++++++++++++++++---------------- emulator/bthost.c | 2 +- gobex/gobex.c | 8 +++--- lib/hci.c | 42 ++++++++++++++++---------------- lib/hci_lib.h | 4 +-- lib/sdp.c | 20 +++++++-------- mesh/agent.c | 4 +-- monitor/att.c | 54 ++++++++++++++++++++--------------------- monitor/avctp.c | 2 +- monitor/intel.c | 28 ++++++++++----------- monitor/l2cap.c | 2 +- monitor/rfcomm.c | 2 +- monitor/sdp.c | 10 ++++---- obexd/client/manager.c | 6 ++--- obexd/client/map.c | 4 +-- obexd/client/mns.c | 8 +++--- obexd/plugins/bluetooth.c | 6 ++--- obexd/plugins/filesystem.c | 8 +++--- obexd/plugins/ftp.c | 2 +- obexd/plugins/irmc.c | 4 +-- obexd/plugins/mas.c | 18 +++++++------- obexd/plugins/opp.c | 2 +- obexd/plugins/pbap.c | 8 +++--- obexd/plugins/pcsuite.c | 4 +-- obexd/plugins/phonebook-ebook.c | 2 +- obexd/plugins/syncevolution.c | 4 +-- obexd/src/genbuiltin | 4 +-- obexd/src/main.c | 2 +- obexd/src/mimetype.c | 26 +++++++------------- obexd/src/mimetype.h | 12 +++++---- obexd/src/obex-priv.h | 4 +-- obexd/src/obex.c | 18 +++++++------- obexd/src/plugin.c | 8 +++--- obexd/src/plugin.h | 4 +-- obexd/src/server.c | 10 ++++---- obexd/src/server.h | 2 +- obexd/src/service.c | 20 +++++++-------- obexd/src/service.h | 6 ++--- obexd/src/transport.c | 14 +++++------ obexd/src/transport.h | 6 ++--- profiles/audio/avctp.c | 2 +- profiles/audio/avrcp.c | 8 +++--- profiles/audio/media.c | 6 ++--- profiles/audio/sink.c | 2 +- profiles/audio/source.c | 2 +- profiles/audio/transport.c | 12 ++++----- profiles/health/hdp_util.c | 15 ++++++------ profiles/iap/main.c | 2 +- src/genbuiltin | 4 +-- src/log.c | 2 +- src/plugin.c | 6 ++--- src/plugin.h | 6 ++--- 54 files changed, 251 insertions(+), 258 deletions(-)
---
base-commit: 770ad5614e7e8074133e6f563495ce4822f63fe4
change-id: 20240116-const-bc91df591e93
Best regards,
Signature · 1 line
Emil Velikov <[email protected]>
PATCH 1/20 src: const annotate the bluetooth plugin API
From: Emil Velikov <[email protected]>
The data was never mutable, so there's no API/ABI breakage here.
--- src/genbuiltin | 4 ++-- src/log.c | 2 +- src/plugin.c | 6 +++--- src/plugin.h | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-)
src/genbuiltin +2 -2
@@ -2,11 +2,11 @@ for i in $* do - echo "extern struct bluetooth_plugin_desc __bluetooth_builtin_$i;" + echo "extern const struct bluetooth_plugin_desc __bluetooth_builtin_$i;" done echo -echo "static struct bluetooth_plugin_desc *__bluetooth_builtin[] = {" +echo "static const struct bluetooth_plugin_desc *__bluetooth_builtin[] = {" for i in $* do
src/log.c +1 -1
@@ -123,7 +123,7 @@ extern struct btd_debug_desc __stop___debug[];static char **enabled =NULL ; -static gboolean is_enabled (struct btd_debug_desc *desc) +static gboolean is_enabled (const struct btd_debug_desc *desc) {int i;
src/plugin.c +3 -3
@@ -31,7 +31,7 @@ static GSList *plugins = NULL;struct bluetooth_plugin {void *handle;gboolean active; -struct bluetooth_plugin_desc *desc; +const struct bluetooth_plugin_desc *desc; };static int compare_priority (gconstpointer a,gconstpointer b)
@@ -42,7 +42,7 @@ static int compare_priority(gconstpointer a, gconstpointer b)return plugin2->desc->priority - plugin1->desc->priority; } -static gboolean add_plugin (void *handle,struct bluetooth_plugin_desc *desc) +static gboolean add_plugin (void *handle,const struct bluetooth_plugin_desc *desc) {struct bluetooth_plugin *plugin;
@@ -141,7 +141,7 @@ gboolean plugin_init(const char *enable, const char *disable) goto start;while ((file =g_dir_read_name (dir)) !=NULL ) { -struct bluetooth_plugin_desc *desc; +const struct bluetooth_plugin_desc *desc;void *handle;char *filename;
src/plugin.h +3 -3
@@ -23,7 +23,7 @@ struct bluetooth_plugin_desc {#ifdef BLUETOOTH_PLUGIN_BUILTIN #define BLUETOOTH_PLUGIN_DEFINE (name, version, priority, init, exit) \ - struct bluetooth_plugin_desc __bluetooth_builtin_ ## name = { \ + const struct bluetooth_plugin_desc __bluetooth_builtin_ ## name = { \ #name, version, priority, init, exit \ };#else
@@ -32,9 +32,9 @@ struct bluetooth_plugin_desc { __attribute__ ((weak, visibility("hidden"))); \ extern struct btd_debug_desc __stop___debug[] \ __attribute__ ((weak, visibility("hidden"))); \ - extern struct bluetooth_plugin_desc bluetooth_plugin_desc \ + extern const struct bluetooth_plugin_desc bluetooth_plugin_desc \ __attribute__ ((visibility("default"))); \ -struct bluetooth_plugin_desc bluetooth_plugin_desc = { \ +const struct bluetooth_plugin_desc bluetooth_plugin_desc = { \ #name, version, priority, init, exit, \ __start___debug, __stop___debug \ };
Signature · 1 line
2.43.0
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=817220
---Test result---
Test Summary:
CheckPatch FAIL 6.32 seconds GitLint PASS 3.96 seconds BuildEll PASS 23.78 seconds BluezMake PASS 712.63 seconds MakeCheck PASS 12.07 seconds MakeDistcheck PASS 158.82 seconds CheckValgrind PASS 219.94 seconds CheckSmatch WARNING 325.30 seconds bluezmakeextell PASS 105.45 seconds IncrementalBuild PASS 13281.67 seconds ScanBuild WARNING 928.49 seconds
Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script
Output:
[BlueZ,01/20] src: const annotate the bluetooth plugin API WARNING:LONG_LINE: line length of 82 exceeds 80 columns
#119: FILE: src/plugin.c:45:
+static gboolean add_plugin(void *handle, const struct bluetooth_plugin_desc *desc)
WARNING:LONG_LINE: line length of 85 exceeds 80 columns #141: FILE: src/plugin.h:26:
+ const struct bluetooth_plugin_desc __bluetooth_builtin_ ## name = { \
WARNING:LONG_LINE: line length of 81 exceeds 80 columns #150: FILE: src/plugin.h:35:
+ extern const struct bluetooth_plugin_desc bluetooth_plugin_desc \
/github/workspace/src/src/13520846.patch total: 0 errors, 3 warnings, 64 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.
/github/workspace/src/src/13520846.patch has style problems, please review.
NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPDX_LICENSE_TAG SPLIT_STRING SSCANF_TO_KSTRTO
NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
[BlueZ,02/20] monitor: const annotate util_ltv_debugger instances and API WARNING:LONG_LINE: line length of 84 exceeds 80 columns
#75: FILE: monitor/att.c:686:
+ const struct util_ltv_debugger *decoder, size_t decoder_len)
WARNING:LONG_LINE: line length of 84 exceeds 80 columns #84: FILE: monitor/att.c:708:
+ const struct util_ltv_debugger *decoder, size_t decoder_len)
/github/workspace/src/src/13520847.patch total: 0 errors, 2 warnings, 48 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.
/github/workspace/src/src/13520847.patch has style problems, please review.
NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPDX_LICENSE_TAG SPLIT_STRING SSCANF_TO_KSTRTO
NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
[BlueZ,03/20] monitor: const annotate cmd/handler tables WARNING:LONG_LINE: line length of 84 exceeds 80 columns
#146: FILE: monitor/att.c:3160:
+static const struct bcast_audio_scan_cp_cmd *bcast_audio_scan_cp_get_cmd(uint8_t op)
/github/workspace/src/src/13520848.patch total: 0 errors, 1 warnings, 136 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.
/github/workspace/src/src/13520848.patch has style problems, please review.
NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPDX_LICENSE_TAG SPLIT_STRING SSCANF_TO_KSTRTO
NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
[BlueZ,04/20] monitor: const annotate misc arrays
WARNING:STATIC_CONST_CHAR_ARRAY: static const char * array should probably be static const char * const #158: FILE: monitor/rfcomm.c:35:
+static const char *cr_str[] = {
/github/workspace/src/src/13520855.patch total: 0 errors, 1 warnings, 80 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.
/github/workspace/src/src/13520855.patch has style problems, please review.
NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPDX_LICENSE_TAG SPLIT_STRING SSCANF_TO_KSTRTO
NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
[BlueZ,07/20] profiles: annotate immutable data as const WARNING:STATIC_CONST_CHAR_ARRAY: static const char * array should probably be static const char * const #165: FILE: profiles/audio/sink.c:65:
+static const char *str_state[] = {
WARNING:STATIC_CONST_CHAR_ARRAY: static const char * array should probably be static const char * const #178: FILE: profiles/audio/source.c:64:
+static const char *str_state[] = {
WARNING:STATIC_CONST_CHAR_ARRAY: static const char * array should probably be static const char * const #191: FILE: profiles/audio/transport.c:58:
+static const char *str_state[] = {
WARNING:LONG_LINE: line length of 83 exceeds 80 columns
#218: FILE: profiles/audio/transport.c:1765:
+static const struct media_transport_ops *media_transport_find_ops(const char *uuid)
/github/workspace/src/src/13520849.patch total: 0 errors, 4 warnings, 185 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.
/github/workspace/src/src/13520849.patch has style problems, please review.
NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPDX_LICENSE_TAG SPLIT_STRING SSCANF_TO_KSTRTO
NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
[BlueZ,11/20] gobex: const annotate RO arrays, use G_N_ELEMENTS WARNING:LONG_LINE: line length of 90 exceeds 80 columns #102: FILE: gobex/gobex.c:1446:
+ gobex_debug = g_parse_debug_string(env, keys, G_N_ELEMENTS(keys));
/github/workspace/src/src/13520860.patch total: 0 errors, 1 warnings, 32 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.
/github/workspace/src/src/13520860.patch has style problems, please review.
NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPDX_LICENSE_TAG SPLIT_STRING SSCANF_TO_KSTRTO
NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
[BlueZ,13/20] lib: const annotate tupla instances and API WARNING:LONG_LINE: line length of 82 exceeds 80 columns
#117: FILE: lib/sdp.c:190:
+static const char *string_lookup_uuid(const struct tupla *pt0, const uuid_t *uuid)
WARNING:LONG_LINE: line length of 89 exceeds 80 columns
#126: FILE: lib/sdp.c:212:
+static int uuid2str(const struct tupla *message, const uuid_t *uuid, char *str, size_t n)
/github/workspace/src/src/13520857.patch total: 0 errors, 2 warnings, 66 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.
/github/workspace/src/src/13520857.patch has style problems, please review.
NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPDX_LICENSE_TAG SPLIT_STRING SSCANF_TO_KSTRTO
NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
[BlueZ,16/20] obexd: const obex_mime_type_driver instances and API WARNING:LONG_LINE: line length of 85 exceeds 80 columns
#301: FILE: obexd/src/mimetype.c:137:
+const struct obex_mime_type_driver *obex_mime_type_driver_find(const uint8_t *target,
WARNING:LONG_LINE: line length of 81 exceeds 80 columns
#331: FILE: obexd/src/mimetype.c:186:
+void obex_mime_type_driver_unregister(const struct obex_mime_type_driver *driver)
WARNING:LONG_LINE: line length of 82 exceeds 80 columns
#347: FILE: obexd/src/mimetype.h:34:
+void obex_mime_type_driver_unregister(const struct obex_mime_type_driver *driver);
WARNING:LONG_LINE: line length of 85 exceeds 80 columns
#348: FILE: obexd/src/mimetype.h:35:
+const struct obex_mime_type_driver *obex_mime_type_driver_find(const uint8_t *target,
/github/workspace/src/src/13520859.patch total: 0 errors, 4 warnings, 224 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.
/github/workspace/src/src/13520859.patch has style problems, please review.
NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPDX_LICENSE_TAG SPLIT_STRING SSCANF_TO_KSTRTO
NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
[BlueZ,18/20] obexd: const obex_transport_driver instances and API WARNING:LONG_LINE: line length of 81 exceeds 80 columns
#195: FILE: obexd/src/transport.c:70:
+void obex_transport_driver_unregister(const struct obex_transport_driver *driver)
WARNING:LONG_LINE: line length of 82 exceeds 80 columns
#211: FILE: obexd/src/transport.h:21:
+void obex_transport_driver_unregister(const struct obex_transport_driver *driver);
/github/workspace/src/src/13520863.patch total: 0 errors, 2 warnings, 108 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.
/github/workspace/src/src/13520863.patch has style problems, please review.
NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPDX_LICENSE_TAG SPLIT_STRING SSCANF_TO_KSTRTO
NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
[BlueZ,19/20] obexd: const annotate misc immutable data WARNING:STATIC_CONST_CHAR_ARRAY: static const char * array should probably be static const char * const #154: FILE: obexd/plugins/phonebook-ebook.c:58:
+static const char *attribute_mask[] = {
/github/workspace/src/src/13520864.patch total: 0 errors, 1 warnings, 80 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.
/github/workspace/src/src/13520864.patch has style problems, please review.
NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPDX_LICENSE_TAG SPLIT_STRING SSCANF_TO_KSTRTO
NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
##############################
Test: CheckSmatch - WARNING
Desc: Run smatch tool with source
Output:monitor/att.c: note: in included file:monitor/display.h:82:26: warning: Variable length array is used.monitor/att.c: note: in included file:monitor/display.h:82:26: warning: Variable length array is used.monitor/att.c: note: in included file:monitor/display.h:82:26: warning: Variable length array is used.monitor/l2cap.c: note: in included file:monitor/display.h:82:26: warning: Variable length array is used.attrib/gatttool.c:235:23: warning: Variable length array is used.attrib/interactive.c: note: in included file (through /usr/include/readline/readline.h):attrib/interactive.c:174:27: warning: non-ANSI function declaration of function 'disconnect_io'attrib/interactive.c:299:23: warning: Variable length array is used.emulator/bthost.c:584:28: warning: Variable length array is used.emulator/bthost.c:741:28: warning: Variable length array is used.
##############################
Test: ScanBuild - WARNING
Desc: Run Scan Build
Output:obexd/src/obex.c:123:3: warning: Access to field 'close' results in a dereference of a null pointer (loaded from field 'driver')
os->driver->close(os->object);
^~~~~~~~~~~~~~~~~
1 warning generated.profiles/health/hdp_util.c:1052:2: warning: Use of memory after it is freed
conn_data->func(conn_data->data, gerr);
^~~~~~~~~~~~~~~1 warning generated.
---
Regards,
Linux Bluetooth
PATCH 2/20 monitor: const annotate util_ltv_debugger instances and API
In reply to Emil VelikovFrom: Emil Velikov <[email protected]>
--- monitor/att.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
monitor/att.c +6 -6
@@ -683,7 +683,7 @@ static void print_ltv(const char *str, void *user_data) }static bool print_ase_lv (const struct l2cap_frame *frame,const char *label, -struct util_ltv_debugger *decoder,size_t decoder_len) +const struct util_ltv_debugger *decoder,size_t decoder_len) {struct bt_hci_lv_data *lv;
@@ -705,7 +705,7 @@ static bool print_ase_lv(const struct l2cap_frame *frame, const char *label, }static bool print_ase_cc (const struct l2cap_frame *frame,const char *label, -struct util_ltv_debugger *decoder,size_t decoder_len) +const struct util_ltv_debugger *decoder,size_t decoder_len) {return print_ase_lv (frame, label, decoder, decoder_len); }
@@ -813,7 +813,7 @@ done:print_hex_field (" Data" , frame.data, frame.size); } -struct util_ltv_debugger ase_metadata_table[] = { +static const struct util_ltv_debugger ase_metadata_table[] = {UTIL_LTV_DEBUG (0x01 , ase_debug_preferred_context),UTIL_LTV_DEBUG (0x02 , ase_debug_context),UTIL_LTV_DEBUG (0x03 , ase_debug_program_info),
@@ -994,7 +994,7 @@ done:print_hex_field (" Data" , frame.data, frame.size); } -struct util_ltv_debugger pac_cap_table[] = { +static const struct util_ltv_debugger pac_cap_table[] = {UTIL_LTV_DEBUG (0x01 , pac_decode_freq),UTIL_LTV_DEBUG (0x02 , pac_decode_duration),UTIL_LTV_DEBUG (0x03 , pac_decode_channels),
@@ -1336,7 +1336,7 @@ done:print_hex_field (" Data" , frame.data, frame.size); } -struct util_ltv_debugger ase_cc_table[] = { +static const struct util_ltv_debugger ase_cc_table[] = {UTIL_LTV_DEBUG (0x01 , ase_debug_freq),UTIL_LTV_DEBUG (0x02 , ase_debug_duration),UTIL_LTV_DEBUG (0x03 , ase_debug_location),
@@ -2769,7 +2769,7 @@ static const struct big_enc_decoder {static bool print_subgroup_lv (const struct l2cap_frame *frame,const char *label, -struct util_ltv_debugger *debugger, +const struct util_ltv_debugger *debugger,size_t debugger_len) {struct bt_hci_lv_data *lv;
Signature · 1 line
2.43.0
PATCH 3/20 monitor: const annotate cmd/handler tables
In reply to Emil VelikovFrom: Emil Velikov <[email protected]>
--- monitor/att.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-)
monitor/att.c +17 -17
@@ -1710,7 +1710,7 @@ static bool ase_release_cmd(const struct l2cap_frame *frame) .func = _func, \ } -struct ase_cmd { +static const struct ase_cmd {const char *desc;bool (*func)(const struct l2cap_frame *frame); } ase_cmd_table[] = {
@@ -1732,7 +1732,7 @@ struct ase_cmd { ASE_CMD(0x08, "Release", ase_release_cmd), }; -static struct ase_cmd *ase_get_cmd (uint8_t op) +static const struct ase_cmd *ase_get_cmd (uint8_t op) {if (op >ARRAY_SIZE (ase_cmd_table))return NULL ;
@@ -1743,7 +1743,7 @@ static struct ase_cmd *ase_get_cmd(uint8_t op)static void print_ase_cmd (const struct l2cap_frame *frame) {uint8_t op, num, i; -struct ase_cmd *cmd; +const struct ase_cmd *cmd;if (!l2cap_frame_get_u8 ((void *)frame, &op)) {print_text (COLOR_ERROR ,"opcode: invalid size" );
@@ -1911,7 +1911,7 @@ static bool print_ase_cp_rsp_reason(const struct l2cap_frame *frame)static void print_ase_cp_rsp (const struct l2cap_frame *frame) {uint8_t op, num, i; -struct ase_cmd *cmd; +const struct ase_cmd *cmd;if (!l2cap_frame_get_u8 ((void *)frame, &op)) {print_text (COLOR_ERROR ," opcode: invalid size" );
@@ -2161,7 +2161,7 @@ static bool vcs_absolute_cmd(const struct l2cap_frame *frame) .func = _func, \ } -struct vcs_cmd { +static const struct vcs_cmd {const char *desc;bool (*func)(const struct l2cap_frame *frame); } vcs_cmd_table[] = {
@@ -2181,7 +2181,7 @@ struct vcs_cmd { VCS_CMD(0x06, "Mute", vcs_config_cmd), }; -static struct vcs_cmd *vcs_get_cmd (uint8_t op) +static const struct vcs_cmd *vcs_get_cmd (uint8_t op) {if (op >ARRAY_SIZE (vcs_cmd_table))return NULL ;
@@ -2192,7 +2192,7 @@ static struct vcs_cmd *vcs_get_cmd(uint8_t op)static void print_vcs_cmd (const struct l2cap_frame *frame) {uint8_t op; -struct vcs_cmd *cmd; +const struct vcs_cmd *cmd;if (!l2cap_frame_get_u8 ((void *)frame, &op)) {print_text (COLOR_ERROR ,"opcode: invalid size" );
@@ -3135,7 +3135,7 @@ static void bcast_audio_scan_cp_remove_src_cmd(const struct l2cap_frame *frame)print_field (" Source_ID: %u" , id); } -struct bcast_audio_scan_cp_cmd { +static const struct bcast_audio_scan_cp_cmd {const char *desc;void (*func)(const struct l2cap_frame *frame); } bcast_audio_scan_cp_cmd_table[] = {
@@ -3157,7 +3157,7 @@ struct bcast_audio_scan_cp_cmd { bcast_audio_scan_cp_remove_src_cmd), }; -static struct bcast_audio_scan_cp_cmd *bcast_audio_scan_cp_get_cmd (uint8_t op) +static const struct bcast_audio_scan_cp_cmd *bcast_audio_scan_cp_get_cmd (uint8_t op) {if (op >ARRAY_SIZE (bcast_audio_scan_cp_cmd_table))return NULL ;
@@ -3168,7 +3168,7 @@ static struct bcast_audio_scan_cp_cmd *bcast_audio_scan_cp_get_cmd(uint8_t op)static void print_bcast_audio_scan_cp_cmd (const struct l2cap_frame *frame) {uint8_t op; -struct bcast_audio_scan_cp_cmd *cmd; +const struct bcast_audio_scan_cp_cmd *cmd;if (!l2cap_frame_get_u8 ((void *)frame, &op)) {print_text (COLOR_ERROR ,"Opcode: invalid size" );
@@ -3340,7 +3340,7 @@ static void bgr_features_read(const struct l2cap_frame *frame) .notify = _notify \ } -struct gatt_handler { +static const struct gatt_handler { bt_uuid_t uuid; void (*read)(const struct l2cap_frame *frame); void (*write)(const struct l2cap_frame *frame);
@@ -3392,7 +3392,7 @@ struct gatt_handler { GMAS }; -static struct gatt_handler *get_handler_uuid (const bt_uuid_t *uuid) +static const struct gatt_handler *get_handler_uuid (const bt_uuid_t *uuid) {size_t i;
@@ -3400,7 +3400,7 @@ static struct gatt_handler *get_handler_uuid(const bt_uuid_t *uuid)return NULL ;for (i =0 ; i <ARRAY_SIZE (gatt_handlers); i++) { -struct gatt_handler *handler = &gatt_handlers[i]; +const struct gatt_handler *handler = &gatt_handlers[i];if (!bt_uuid_cmp (&handler->uuid, uuid))return handler;
@@ -3409,7 +3409,7 @@ static struct gatt_handler *get_handler_uuid(const bt_uuid_t *uuid)return NULL ; } -static struct gatt_handler *get_handler (struct gatt_db_attribute *attr) +static const struct gatt_handler *get_handler (struct gatt_db_attribute *attr) {return get_handler_uuid (gatt_db_attribute_get_type (attr)); }
@@ -3580,7 +3580,7 @@ static void queue_read(const struct l2cap_frame *frame, bt_uuid_t *uuid,struct att_conn_data *data;struct att_read *read;struct gatt_db_attribute *attr =NULL ; -struct gatt_handler *handler; +const struct gatt_handler *handler;if (handle) { attr =get_attribute (frame, handle, false);
@@ -3761,7 +3761,7 @@ static void print_write(const struct l2cap_frame *frame, uint16_t handle, size_t len) {struct gatt_db_attribute *attr; -struct gatt_handler *handler; +const struct gatt_handler *handler;print_handle (frame, handle, false);
@@ -3837,7 +3837,7 @@ static void print_notify(const struct l2cap_frame *frame, uint16_t handle, size_t len) {struct gatt_db_attribute *attr; -struct gatt_handler *handler; +const struct gatt_handler *handler;struct l2cap_frame clone;print_handle (frame, handle, true);
Signature · 1 line
2.43.0
PATCH 4/20 monitor: const annotate misc arrays
In reply to Emil VelikovFrom: Emil Velikov <[email protected]>
--- 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(-)
monitor/att.c +4 -4
@@ -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" },
monitor/avctp.c +1 -1
@@ -1802,7 +1802,7 @@ response: } -static struct { +static const struct {const char *str;bool reserved; } features_table[] = {
monitor/intel.c +1 -1
@@ -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)/*
monitor/l2cap.c +1 -1
@@ -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;
monitor/rfcomm.c +1 -1
@@ -32,7 +32,7 @@#include "sdp.h" #include "rfcomm.h" -static char *cr_str[] = { +static const char *cr_str[] = {"RSP" ,"CMD" };
monitor/sdp.c +2 -2
@@ -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[] = {
Signature · 1 line
2.43.0
PATCH 5/20 monitor: const annotate intel_version_tlv_desc::type_str and API
In reply to Emil VelikovFrom: Emil Velikov <[email protected]>
--- monitor/intel.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-)
monitor/intel.c +13 -13
@@ -171,25 +171,25 @@ struct intel_version_tlv { };static void print_version_tlv_u32 (const struct intel_version_tlv *tlv, -char *type_str) +const char *type_str) {print_field ("%s(%u): 0x%8.8x" , type_str, tlv->type,get_le32 (tlv->val)); }static void print_version_tlv_u16 (const struct intel_version_tlv *tlv, -char *type_str) +const char *type_str) {print_field ("%s(%u): 0x%4.4x" , type_str, tlv->type,get_le16 (tlv->val)); }static void print_version_tlv_u8 (const struct intel_version_tlv *tlv, -char *type_str) +const char *type_str) {print_field ("%s(%u): 0x%2.2x" , type_str, tlv->type,get_u8 (tlv->val)); }static void print_version_tlv_enabled (const struct intel_version_tlv *tlv, -char *type_str) +const char *type_str) { print_field("%s(%u): %s(%u)", type_str, tlv->type, tlv->val[0] ? "Enabled" : "Disabled",
@@ -197,7 +197,7 @@ static void print_version_tlv_enabled(const struct intel_version_tlv *tlv, }static void print_version_tlv_img_type (const struct intel_version_tlv *tlv, -char *type_str) +const char *type_str) {const char *str;
@@ -217,34 +217,34 @@ static void print_version_tlv_img_type(const struct intel_version_tlv *tlv, }static void print_version_tlv_timestamp (const struct intel_version_tlv *tlv, -char *type_str) +const char *type_str) {print_field ("%s(%u): %u-%u" , type_str, tlv->type, tlv->val[1 ], tlv->val[0 ]); }static void print_version_tlv_min_fw (const struct intel_version_tlv *tlv, -char *type_str) +const char *type_str) {print_field ("%s(%u): %u-%u.%u" , type_str, tlv->type, tlv->val[0 ], tlv->val[1 ],2000 + tlv->val[2 ]); }static void print_version_tlv_otp_bdaddr (const struct intel_version_tlv *tlv, -char *type_str) +const char *type_str) {packet_print_addr (type_str, tlv->val,0x00 ); }static void print_version_tlv_unknown (const struct intel_version_tlv *tlv, -char *type_str) +const char *type_str) {print_field ("%s(%u): " , type_str, tlv->type);packet_hexdump (tlv->val, tlv->len); }static void print_version_tlv_mfg (const struct intel_version_tlv *tlv, -char *type_str) +const char *type_str) {uint16_t mfg_id =get_le16 (tlv->val);
@@ -254,8 +254,8 @@ static void print_version_tlv_mfg(const struct intel_version_tlv *tlv,static const struct intel_version_tlv_desc {uint8_t type; -char *type_str; -void (*func)(const struct intel_version_tlv *tlv,char *type_str); +const char *type_str; +void (*func)(const struct intel_version_tlv *tlv,const char *type_str); } intel_version_tlv_table[] = { {16 ,"CNVi TOP" , print_version_tlv_u32 }, {17 ,"CNVr TOP" , print_version_tlv_u32 },
@@ -365,7 +365,7 @@ static void read_version_rsp(uint16_t index, const void *data, uint8_t size)static void read_version_cmd (uint16_t index,const void *data,uint8_t size) { -char *str; +const char *str;uint8_t type;/* This is the legacy read version command format and no further action
Signature · 1 line
2.43.0
PATCH 6/20 monitor: const annotate type_table and related API
In reply to Emil VelikovFrom: Emil Velikov <[email protected]>
--- monitor/sdp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
monitor/sdp.c +3 -3
@@ -148,9 +148,9 @@ static void print_boolean(uint8_t indent, const uint8_t *data, uint32_t size) #define SIZES(args...) ((uint8_t[]) { args, 0xff } ) -static struct { +static const struct { uint8_t value; - uint8_t *sizes; + const uint8_t *sizes; bool recurse; const char *str; void (*print) (uint8_t indent, const uint8_t *data, uint32_t size);
@@ -184,7 +184,7 @@ static const struct { { } }; -static bool valid_size (uint8_t size,uint8_t *sizes) +static bool valid_size (uint8_t size,const uint8_t *sizes) {int i;
Signature · 1 line
2.43.0
PATCH 7/20 profiles: annotate immutable data as const
In reply to Emil VelikovFrom: Emil Velikov <[email protected]>
--- profiles/audio/avctp.c | 2 +- profiles/audio/avrcp.c | 8 ++++---- profiles/audio/media.c | 6 +++--- profiles/audio/sink.c | 2 +- profiles/audio/source.c | 2 +- profiles/audio/transport.c | 12 ++++++------ profiles/health/hdp_util.c | 15 +++++++-------- profiles/iap/main.c | 2 +- 8 files changed, 24 insertions(+), 25 deletions(-)
profiles/audio/avctp.c +1 -1
@@ -228,7 +228,7 @@ struct avctp_browsing_pdu_handler {GDestroyNotify destroy; }; -static struct { +static const struct { const char *name; uint8_t avc; uint16_t uinput;
profiles/audio/avrcp.c +4 -4
@@ -290,7 +290,7 @@ struct control_pdu_handler { uint8_t transaction); }; -static struct { +static const struct {uint8_t feature_bit;uint8_t avc; } passthrough_map[] = {
@@ -361,7 +361,7 @@ static unsigned int avctp_id = 0;static uint8_t default_features[16 ];/* Company IDs supported by this device */ -static uint32_t company_ids[] = { +static const uint32_t company_ids[] = {IEEEID_BTSIG , };
@@ -2118,7 +2118,7 @@ failed: pdu->param_len =cpu_to_be16 (1 ); } -static struct browsing_pdu_handler { +static const struct browsing_pdu_handler { uint8_t pdu_id; void (*func) (struct avrcp *session, struct avrcp_browsing_header *pdu, uint8_t transaction);
@@ -2147,7 +2147,7 @@ static size_t handle_browsing_pdu(struct avctp *conn, size_t operand_count, void *user_data) { struct avrcp *session = user_data; -struct browsing_pdu_handler *handler; +const struct browsing_pdu_handler *handler;struct avrcp_browsing_header *pdu = (void *) operands; DBG("AVRCP Browsing PDU 0x%02X, len 0x%04X", pdu->pdu_id,
profiles/audio/media.c +3 -3
@@ -1420,7 +1420,7 @@ static bool experimental_bcast_sink_ep_supported(struct btd_adapter *adapter)return g_dbus_get_flags () &G_DBUS_FLAG_ENABLE_EXPERIMENTAL ; } -static struct media_endpoint_init { +static const struct media_endpoint_init { const char *uuid; bool (*func)(struct media_endpoint *endpoint, int *err); bool (*supported)(struct btd_adapter *adapter);
@@ -1456,7 +1456,7 @@ media_endpoint_create(struct media_adapter *adapter, int *err) {struct media_endpoint *endpoint; -struct media_endpoint_init *init; +const struct media_endpoint_init *init;size_t i;bool succeeded = false;
@@ -3244,7 +3244,7 @@ static gboolean supported_uuids(const GDBusPropertyTable *property, DBUS_TYPE_STRING_AS_STRING, &entry);for (i =0 ; i <ARRAY_SIZE (init_table); i++) { -struct media_endpoint_init *init = &init_table[i]; +const struct media_endpoint_init *init = &init_table[i];if (init->supported (adapter->btd_adapter)) dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING,
profiles/audio/sink.c +1 -1
@@ -62,7 +62,7 @@ struct sink_state_callback {static GSList *sink_callbacks =NULL ; -static char *str_state[] = { +static const char *str_state[] = {"SINK_STATE_DISCONNECTED" ,"SINK_STATE_CONNECTING" ,"SINK_STATE_CONNECTED" ,
profiles/audio/source.c +1 -1
@@ -61,7 +61,7 @@ struct source_state_callback {static GSList *source_callbacks =NULL ; -static char *str_state[] = { +static const char *str_state[] = {"SOURCE_STATE_DISCONNECTED" ,"SOURCE_STATE_CONNECTING" ,"SOURCE_STATE_CONNECTED" ,
profiles/audio/transport.c +6 -6
@@ -55,7 +55,7 @@ typedef enum {TRANSPORT_STATE_SUSPENDING ,/* Release in progress */ } transport_state_t; -static char *str_state[] = { +static const char *str_state[] = {"TRANSPORT_STATE_IDLE" ,"TRANSPORT_STATE_PENDING" , "TRANSPORT_STATE_REQUESTING",
@@ -124,7 +124,7 @@ struct media_transport {uint16_t imtu;/* Transport input mtu */ uint16_t omtu;/* Transport output mtu */ transport_state_t state; -struct media_transport_ops *ops; +const struct media_transport_ops *ops;void *data; };
@@ -1749,7 +1749,7 @@ static void *transport_bap_init(struct media_transport *transport, void *stream)#define BAP_BC_OPS (_uuid) \ BAP_OPS(_uuid, transport_bap_bc_properties, NULL, NULL) -static struct media_transport_ops transport_ops[] = { +static const struct media_transport_ops transport_ops[] = {A2DP_OPS (A2DP_SOURCE_UUID , transport_a2dp_src_init, transport_a2dp_src_set_volume, transport_a2dp_src_destroy),
@@ -1762,12 +1762,12 @@ static struct media_transport_ops transport_ops[] = { BAP_BC_OPS(BAA_SERVICE_UUID), }; -static struct media_transport_ops *media_transport_find_ops (const char *uuid) +static const struct media_transport_ops *media_transport_find_ops (const char *uuid) {size_t i;for (i =0 ; i <ARRAY_SIZE (transport_ops); i++) { -struct media_transport_ops *ops = &transport_ops[i]; +const struct media_transport_ops *ops = &transport_ops[i];if (!strcasecmp (uuid, ops->uuid))return ops;
@@ -1784,7 +1784,7 @@ struct media_transport *media_transport_create(struct btd_device *device, {struct media_endpoint *endpoint = data;struct media_transport *transport; -struct media_transport_ops *ops; +const struct media_transport_ops *ops;static int fd =0 ; transport = g_new0(struct media_transport, 1);
profiles/health/hdp_util.c +7 -8
@@ -42,7 +42,7 @@ typedef gboolean (*parse_item_f)(DBusMessageIter *iter, gpointer user_data, GError **err);struct dict_entry_func { -char *key; +const char *key;parse_item_f func; };
@@ -67,7 +67,7 @@ struct get_dcpsm_data {GDestroyNotify destroy; }; -static gboolean parse_dict_entry (struct dict_entry_func dict_context[], +static gboolean parse_dict_entry (const struct dict_entry_func dict_context[],DBusMessageIter *iter,GError **err,gpointer user_data)
@@ -75,7 +75,6 @@ static gboolean parse_dict_entry(struct dict_entry_func dict_context[],DBusMessageIter entry;char *key;int ctype, i; -struct dict_entry_func df;dbus_message_iter_recurse (iter, &entry); ctype =dbus_message_iter_get_arg_type (&entry);
@@ -88,9 +87,9 @@ static gboolean parse_dict_entry(struct dict_entry_func dict_context[],dbus_message_iter_get_basic (&entry, &key);dbus_message_iter_next (&entry);/* Find function and call it */ -for (i =0 , df = dict_context[0 ]; df.key; i++, df = dict_context[i]) { -if (g_ascii_strcasecmp (df.key, key) ==0 ) -return df.func (&entry, user_data, err); +for (i =0 ; dict_context[i].key; i++) { +if (g_ascii_strcasecmp (dict_context[i].key, key) ==0 ) +return dict_context[i].func (&entry, user_data, err); } g_set_error(err, HDP_ERROR, HDP_DIC_ENTRY_PARSE_ERROR,
@@ -98,7 +97,7 @@ static gboolean parse_dict_entry(struct dict_entry_func dict_context[],return FALSE; } -static gboolean parse_dict (struct dict_entry_func dict_context[], +static gboolean parse_dict (const struct dict_entry_func dict_context[],DBusMessageIter *iter,GError **err,gpointer user_data)
@@ -273,7 +272,7 @@ static gboolean parse_chan_type(DBusMessageIter *iter, gpointer data,return TRUE; } -static struct dict_entry_func dict_parser[] = { +static const struct dict_entry_func dict_parser[] = { {"DataType" , parse_data_type}, {"Role" , parse_role}, {"Description" , parse_desc},
profiles/iap/main.c +1 -1
@@ -398,7 +398,7 @@ static guint setup_signalfd(void)static gboolean option_version = FALSE; -static GOptionEntry options[] = { +static const GOptionEntry options[] = { {"version" ,'v' ,0 ,G_OPTION_ARG_NONE , &option_version,"Show version information and exit" }, {NULL },
Signature · 1 line
2.43.0
PATCH 8/20 attrib: annotate immutable data as const
In reply to Emil VelikovFrom: Emil Velikov <[email protected]>
--- attrib/gatttool.c | 8 ++++---- attrib/interactive.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-)
attrib/gatttool.c +4 -4
@@ -454,7 +454,7 @@ static gboolean parse_uuid(const char *key, const char *value,return TRUE; } -static GOptionEntry primary_char_options[] = { +static const GOptionEntry primary_char_options[] = { {"start" ,'s' ,0 ,G_OPTION_ARG_INT , &opt_start,"Starting handle (optional)" ,"0x0001" }, {"end" ,'e' ,0 ,G_OPTION_ARG_INT , &opt_end,
@@ -464,7 +464,7 @@ static GOptionEntry primary_char_options[] = { { NULL }, }; -static GOptionEntry char_rw_options[] = { +static const GOptionEntry char_rw_options[] = { { "handle", 'a' , 0, G_OPTION_ARG_INT, &opt_handle, "Read/Write characteristic by handle (required)", "0x0001" }, { "value", 'n' , 0, G_OPTION_ARG_STRING, &opt_value,
@@ -473,7 +473,7 @@ static GOptionEntry char_rw_options[] = { {NULL}, }; -static GOptionEntry gatt_options[] = { +static const GOptionEntry gatt_options[] = { { "primary", 0, 0, G_OPTION_ARG_NONE, &opt_primary, "Primary Service Discovery", NULL }, { "characteristics", 0, 0, G_OPTION_ARG_NONE, &opt_characteristics,
@@ -494,7 +494,7 @@ static GOptionEntry gatt_options[] = { { NULL }, }; -static GOptionEntry options[] = { +static const GOptionEntry options[] = { { "adapter", 'i', 0, G_OPTION_ARG_STRING, &opt_src, "Specify local adapter interface", "hciX" }, { "device", 'b', 0, G_OPTION_ARG_STRING, &opt_dst,
attrib/interactive.c +1 -1
@@ -760,7 +760,7 @@ static void cmd_mtu(int argcp, char **argvp)gatt_exchange_mtu (attrib, opt_mtu, exchange_mtu_cb,NULL ); } -static struct { +static const struct { const char *cmd; void (*func)(int argcp, char **argvp); const char *params;
Signature · 1 line
2.43.0
PATCH 9/20 client: annotate struct option instances as const
In reply to Emil VelikovFrom: Emil Velikov <[email protected]>
--- client/mgmt.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-)
client/mgmt.c +20 -20
@@ -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,"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' },
Signature · 1 line
2.43.0
PATCH 10/20 emulator: const annotate rfcomm_crc_table[]
In reply to Emil VelikovFrom: Emil Velikov <[email protected]>
--- emulator/bthost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
emulator/bthost.c +1 -1
@@ -59,7 +59,7 @@/* RFCOMM FCS calculation */ #define CRC (data) (rfcomm_crc_table[rfcomm_crc_table[0xff ^ data[0]] ^ data[1]]) -static unsigned char rfcomm_crc_table[256 ] = { +static const unsigned char rfcomm_crc_table[256 ] = {0x00 ,0x91 ,0xe3 ,0x72 ,0x07 ,0x96 ,0xe4 ,0x75 ,0x0e ,0x9f ,0xed ,0x7c ,0x09 ,0x98 ,0xea ,0x7b ,0x1c ,0x8d ,0xff ,0x6e ,0x1b ,0x8a ,0xf8 ,0x69 ,
Signature · 1 line
2.43.0
PATCH 11/20 gobex: const annotate RO arrays, use G_N_ELEMENTS
In reply to Emil VelikovFrom: Emil Velikov <[email protected]>
--- gobex/gobex.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
gobex/gobex.c +4 -4
@@ -122,7 +122,7 @@ struct setpath_data {guint8 constants; } __attribute__ ((packed)); -static struct error_code { +static const struct error_code {guint8 code;const char *name; } obex_errors[] = {
@@ -169,7 +169,7 @@ static struct error_code {const char *g_obex_strerror (guint8 err_code) { -struct error_code *error; +const struct error_code *error;for (error = obex_errors; error->name !=NULL ; error++) {if (error->code == err_code)
@@ -1423,7 +1423,7 @@ failed:return FALSE; } -static GDebugKey keys[] = { +static const GDebugKey keys[] = { {"error" ,G_OBEX_DEBUG_ERROR }, {"command" ,G_OBEX_DEBUG_COMMAND }, {"transfer" ,G_OBEX_DEBUG_TRANSFER },
@@ -1443,7 +1443,7 @@ GObex *g_obex_new(GIOChannel *io, GObexTransportType transport_type,const char *env =g_getenv ("GOBEX_DEBUG" );if (env) { - gobex_debug =g_parse_debug_string (env, keys,7 ); + gobex_debug =g_parse_debug_string (env, keys,G_N_ELEMENTS (keys));g_setenv ("G_MESSAGES_DEBUG" ,"gobex" , FALSE); }else gobex_debug =G_OBEX_DEBUG_NONE ;
Signature · 1 line
2.43.0
PATCH 12/20 lib: const annotate hci_map instances and related API
In reply to Emil VelikovFrom: Emil Velikov <[email protected]>
--- client/mgmt.c | 2 +- lib/hci.c | 42 +++++++++++++++++++++--------------------- lib/hci_lib.h | 4 ++-- 3 files changed, 24 insertions(+), 24 deletions(-)
client/mgmt.c +1 -1
@@ -1484,7 +1484,7 @@ static void ext_index_rsp(uint8_t status, uint16_t len, const void *param,for (i =0 ; i < count; i++) {uint16_t index =le16_to_cpu (rp->entry[i].index); -char *busstr =hci_bustostr (rp->entry[i].bus); +const char *busstr =hci_bustostr (rp->entry[i].bus);switch (rp->entry[i].type) {case 0x00 :
lib/hci.c +21 -21
160 lines not on this page · raw message
lib/hci_lib.h +2 -2
@@ -132,9 +132,9 @@ int hci_le_read_remote_features(int dd, uint16_t handle, uint8_t *features, intint hci_for_each_dev (int flag,int (*func)(int dd,int dev_id,long arg),long arg);int hci_get_route (bdaddr_t *bdaddr); -char *hci_bustostr (int bus); +const char *hci_bustostr (int bus);char *hci_typetostr (int type); -char *hci_dtypetostr (int type); +const char *hci_dtypetostr (int type);char *hci_dflagstostr (uint32_t flags);char *hci_ptypetostr (unsigned int ptype);int hci_strtoptype (char *str,unsigned int *val);
Signature · 1 line
2.43.0
PATCH 13/20 lib: const annotate tupla instances and API
In reply to Emil VelikovFrom: Emil Velikov <[email protected]>
--- lib/sdp.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
lib/sdp.c +10 -10
@@ -47,7 +47,7 @@ #define SDPDBG(fmt...)#endif -static uint128_t bluetooth_base_uuid = { +static const uint128_t bluetooth_base_uuid = { .data = {0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x10 ,0x00 ,0x80 ,0x00 ,0x00 ,0x80 ,0x5F ,0x9B ,0x34 ,0xFB } };
@@ -65,10 +65,10 @@ static int sdp_gen_buffer(sdp_buf_t *buf, sdp_data_t *d);/* Message structure. */ struct tupla {int index; -char *str; +const char *str; }; -static struct tupla Protocol[] = { +static const struct tupla Protocol[] = { {SDP_UUID ,"SDP" }, {UDP_UUID ,"UDP" }, {RFCOMM_UUID ,"RFCOMM" },
@@ -97,7 +97,7 @@ static struct tupla Protocol[] = { { 0 } }; -static struct tupla ServiceClass[] = { +static const struct tupla ServiceClass[] = { {SDP_SERVER_SVCLASS_ID ,"SDP Server" }, {BROWSE_GRP_DESC_SVCLASS_ID ,"Browse Group Descriptor" }, {PUBLIC_BROWSE_GROUP ,"Public Browse Group" },
@@ -176,9 +176,9 @@ static struct tupla ServiceClass[] = {#define Profile ServiceClass -static char *string_lookup (struct tupla *pt0,int index) +static const char *string_lookup (const struct tupla *pt0,int index) { -struct tupla *pt; +const struct tupla *pt;for (pt = pt0; pt->index; pt++)if (pt->index == index)
@@ -187,7 +187,7 @@ static char *string_lookup(struct tupla *pt0, int index)return "" ; } -static char *string_lookup_uuid (struct tupla *pt0,const uuid_t *uuid) +static const char *string_lookup_uuid (const struct tupla *pt0,const uuid_t *uuid) {uuid_t tmp_uuid;
@@ -209,9 +209,9 @@ static char *string_lookup_uuid(struct tupla *pt0, const uuid_t *uuid)* Prints into a string the Protocol UUID * coping a maximum of n characters. */ -static int uuid2str (struct tupla *message,const uuid_t *uuid,char *str,size_t n) +static int uuid2str (const struct tupla *message,const uuid_t *uuid,char *str,size_t n) { -char *str2; +const char *str2;if (!uuid) {snprintf (str, n,"NULL" );
@@ -2763,7 +2763,7 @@ uuid_t *sdp_uuid_to_uuid128(const uuid_t *uuid)*/ int sdp_uuid128_to_uuid (uuid_t *uuid) { -uint128_t *b = &bluetooth_base_uuid; +const uint128_t *b = &bluetooth_base_uuid;uint128_t *u = &uuid->value.uuid128;uint32_t data;unsigned int i;
Signature · 1 line
2.43.0
PATCH 14/20 mesh: const annotate misc data
In reply to Emil VelikovFrom: Emil Velikov <[email protected]>
--- mesh/agent.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
mesh/agent.c +2 -2
@@ -61,7 +61,7 @@ struct oob_info {uint16_t mask; }; -static struct prov_action cap_table[] = { +static const struct prov_action cap_table[] = { {"blink" ,0x0001 ,0x0000 ,1 }, {"beep" ,0x0002 ,0x0000 ,1 }, {"vibrate" ,0x0004 ,0x0000 ,1 },
@@ -73,7 +73,7 @@ static struct prov_action cap_table[] = { {"in-alpha", 0x0000, 0x0008, 8} }; -static struct oob_info oob_table[] = { +static const struct oob_info oob_table[] = { {"other" ,0x0001 }, {"uri" ,0x0002 }, {"machine-code-2d" ,0x0004 },
Signature · 1 line
2.43.0
PATCH 15/20 obexd: remove obex_mime_type_driver::set_io_watch
In reply to Emil VelikovFrom: Emil Velikov <[email protected]>
All the drivers use the default function, where the register function modifies what should be a constant vtable.
Instead let's remove the indirection, export and use the function as applicable.
Since we have set and reset, export both functions and cleanup the users.
--- obexd/src/mimetype.c | 12 ++---------- obexd/src/mimetype.h | 6 ++++-- obexd/src/obex.c | 12 ++++++------ 3 files changed, 12 insertions(+), 18 deletions(-)
obexd/src/mimetype.c +2 -10
@@ -73,7 +73,7 @@ static struct io_watch *find_io_watch(void *object)return NULL ; } -static void reset_io_watch (void *object) +void obex_object_reset_io_watch (void *object) {struct io_watch *watch;
@@ -85,16 +85,11 @@ static void reset_io_watch(void *object)g_free (watch); } -static int set_io_watch (void *object,obex_object_io_func func, +int obex_object_set_io_watch (void *object,obex_object_io_func func,void *user_data) {struct io_watch *watch; -if (func ==NULL ) { -reset_io_watch (object); -return 0 ; - } - watch =find_io_watch (object);if (watch)return -EPERM ;
@@ -181,9 +176,6 @@ int obex_mime_type_driver_register(struct obex_mime_type_driver *driver)return -EPERM ; } -if (driver->set_io_watch ==NULL ) - driver->set_io_watch = set_io_watch; -DBG ("driver %p mimetype %s registered" , driver, driver->mimetype); drivers =g_slist_append (drivers, driver);
obexd/src/mimetype.h +4 -2
@@ -28,8 +28,6 @@ struct obex_mime_type_driver {int (*copy) (const char *name,const char *destname);int (*move) (const char *name,const char *destname);int (*remove) (const char *name); -int (*set_io_watch) (void *object,obex_object_io_func func, -void *user_data); };int obex_mime_type_driver_register (struct obex_mime_type_driver *driver);
@@ -40,3 +38,7 @@ struct obex_mime_type_driver *obex_mime_type_driver_find(const uint8_t *target, unsigned int who_size);void obex_object_set_io_flags (void *object,int flags,int err); + +void obex_object_reset_io_watch (void *object); +int obex_object_set_io_watch (void *object,obex_object_io_func func, +void *user_data);
obexd/src/obex.c +6 -6
@@ -119,7 +119,7 @@ static void os_reset_session(struct obex_session *os)os_session_mark_aborted (os);if (os->object) { - os->driver->set_io_watch (os->object,NULL ,NULL ); +obex_object_reset_io_watch (os->object); os->driver->close (os->object);if (os->aborted && os->cmd ==G_OBEX_OP_PUT && os->path && os->driver->remove)
@@ -357,7 +357,7 @@ static gssize driver_read(struct obex_session *os, void *buf, gsize size)if (len == -ENOSTR )return 0 ;if (len == -EAGAIN ) - os->driver->set_io_watch (os->object, handle_async_io, +obex_object_set_io_watch (os->object, handle_async_io, os); }
@@ -395,7 +395,7 @@ static void transfer_complete(GObex *obex, GError *err, gpointer user_data)if (os->object && os->driver && os->driver->flush) {if (os->driver->flush (os->object) == -EAGAIN ) {g_obex_suspend (os->obex); - os->driver->set_io_watch (os->object, handle_async_io, +obex_object_set_io_watch (os->object, handle_async_io, os);return ; }
@@ -525,7 +525,7 @@ static gboolean recv_data(const void *buf, gsize size, gpointer user_data)if (ret == -EAGAIN ) {g_obex_suspend (os->obex); - os->driver->set_io_watch (os->object, handle_async_io, os); +obex_object_set_io_watch (os->object, handle_async_io, os);return TRUE; }
@@ -699,7 +699,7 @@ int obex_get_stream_start(struct obex_session *os, const char *filename)return err;g_obex_suspend (os->obex); - os->driver->set_io_watch (os->object, handle_async_io, os); +obex_object_set_io_watch (os->object, handle_async_io, os);return 0 ; }
@@ -772,7 +772,7 @@ static gboolean check_put(GObex *obex, GObexPacket *req, void *user_data)break ;case -EAGAIN :g_obex_suspend (os->obex); - os->driver->set_io_watch (os->object, handle_async_io, os); +obex_object_set_io_watch (os->object, handle_async_io, os);return TRUE;default :os_set_response (os, ret);
Signature · 1 line
2.43.0
PATCH 16/20 obexd: const obex_mime_type_driver instances and API
In reply to Emil VelikovFrom: Emil Velikov <[email protected]>
--- obexd/client/mns.c | 2 +- obexd/plugins/filesystem.c | 8 ++++---- obexd/plugins/irmc.c | 2 +- obexd/plugins/mas.c | 16 ++++++++-------- obexd/plugins/pbap.c | 6 +++--- obexd/plugins/pcsuite.c | 2 +- obexd/plugins/syncevolution.c | 2 +- obexd/src/mimetype.c | 14 +++++++------- obexd/src/mimetype.h | 6 +++--- obexd/src/obex-priv.h | 2 +- 10 files changed, 30 insertions(+), 30 deletions(-)
obexd/client/mns.c +1 -1
@@ -356,7 +356,7 @@ static struct obex_service_driver mns = { .disconnect = mns_disconnect, }; -static struct obex_mime_type_driver mime_event_report = { +static const struct obex_mime_type_driver mime_event_report = { .target =MNS_TARGET , .target_size =TARGET_SIZE , .mimetype ="x-bt/MAP-event-report" ,
obexd/plugins/filesystem.c +4 -4
@@ -642,7 +642,7 @@ done:return err; } -static struct obex_mime_type_driver file = { +static const struct obex_mime_type_driver file = { .open = filesystem_open, .close = filesystem_close, .read = filesystem_read,
@@ -652,7 +652,7 @@ static struct obex_mime_type_driver file = { .copy = filesystem_copy, }; -static struct obex_mime_type_driver capability = { +static const struct obex_mime_type_driver capability = { .target =FTP_TARGET , .target_size =FTP_TARGET_SIZE , .mimetype ="x-obex/capability" ,
@@ -661,7 +661,7 @@ static struct obex_mime_type_driver capability = { .read = capability_read, }; -static struct obex_mime_type_driver folder = { +static const struct obex_mime_type_driver folder = { .target =FTP_TARGET , .target_size =FTP_TARGET_SIZE , .mimetype ="x-obex/folder-listing" ,
@@ -670,7 +670,7 @@ static struct obex_mime_type_driver folder = { .read = folder_read, }; -static struct obex_mime_type_driver pcsuite = { +static const struct obex_mime_type_driver pcsuite = { .target =FTP_TARGET , .target_size =FTP_TARGET_SIZE , .who =PCSUITE_WHO ,
obexd/plugins/irmc.c +1 -1
@@ -419,7 +419,7 @@ static ssize_t irmc_read(void *object, void *buf, size_t count)return len; } -static struct obex_mime_type_driver irmc_driver = { +static const struct obex_mime_type_driver irmc_driver = { .target =IRMC_TARGET , .target_size =IRMC_TARGET_SIZE , .open = irmc_open,
obexd/plugins/mas.c +8 -8
@@ -793,7 +793,7 @@ static struct obex_service_driver mas = { .disconnect = mas_disconnect, }; -static struct obex_mime_type_driver mime_map = { +static const struct obex_mime_type_driver mime_map = { .target =MAS_TARGET , .target_size =TARGET_SIZE , .mimetype =NULL ,
@@ -803,7 +803,7 @@ static struct obex_mime_type_driver mime_map = { .write = any_write, }; -static struct obex_mime_type_driver mime_message = { +static const struct obex_mime_type_driver mime_message = { .target =MAS_TARGET , .target_size =TARGET_SIZE , .mimetype ="x-bt/message" ,
@@ -813,7 +813,7 @@ static struct obex_mime_type_driver mime_message = { .write = any_write, }; -static struct obex_mime_type_driver mime_folder_listing = { +static const struct obex_mime_type_driver mime_folder_listing = { .target =MAS_TARGET , .target_size =TARGET_SIZE , .mimetype ="x-obex/folder-listing" ,
@@ -824,7 +824,7 @@ static struct obex_mime_type_driver mime_folder_listing = { .write = any_write, }; -static struct obex_mime_type_driver mime_msg_listing = { +static const struct obex_mime_type_driver mime_msg_listing = { .target =MAS_TARGET , .target_size =TARGET_SIZE , .mimetype ="x-bt/MAP-msg-listing" ,
@@ -835,7 +835,7 @@ static struct obex_mime_type_driver mime_msg_listing = { .write = any_write, }; -static struct obex_mime_type_driver mime_notification_registration = { +static const struct obex_mime_type_driver mime_notification_registration = { .target =MAS_TARGET , .target_size =TARGET_SIZE , .mimetype ="x-bt/MAP-NotificationRegistration" ,
@@ -845,7 +845,7 @@ static struct obex_mime_type_driver mime_notification_registration = { .write = any_write, }; -static struct obex_mime_type_driver mime_message_status = { +static const struct obex_mime_type_driver mime_message_status = { .target =MAS_TARGET , .target_size =TARGET_SIZE , .mimetype ="x-bt/messageStatus" ,
@@ -855,7 +855,7 @@ static struct obex_mime_type_driver mime_message_status = { .write = any_write, }; -static struct obex_mime_type_driver mime_message_update = { +static const struct obex_mime_type_driver mime_message_update = { .target =MAS_TARGET , .target_size =TARGET_SIZE , .mimetype ="x-bt/MAP-messageUpdate" ,
@@ -865,7 +865,7 @@ static struct obex_mime_type_driver mime_message_update = { .write = any_write, }; -static struct obex_mime_type_driver *map_drivers[] = { +static const struct obex_mime_type_driver *map_drivers[] = { &mime_map, &mime_message, &mime_folder_listing,
obexd/plugins/pbap.c +3 -3
@@ -929,7 +929,7 @@ static ssize_t vobject_vcard_read(void *object, void *buf, size_t count)return string_read (obj->buffer, buf, count); } -static struct obex_mime_type_driver mime_pull = { +static const struct obex_mime_type_driver mime_pull = { .target =PBAP_TARGET , .target_size =TARGET_SIZE , .mimetype ="x-bt/phonebook" ,
@@ -939,7 +939,7 @@ static struct obex_mime_type_driver mime_pull = { .get_next_header = vobject_pull_get_next_header, }; -static struct obex_mime_type_driver mime_list = { +static const struct obex_mime_type_driver mime_list = { .target =PBAP_TARGET , .target_size =TARGET_SIZE , .mimetype ="x-bt/vcard-listing" ,
@@ -949,7 +949,7 @@ static struct obex_mime_type_driver mime_list = { .get_next_header = vobject_list_get_next_header, }; -static struct obex_mime_type_driver mime_vcard = { +static const struct obex_mime_type_driver mime_vcard = { .target =PBAP_TARGET , .target_size =TARGET_SIZE , .mimetype ="x-bt/vcard" ,
obexd/plugins/pcsuite.c +1 -1
@@ -467,7 +467,7 @@ static int backup_flush(void *object)return 0 ; } -static struct obex_mime_type_driver backup = { +static const struct obex_mime_type_driver backup = { .target =FTP_TARGET , .target_size =TARGET_SIZE , .mimetype ="application/vnd.nokia-backup" ,
obexd/plugins/syncevolution.c +1 -1
@@ -427,7 +427,7 @@ static ssize_t synce_write(void *object, const void *buf, size_t count)return -EAGAIN ; } -static struct obex_mime_type_driver synce_driver = { +static const struct obex_mime_type_driver synce_driver = { .target =SYNCML_TARGET , .target_size =SYNCML_TARGET_SIZE , .open = synce_open,
obexd/src/mimetype.c +7 -7
@@ -104,7 +104,7 @@ int obex_object_set_io_watch(void *object, obex_object_io_func func,return 0 ; } -static struct obex_mime_type_driver *find_driver (const uint8_t *target, +static const struct obex_mime_type_driver *find_driver (const uint8_t *target,unsigned int target_size,const char *mimetype,const uint8_t *who,unsigned int who_size)
@@ -112,7 +112,7 @@ static struct obex_mime_type_driver *find_driver(const uint8_t *target,GSList *l;for (l = drivers; l; l = l->next) { -struct obex_mime_type_driver *driver = l->data; +const struct obex_mime_type_driver *driver = l->data;if (memncmp0 (target, target_size, driver->target, driver->target_size))continue ;
@@ -134,12 +134,12 @@ static struct obex_mime_type_driver *find_driver(const uint8_t *target,return NULL ; } -struct obex_mime_type_driver *obex_mime_type_driver_find (const uint8_t *target, +const struct obex_mime_type_driver *obex_mime_type_driver_find (const uint8_t *target,unsigned int target_size,const char *mimetype,const uint8_t *who,unsigned int who_size) { -struct obex_mime_type_driver *driver; +const struct obex_mime_type_driver *driver; driver =find_driver (target, target_size, mimetype, who, who_size);if (driver ==NULL ) {
@@ -162,7 +162,7 @@ struct obex_mime_type_driver *obex_mime_type_driver_find(const uint8_t *target,return driver; } -int obex_mime_type_driver_register (struct obex_mime_type_driver *driver) +int obex_mime_type_driver_register (const struct obex_mime_type_driver *driver) {if (!driver) {error ("Invalid driver" );
@@ -178,12 +178,12 @@ int obex_mime_type_driver_register(struct obex_mime_type_driver *driver)DBG ("driver %p mimetype %s registered" , driver, driver->mimetype); - drivers =g_slist_append (drivers, driver); + drivers =g_slist_append (drivers, (gpointer )driver);return 0 ; } -void obex_mime_type_driver_unregister (struct obex_mime_type_driver *driver) +void obex_mime_type_driver_unregister (const struct obex_mime_type_driver *driver) {if (!g_slist_find (drivers, driver)) {error ("Unable to unregister: No such driver %p" , driver);
obexd/src/mimetype.h +3 -3
@@ -30,9 +30,9 @@ struct obex_mime_type_driver {int (*remove) (const char *name); }; -int obex_mime_type_driver_register (struct obex_mime_type_driver *driver); -void obex_mime_type_driver_unregister (struct obex_mime_type_driver *driver); -struct obex_mime_type_driver *obex_mime_type_driver_find (const uint8_t *target, +int obex_mime_type_driver_register (const struct obex_mime_type_driver *driver); +void obex_mime_type_driver_unregister (const struct obex_mime_type_driver *driver); +const struct obex_mime_type_driver *obex_mime_type_driver_find (const uint8_t *target,unsigned int target_size,const char *mimetype,const uint8_t *who,unsigned int who_size);
obexd/src/obex-priv.h +1 -1
@@ -38,7 +38,7 @@ struct obex_session {struct obex_server *server;gboolean checked;GObex *obex; -struct obex_mime_type_driver *driver; +const struct obex_mime_type_driver *driver;gboolean headers_sent; };
Signature · 1 line
2.43.0
PATCH 17/20 obexd: const obex_service_driver instances and API
In reply to Emil VelikovFrom: Emil Velikov <[email protected]>
--- obexd/client/mns.c | 2 +- obexd/plugins/bluetooth.c | 4 ++-- obexd/plugins/ftp.c | 2 +- obexd/plugins/irmc.c | 2 +- obexd/plugins/mas.c | 2 +- obexd/plugins/opp.c | 2 +- obexd/plugins/pbap.c | 2 +- obexd/plugins/pcsuite.c | 2 +- obexd/plugins/syncevolution.c | 2 +- obexd/src/obex-priv.h | 2 +- obexd/src/server.c | 2 +- obexd/src/service.c | 20 ++++++++++---------- obexd/src/service.h | 6 +++--- 13 files changed, 25 insertions(+), 25 deletions(-)
obexd/client/mns.c +1 -1
@@ -346,7 +346,7 @@ static ssize_t event_report_write(void *obj, const void *buf, size_t count)return count; } -static struct obex_service_driver mns = { +static const struct obex_service_driver mns = { .name ="Message Notification server" , .service =OBEX_MNS , .target =MNS_TARGET ,
obexd/plugins/bluetooth.c +2 -2
@@ -41,7 +41,7 @@struct bluetooth_profile {struct obex_server *server; -struct obex_service_driver *driver; +const struct obex_service_driver *driver;char *uuid;char *path; };
@@ -355,7 +355,7 @@ static void *bluetooth_start(struct obex_server *server, int *err)const GSList *l;for (l = server->drivers; l; l = l->next) { -struct obex_service_driver *driver = l->data; +const struct obex_service_driver *driver = l->data;struct bluetooth_profile *profile;const char *uuid;
obexd/plugins/ftp.c +1 -1
@@ -494,7 +494,7 @@ static void ftp_reset(struct obex_session *os, void *user_data)manager_emit_transfer_completed (ftp->transfer); } -static struct obex_service_driver ftp = { +static const struct obex_service_driver ftp = { .name ="File Transfer server" , .service =OBEX_FTP , .target =FTP_TARGET ,
obexd/plugins/irmc.c +1 -1
@@ -427,7 +427,7 @@ static const struct obex_mime_type_driver irmc_driver = { .read = irmc_read, }; -static struct obex_service_driver irmc = { +static const struct obex_service_driver irmc = { .name ="IRMC Sync server" , .service =OBEX_IRMC , .target =IRMC_TARGET ,
obexd/plugins/mas.c +1 -1
@@ -781,7 +781,7 @@ static void *notification_registration_open(const char *name, int oflag,return mas; } -static struct obex_service_driver mas = { +static const struct obex_service_driver mas = { .name ="Message Access server" , .service =OBEX_MAS , .target =MAS_TARGET ,
obexd/plugins/opp.c +1 -1
@@ -155,7 +155,7 @@ static void opp_reset(struct obex_session *os, void *user_data)manager_emit_transfer_completed (user_data); } -static struct obex_service_driver driver = { +static const struct obex_service_driver driver = { .name ="Object Push server" , .service =OBEX_OPP , .connect = opp_connect,
obexd/plugins/pbap.c +1 -1
@@ -634,7 +634,7 @@ static int pbap_chkput(struct obex_session *os, void *user_data)return -EBADR ; } -static struct obex_service_driver pbap = { +static const struct obex_service_driver pbap = { .name ="Phonebook Access server" , .service =OBEX_PBAP , .target =PBAP_TARGET ,
obexd/plugins/pcsuite.c +1 -1
@@ -231,7 +231,7 @@ static void pcsuite_disconnect(struct obex_session *os, void *user_data)g_free (pcsuite); } -static struct obex_service_driver pcsuite = { +static const struct obex_service_driver pcsuite = { .name ="Nokia OBEX PC Suite Services" , .service =OBEX_PCSUITE , .channel =PCSUITE_CHANNEL ,
obexd/plugins/syncevolution.c +1 -1
@@ -436,7 +436,7 @@ static const struct obex_mime_type_driver synce_driver = { .write = synce_write, }; -static struct obex_service_driver synce = { +static const struct obex_service_driver synce = { .name ="OBEX server for SyncML, using SyncEvolution" , .service =OBEX_SYNCEVOLUTION , .channel =SYNCEVOLUTION_CHANNEL ,
obexd/src/obex-priv.h +1 -1
@@ -33,7 +33,7 @@ struct obex_session {void *object;gboolean aborted;int err; -struct obex_service_driver *service; +const struct obex_service_driver *service;void *service_data;struct obex_server *server;gboolean checked;
obexd/src/server.c +1 -1
@@ -82,7 +82,7 @@ int obex_server_init(void) }for (l = drivers; l; l = l->next) { -struct obex_service_driver *driver = l->data; +const struct obex_service_driver *driver = l->data;init_server (driver->service, transports); }
obexd/src/service.c +10 -10
@@ -26,14 +26,14 @@ static GSList *drivers = NULL; -struct obex_service_driver *obex_service_driver_find(GSList *drivers, +const struct obex_service_driver *obex_service_driver_find(GSList *drivers, const uint8_t *target, unsigned int target_size, const uint8_t *who, unsigned int who_size) { GSList *l; for (l = drivers; l; l = l->next) { - struct obex_service_driver *driver = l->data; + const struct obex_service_driver *driver = l->data; /* who is optional, so only check for it if not NULL */ if (who != NULL && memncmp0(who, who_size, driver->who,
@@ -57,10 +57,10 @@ GSList *obex_service_driver_list(uint16_t services)return drivers;for (l = drivers; l && services; l = l->next) { -struct obex_service_driver *driver = l->data; +const struct obex_service_driver *driver = l->data;if (driver->service & services) { - list =g_slist_append (list, driver); + list =g_slist_append (list, (gpointer )driver); services &= ~driver->service; } }
@@ -68,12 +68,12 @@ GSList *obex_service_driver_list(uint16_t services)return list; } -static struct obex_service_driver *find_driver (uint16_t service) +static const struct obex_service_driver *find_driver (uint16_t service) {GSList *l;for (l = drivers; l; l = l->next) { -struct obex_service_driver *driver = l->data; +const struct obex_service_driver *driver = l->data;if (driver->service == service)return driver;
@@ -82,7 +82,7 @@ static struct obex_service_driver *find_driver(uint16_t service)return NULL ; } -int obex_service_driver_register (struct obex_service_driver *driver) +int obex_service_driver_register (const struct obex_service_driver *driver) {if (!driver) {error ("Invalid driver" );
@@ -99,14 +99,14 @@ int obex_service_driver_register(struct obex_service_driver *driver)/* Drivers that support who has priority */ if (driver->who) - drivers =g_slist_prepend (drivers, driver); + drivers =g_slist_prepend (drivers, (gpointer )driver);else - drivers =g_slist_append (drivers, driver); + drivers =g_slist_append (drivers, (gpointer )driver);return 0 ; } -void obex_service_driver_unregister (struct obex_service_driver *driver) +void obex_service_driver_unregister (const struct obex_service_driver *driver) {if (!g_slist_find (drivers, driver)) {error ("Unable to unregister: No such driver %p" , driver);
obexd/src/service.h +3 -3
@@ -32,9 +32,9 @@ struct obex_service_driver {void (*reset) (struct obex_session *os,void *user_data); }; -int obex_service_driver_register (struct obex_service_driver *driver); -void obex_service_driver_unregister (struct obex_service_driver *driver); +int obex_service_driver_register (const struct obex_service_driver *driver); +void obex_service_driver_unregister (const struct obex_service_driver *driver);GSList *obex_service_driver_list (uint16_t services); -struct obex_service_driver *obex_service_driver_find (GSList *drivers, +const struct obex_service_driver *obex_service_driver_find (GSList *drivers,const uint8_t *target,unsigned int target_size,const uint8_t *who,unsigned int who_size);
Signature · 1 line
2.43.0
PATCH 18/20 obexd: const obex_transport_driver instances and API
In reply to Emil VelikovFrom: Emil Velikov <[email protected]>
--- obexd/plugins/bluetooth.c | 2 +- obexd/src/obex.c | 4 ++-- obexd/src/server.c | 8 ++++---- obexd/src/server.h | 2 +- obexd/src/transport.c | 14 +++++++------- obexd/src/transport.h | 6 +++--- 6 files changed, 18 insertions(+), 18 deletions(-)
obexd/plugins/bluetooth.c +1 -1
@@ -416,7 +416,7 @@ static int bluetooth_getsockname(GIOChannel *io, char **name)return 0 ; } -static struct obex_transport_driver driver = { +static const struct obex_transport_driver driver = { .name ="bluetooth" , .start = bluetooth_start, .getpeername = bluetooth_getpeername,
obexd/src/obex.c +2 -2
@@ -1085,7 +1085,7 @@ ssize_t obex_get_non_header_data(struct obex_session *os,int obex_getpeername (struct obex_session *os,char **name) { -struct obex_transport_driver *transport = os->server->transport; +const struct obex_transport_driver *transport = os->server->transport;if (transport ==NULL || transport->getpeername ==NULL )return -ENOTSUP ;
@@ -1095,7 +1095,7 @@ int obex_getpeername(struct obex_session *os, char **name)int obex_getsockname (struct obex_session *os,char **name) { -struct obex_transport_driver *transport = os->server->transport; +const struct obex_transport_driver *transport = os->server->transport;if (transport ==NULL || transport->getsockname ==NULL )return -ENOTSUP ;
obexd/src/server.c +4 -4
@@ -34,12 +34,12 @@static GSList *servers =NULL ; -static void init_server (uint16_t service,GSList *transports) +static void init_server (uint16_t service,const GSList *transports) { -GSList *l; +const GSList *l;for (l = transports; l; l = l->next) { -struct obex_transport_driver *transport = l->data; +const struct obex_transport_driver *transport = l->data;struct obex_server *server;int err;
@@ -66,7 +66,7 @@ static void init_server(uint16_t service, GSList *transports)int obex_server_init (void ) {GSList *drivers; -GSList *transports; +const GSList *transports;GSList *l; drivers =obex_service_driver_list (0 );
obexd/src/server.h +1 -1
@@ -10,7 +10,7 @@*/ struct obex_server { -struct obex_transport_driver *transport; +const struct obex_transport_driver *transport;void *transport_data;GSList *drivers; };
obexd/src/transport.c +7 -7
@@ -27,13 +27,13 @@static GSList *drivers =NULL ; -static struct obex_transport_driver *obex_transport_driver_find ( +static const struct obex_transport_driver *obex_transport_driver_find (const char *name) { -GSList *l; +const GSList *l;for (l = drivers; l; l = l->next) { -struct obex_transport_driver *driver = l->data; +const struct obex_transport_driver *driver = l->data;if (g_strcmp0 (name, driver->name) ==0 )return driver;
@@ -42,12 +42,12 @@ static struct obex_transport_driver *obex_transport_driver_find(return NULL ; } -GSList *obex_transport_driver_list (void ) +const GSList *obex_transport_driver_list (void ) {return drivers; } -int obex_transport_driver_register (struct obex_transport_driver *driver) +int obex_transport_driver_register (const struct obex_transport_driver *driver) {if (!driver) {error ("Invalid driver" );
@@ -62,12 +62,12 @@ int obex_transport_driver_register(struct obex_transport_driver *driver)DBG ("driver %p transport %s registered" , driver, driver->name); - drivers =g_slist_prepend (drivers, driver); + drivers =g_slist_prepend (drivers, (gpointer )driver);return 0 ; } -void obex_transport_driver_unregister (struct obex_transport_driver *driver) +void obex_transport_driver_unregister (const struct obex_transport_driver *driver) {if (!g_slist_find (drivers, driver)) {error ("Unable to unregister: No such driver %p" , driver);
obexd/src/transport.h +3 -3
@@ -17,6 +17,6 @@ struct obex_transport_driver {void (*stop) (void *data); }; -int obex_transport_driver_register (struct obex_transport_driver *driver); -void obex_transport_driver_unregister (struct obex_transport_driver *driver); -GSList *obex_transport_driver_list (void ); +int obex_transport_driver_register (const struct obex_transport_driver *driver); +void obex_transport_driver_unregister (const struct obex_transport_driver *driver); +const GSList *obex_transport_driver_list (void );
Signature · 1 line
2.43.0
PATCH 19/20 obexd: const annotate misc immutable data
In reply to Emil VelikovFrom: Emil Velikov <[email protected]>
--- obexd/client/manager.c | 6 +++--- obexd/client/map.c | 4 ++-- obexd/client/mns.c | 4 ++-- obexd/plugins/phonebook-ebook.c | 2 +- obexd/src/main.c | 2 +- obexd/src/obex.c | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-)
obexd/client/manager.c +3 -3
@@ -241,7 +241,7 @@ static const GDBusMethodTable client_methods[] = {static DBusConnection *conn =NULL ; -static struct obc_module { +static const struct obc_module { const char *name; int (*init) (void); void (*exit) (void);
@@ -258,7 +258,7 @@ static struct obc_module {int client_manager_init (void ) {DBusError derr; -struct obc_module *module; +const struct obc_module *module;dbus_error_init (&derr);
@@ -289,7 +289,7 @@ int client_manager_init(void)void client_manager_exit (void ) { -struct obc_module *module; +const struct obc_module *module;if (conn ==NULL )return ;
obexd/client/map.c +2 -2
@@ -1060,7 +1060,7 @@ static void parse_protected(struct map_msg *msg, const char *value) MAP_MSG_INTERFACE, "Protected"); } -static struct map_msg_parser { +static const struct map_msg_parser {const char *name;void (*func) (struct map_msg *msg,const char *value); } msg_parsers[] = {
@@ -1120,7 +1120,7 @@ static void msg_element(GMarkupParseContext *ctxt, const char *element, &msg->path);for (i =0 , key = names[i]; key; key = names[++i]) { -struct map_msg_parser *parser; +const struct map_msg_parser *parser;for (parser = msg_parsers; parser && parser->name; parser++) {if (strcasecmp (key, parser->name) ==0 ) {
obexd/client/mns.c +2 -2
@@ -233,7 +233,7 @@ static void parse_event_report_priority(struct map_event *event, event->priority =g_strdup (value); } -static struct map_event_report_parser { +static const struct map_event_report_parser {const char *name;void (*func) (struct map_event *event,const char *value); } event_report_parsers[] = {
@@ -262,7 +262,7 @@ static void event_report_element(GMarkupParseContext *ctxt,return ;for (i =0 , key = names[i]; key; key = names[++i]) { -struct map_event_report_parser *parser; +const struct map_event_report_parser *parser;for (parser = event_report_parsers; parser && parser->name; parser++) {
obexd/plugins/phonebook-ebook.c +1 -1
@@ -55,7 +55,7 @@ struct query_context {gboolean canceled; }; -static char *attribute_mask[] = { +static const char *attribute_mask[] = {/* 0 */ "VERSION" ,"FN" ,"N" ,
obexd/src/main.c +1 -1
@@ -138,7 +138,7 @@ static gboolean parse_debug(const char *key, const char *value,return TRUE; } -static GOptionEntry options[] = { +static const GOptionEntry options[] = { {"debug" ,'d' ,G_OPTION_FLAG_OPTIONAL_ARG ,G_OPTION_ARG_CALLBACK , parse_debug,"Enable debug information output" ,"DEBUG" },
obexd/src/obex.c +1 -1
@@ -55,7 +55,7 @@ struct auth_header { } __attribute__ ((packed));/* Possible commands */ -static struct { +static const struct {int cmd;const char *name; } obex_command[] = {
Signature · 1 line
2.43.0
PATCH 20/20 obexd: const annotate obex_plugin_desc entrypoint
In reply to Emil VelikovFrom: Emil Velikov <[email protected]>
--- obexd/src/genbuiltin | 4 ++-- obexd/src/plugin.c | 8 ++++---- obexd/src/plugin.h | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-)
obexd/src/genbuiltin +2 -2
@@ -2,11 +2,11 @@ for i in $* do - echo "extern struct obex_plugin_desc __obex_builtin_$i;" + echo "extern const struct obex_plugin_desc __obex_builtin_$i;" done echo -echo "static struct obex_plugin_desc *__obex_builtin[] = {" +echo "static const struct obex_plugin_desc *__obex_builtin[] = {" for i in $* do
obexd/src/plugin.c +4 -4
@@ -38,10 +38,10 @@ static GSList *plugins = NULL;struct obex_plugin {void *handle; -struct obex_plugin_desc *desc; +const struct obex_plugin_desc *desc; }; -static gboolean add_plugin (void *handle,struct obex_plugin_desc *desc) +static gboolean add_plugin (void *handle,const struct obex_plugin_desc *desc) {struct obex_plugin *plugin;
@@ -66,7 +66,7 @@ static gboolean add_plugin(void *handle, struct obex_plugin_desc *desc)return TRUE; } -static gboolean check_plugin (struct obex_plugin_desc *desc, +static gboolean check_plugin (const struct obex_plugin_desc *desc,char **patterns,char **excludes) {if (excludes) {
@@ -132,7 +132,7 @@ gboolean plugin_init(const char *pattern, const char *exclude) }while ((file =g_dir_read_name (dir)) !=NULL ) { -struct obex_plugin_desc *desc; +const struct obex_plugin_desc *desc;void *handle;char *filename;
obexd/src/plugin.h +2 -2
@@ -16,14 +16,14 @@ struct obex_plugin_desc {#ifdef OBEX_PLUGIN_BUILTIN #define OBEX_PLUGIN_DEFINE (name, init, exit) \ - struct obex_plugin_desc __obex_builtin_ ## name = { \ + const struct obex_plugin_desc __obex_builtin_ ## name = { \ #name, init, exit \ };#else #define OBEX_PLUGIN_DEFINE (name,init,exit) \ extern struct obex_plugin_desc obex_plugin_desc \ __attribute__ ((visibility("default"))); \ - struct obex_plugin_desc obex_plugin_desc = { \ + const struct obex_plugin_desc obex_plugin_desc = { \ #name, init, exit \ };#endif
Signature · 1 line
2.43.0
This series was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:
Hello:
This series was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:
Quoted 10 lines · On Tue, 16 Jan 2024 14:00:25 +0000 you wrote:
Hello list,
Here is series#2 of the paper cut fixes. Here we annotate a handful of the data as constant alongside updating all the respective APIs.
There's nothing particularly existing or controversial here, despite the size of the series. That said, I'm not 100% sure that all code-paths have been (runtime) tested.
[...]
Here is the summary with links:
- [BlueZ,01/20] src: const annotate the bluetooth plugin API (no matching commit)
- [BlueZ,02/20] monitor: const annotate util_ltv_debugger instances and API (no matching commit)
- [BlueZ,03/20] monitor: const annotate cmd/handler tables
(no matching commit)
- [BlueZ,04/20] monitor: const annotate misc arrays
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=4630f3fba0fc - [BlueZ,05/20] monitor: const annotate intel_version_tlv_desc::type_str and API https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=5380e63a80f2 - [BlueZ,06/20] monitor: const annotate type_table and related API https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=f8e0270a7a73 - [BlueZ,07/20] profiles: annotate immutable data as const (no matching commit) - [BlueZ,08/20] attrib: annotate immutable data as const https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=a8543fd2b062 - [BlueZ,09/20] client: annotate struct option instances as const https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=20864af937f3 - [BlueZ,10/20] emulator: const annotate rfcomm_crc_table[] https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=4d88fd2fabd6 - [BlueZ,11/20] gobex: const annotate RO arrays, use G_N_ELEMENTS (no matching commit) - [BlueZ,12/20] lib: const annotate hci_map instances and related API https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=af552cd906a0 - [BlueZ,13/20] lib: const annotate tupla instances and API (no matching commit) - [BlueZ,14/20] mesh: const annotate misc data https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=a9393b2e9eec - [BlueZ,15/20] obexd: remove obex_mime_type_driver::set_io_watch https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=8e88f8cecaa8 - [BlueZ,16/20] obexd: const obex_mime_type_driver instances and API (no matching commit) - [BlueZ,17/20] obexd: const obex_service_driver instances and API https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=ae8f9c956069 - [BlueZ,18/20] obexd: const obex_transport_driver instances and API (no matching commit) - [BlueZ,19/20] obexd: const annotate misc immutable data https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=ac1d2369b29a - [BlueZ,20/20] obexd: const annotate obex_plugin_desc entrypoint https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=e0c64a2031e2
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html