diff mbox series

[BlueZ,3/6] tools/mesh-gatt: Fix unwanted return in onoff client model

Message ID 20211207225604.35156-4-daniele.biagetti@cblelectronics.com (mailing list archive)
State Changes Requested
Headers show
Series tools/mesh-gatt meshctl tool improvements | expand

Checks

Context Check Description
tedd_an/checkpatch fail [BlueZ,3/6] tools/mesh-gatt: Fix unwanted return in onoff client model ERROR:SPACING: space required before the open brace '{' #99: FILE: tools/mesh-gatt/onoff-model.c:212: + if (!node){ WARNING:BRACES: braces {} are not necessary for single statement blocks #99: FILE: tools/mesh-gatt/onoff-model.c:212: + if (!node){ + bt_shell_printf("Warning: node %4.4x not found in database\n",target); + } WARNING:LONG_LINE: line length of 86 exceeds 80 columns #100: FILE: tools/mesh-gatt/onoff-model.c:213: + bt_shell_printf("Warning: node %4.4x not found in database\n",target); ERROR:SPACING: space required after that ',' (ctx:VxV) #100: FILE: tools/mesh-gatt/onoff-model.c:213: + bt_shell_printf("Warning: node %4.4x not found in database\n",target); ^ ERROR:SPACING: space required before the open brace '{' #111: FILE: tools/mesh-gatt/onoff-model.c:241: + if (!node){ WARNING:BRACES: braces {} are not necessary for single statement blocks #111: FILE: tools/mesh-gatt/onoff-model.c:241: + if (!node){ + bt_shell_printf("Warning: node %4.4x not found in database\n",target); + } WARNING:LONG_LINE: line length of 86 exceeds 80 columns #112: FILE: tools/mesh-gatt/onoff-model.c:242: + bt_shell_printf("Warning: node %4.4x not found in database\n",target); ERROR:SPACING: space required after that ',' (ctx:VxV) #112: FILE: tools/mesh-gatt/onoff-model.c:242: + bt_shell_printf("Warning: node %4.4x not found in database\n",target); ^ /github/workspace/src/12662887.patch total: 4 errors, 4 warnings, 22 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/12662887.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.
tedd_an/gitlint success Gitlint PASS

Commit Message

Daniele Biagetti Dec. 7, 2021, 10:56 p.m. UTC
Replaced the return statement with a warning message in case of
transmission or reception of messages coming from unknown addresses
(such as group addresses)
---
 tools/mesh-gatt/onoff-model.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/tools/mesh-gatt/onoff-model.c b/tools/mesh-gatt/onoff-model.c
index 1c9676e03..9a4ef6d97 100644
--- a/tools/mesh-gatt/onoff-model.c
+++ b/tools/mesh-gatt/onoff-model.c
@@ -209,8 +209,9 @@  static void cmd_get_status(int argc, char *argv[])
 
 	node = node_find_by_addr(target);
 
-	if (!node)
-		return;
+	if (!node){
+		bt_shell_printf("Warning: node %4.4x not found in database\n",target);
+	}
 
 	n = mesh_opcode_set(OP_GENERIC_ONOFF_GET, msg);
 
@@ -237,8 +238,9 @@  static void cmd_set(int argc, char *argv[])
 
 	node = node_find_by_addr(target);
 
-	if (!node)
-		return;
+	if (!node){
+		bt_shell_printf("Warning: node %4.4x not found in database\n",target);
+	}
 
 	np = read_input_parameters(argc, argv);
 	if ((np != 1) && (np != 2) &&