Message ID | 20220827000540.113414-2-luiz.dentz@gmail.com |
---|---|
State | Superseded |
Headers | show |
Series | Initial BAP support | expand |
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=671664 ---Test result--- Test Summary: CheckPatch FAIL 25.43 seconds GitLint PASS 11.57 seconds Prep - Setup ELL PASS 32.49 seconds Build - Prep PASS 0.91 seconds Build - Configure PASS 10.61 seconds Build - Make PASS 980.59 seconds Make Check PASS 12.43 seconds Make Check w/Valgrind PASS 345.00 seconds Make Distcheck PASS 293.60 seconds Build w/ext ELL - Configure PASS 10.78 seconds Build w/ext ELL - Make PASS 100.36 seconds Incremental Build w/ patches PASS 1302.00 seconds Scan Build WARNING 1109.66 seconds Details ############################## Test: CheckPatch - FAIL Desc: Run checkpatch.pl script with rule in .checkpatch.conf Output: [v3,03/11] shared/bap: Add initial code for handling BAP ERROR:FSF_MAILING_ADDRESS: Do not include the paragraph about writing to the Free Software Foundation's mailing address from the sample GPL notice. The FSF has changed addresses in the past, and may do so again. Linux already includes a copy of the GPL. #369: FILE: src/shared/bap.c:19: + * License along with this library; if not, write to the Free Software$ ERROR:FSF_MAILING_ADDRESS: Do not include the paragraph about writing to the Free Software Foundation's mailing address from the sample GPL notice. The FSF has changed addresses in the past, and may do so again. Linux already includes a copy of the GPL. #370: FILE: src/shared/bap.c:20: + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA$ WARNING:PREFER_FALLTHROUGH: Prefer 'fallthrough;' over fallthrough comment #1742: FILE: src/shared/bap.c:1392: + /* Fallthrough */ WARNING:PREFER_FALLTHROUGH: Prefer 'fallthrough;' over fallthrough comment #1748: FILE: src/shared/bap.c:1398: + /* Fallthrough */ WARNING:PREFER_FALLTHROUGH: Prefer 'fallthrough;' over fallthrough comment #1761: FILE: src/shared/bap.c:1411: + /* Fallthrough */ WARNING:PREFER_FALLTHROUGH: Prefer 'fallthrough;' over fallthrough comment #1767: FILE: src/shared/bap.c:1417: + /* Fallthrough */ ERROR:SPACING: space required before the open parenthesis '(' #4468: FILE: src/shared/bap.c:4118: + switch(lpac->type) { WARNING:PREFER_DEFINED_ATTRIBUTE_MACRO: Prefer __packed over __attribute__((packed)) #5148: FILE: src/shared/bap.h:16: +#define __packed __attribute__((packed)) WARNING:SPACING: Unnecessary space before function pointer arguments #5255: FILE: src/shared/bap.h:123: + int (*select) (struct bt_bap_pac *pac, struct bt_bap_pac_qos *qos, WARNING:SPACING: Unnecessary space before function pointer arguments #5258: FILE: src/shared/bap.h:126: + int (*config) (struct bt_bap_stream *stream, struct iovec *cfg, WARNING:SPACING: Unnecessary space before function pointer arguments #5261: FILE: src/shared/bap.h:129: + void (*clear) (struct bt_bap_stream *stream, void *user_data); /github/workspace/src/12956744.patch total: 3 errors, 8 warnings, 5278 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/12956744.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. [v3,04/11] profiles: Add initial code for bap plugin ERROR:SPACING: space prohibited before that close parenthesis ')' #618: FILE: profiles/audio/bap.c:490: + { "properties", "a{sv}" } ), ERROR:INITIALISED_STATIC: do not initialise statics to 0 #1428: FILE: profiles/audio/bap.c:1300: +static unsigned int bap_id = 0; WARNING:SPACING: Unnecessary space before function pointer arguments #2354: FILE: profiles/audio/transport.c:116: + void (*set_state) (struct media_transport *transport, /github/workspace/src/12956741.patch total: 2 errors, 1 warnings, 2836 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/12956741.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. [v3,08/11] client/player: Add support for PACS endpoints ERROR:SPACING: space prohibited before that close parenthesis ')' #631: FILE: client/player.c:1886: + GDBUS_ARGS({ "cfg", "ay" } ), ERROR:SPACING: space prohibited before that close parenthesis ')' #634: FILE: client/player.c:1889: + GDBUS_ARGS({ "properties", "a{sv}" } ), ERROR:SPACING: space prohibited before that close parenthesis ')' #635: FILE: client/player.c:1890: + GDBUS_ARGS({ "properties", "a{sv}" } ), /github/workspace/src/12956742.patch total: 3 errors, 0 warnings, 799 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/12956742.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: Scan Build - WARNING Desc: Run Scan Build with patches Output: ***************************************************************************** The bugs reported by the scan-build may or may not be caused by your patches. Please check the list and fix the bugs if they are caused by your patch. ***************************************************************************** client/player.c:1757:25: warning: Dereference of null pointer iov_append(&cfg->caps, preset->data.iov_base, preset->data.iov_len); ^~~~~~~~~~~~~~~~~~~~~ 1 warning generated. profiles/audio/media.c:1450:6: warning: 8th function call argument is an uninitialized value if (media_endpoint_create(adapter, sender, path, uuid, delay_reporting, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ profiles/audio/media.c:2996:3: warning: Use of memory after it is freed release_endpoint(adapter->endpoints->data); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ profiles/audio/media.c:2999:3: warning: Use of memory after it is freed media_player_destroy(adapter->players->data); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 warnings generated. --- Regards, Linux Bluetooth
diff --git a/src/adapter.c b/src/adapter.c index b453e86a03c1..51b099daefdf 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -1383,6 +1383,39 @@ struct btd_device *btd_adapter_get_device(struct btd_adapter *adapter, return adapter_create_device(adapter, addr, addr_type); } +struct btd_device *btd_adapter_find_device_by_fd(int fd) +{ + bdaddr_t src, dst; + uint8_t dst_type; + GIOChannel *io = NULL; + GError *gerr = NULL; + struct btd_adapter *adapter; + + io = g_io_channel_unix_new(fd); + if (!io) + return NULL; + + bt_io_get(io, &gerr, + BT_IO_OPT_SOURCE_BDADDR, &src, + BT_IO_OPT_DEST_BDADDR, &dst, + BT_IO_OPT_DEST_TYPE, &dst_type, + BT_IO_OPT_INVALID); + if (gerr) { + error("bt_io_get: %s", gerr->message); + g_error_free(gerr); + g_io_channel_unref(io); + return NULL; + } + + g_io_channel_unref(io); + + adapter = adapter_find(&src); + if (!adapter) + return NULL; + + return btd_adapter_find_device(adapter, &dst, dst_type); +} + sdp_list_t *btd_adapter_get_services(struct btd_adapter *adapter) { return adapter->services; diff --git a/src/adapter.h b/src/adapter.h index b09044edda70..f38f473b79d7 100644 --- a/src/adapter.h +++ b/src/adapter.h @@ -86,6 +86,7 @@ struct btd_device *btd_adapter_find_device(struct btd_adapter *adapter, uint8_t dst_type); struct btd_device *btd_adapter_find_device_by_path(struct btd_adapter *adapter, const char *path); +struct btd_device *btd_adapter_find_device_by_fd(int fd); void btd_adapter_update_found_device(struct btd_adapter *adapter, const bdaddr_t *bdaddr,
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> This adds btd_adapter_find_device_by_fd that lookup a device by a fd socket destination address. --- src/adapter.c | 33 +++++++++++++++++++++++++++++++++ src/adapter.h | 1 + 2 files changed, 34 insertions(+)