All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ 1/2] client/player: Fix checkpatch warning
@ 2022-08-30 21:42 Luiz Augusto von Dentz
  2022-08-30 21:42 ` [PATCH BlueZ 2/2] shared/shell: Fix scan-build error Luiz Augusto von Dentz
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2022-08-30 21:42 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This fixes the following checkpatch warning:

WARNING:LINE_SPACING: Missing a blank line after declarations
216: FILE: client/player.c:625:
+               GDBusProxy *proxy = l->data;
+               print_player(proxy, NULL);
---
 client/player.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/client/player.c b/client/player.c
index 3d2f41cb3666..0daacabf3c27 100644
--- a/client/player.c
+++ b/client/player.c
@@ -604,8 +604,10 @@ static void print_media(GDBusProxy *proxy, const char *description)
 	g_free(str);
 }
 
-static void print_player(GDBusProxy *proxy, const char *description)
+static void print_player(void *data, void *user_data)
 {
+	GDBusProxy *proxy = data;
+	const char *description = user_data;
 	char *str;
 
 	str = proxy_description(proxy, "Player", description);
@@ -618,12 +620,7 @@ static void print_player(GDBusProxy *proxy, const char *description)
 
 static void cmd_list(int argc, char *arg[])
 {
-	GList *l;
-
-	for (l = players; l; l = g_list_next(l)) {
-		GDBusProxy *proxy = l->data;
-		print_player(proxy, NULL);
-	}
+	g_list_foreach(players, print_player, NULL);
 
 	return bt_shell_noninteractive_quit(EXIT_SUCCESS);
 }
-- 
2.37.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH BlueZ 2/2] shared/shell: Fix scan-build error
  2022-08-30 21:42 [PATCH BlueZ 1/2] client/player: Fix checkpatch warning Luiz Augusto von Dentz
@ 2022-08-30 21:42 ` Luiz Augusto von Dentz
  2022-08-30 23:14 ` [BlueZ,1/2] client/player: Fix checkpatch warning bluez.test.bot
  2022-08-31 23:10 ` [PATCH BlueZ 1/2] " patchwork-bot+bluetooth
  2 siblings, 0 replies; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2022-08-30 21:42 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This fixes the following error:

src/shared/shell.c:1135:19: warning: Null pointer passed to 1st
parameter expecting 'nonnull'
                        data.timeout = atoi(optarg);
                                       ^~~~~~~~~~~~
---
 src/shared/shell.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/shared/shell.c b/src/shared/shell.c
index 4658819a4bde..46ba8112cfb0 100644
--- a/src/shared/shell.c
+++ b/src/shared/shell.c
@@ -1101,6 +1101,7 @@ void bt_shell_init(int argc, char **argv, const struct bt_shell_opt *opt)
 	struct option options[256];
 	char optstr[256];
 	size_t offset;
+	char *endptr = NULL;
 
 	offset = sizeof(main_options) / sizeof(struct option);
 
@@ -1132,7 +1133,9 @@ void bt_shell_init(int argc, char **argv, const struct bt_shell_opt *opt)
 			data.mode = 1;
 			goto done;
 		case 't':
-			data.timeout = atoi(optarg);
+			data.timeout = strtol(optarg, &endptr, 0);
+			if (!endptr || *endptr != '\0')
+				printf("Unable to parse timeout\n");
 			break;
 		case 'z':
 			data.zsh = 1;
-- 
2.37.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* RE: [BlueZ,1/2] client/player: Fix checkpatch warning
  2022-08-30 21:42 [PATCH BlueZ 1/2] client/player: Fix checkpatch warning Luiz Augusto von Dentz
  2022-08-30 21:42 ` [PATCH BlueZ 2/2] shared/shell: Fix scan-build error Luiz Augusto von Dentz
@ 2022-08-30 23:14 ` bluez.test.bot
  2022-08-31 23:10 ` [PATCH BlueZ 1/2] " patchwork-bot+bluetooth
  2 siblings, 0 replies; 4+ messages in thread
From: bluez.test.bot @ 2022-08-30 23:14 UTC (permalink / raw)
  To: linux-bluetooth, luiz.dentz

[-- Attachment #1: Type: text/plain, Size: 3120 bytes --]

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=672614

---Test result---

Test Summary:
CheckPatch                    FAIL      1.39 seconds
GitLint                       PASS      0.96 seconds
Prep - Setup ELL              PASS      32.15 seconds
Build - Prep                  PASS      0.65 seconds
Build - Configure             PASS      10.33 seconds
Build - Make                  PASS      980.25 seconds
Make Check                    PASS      12.90 seconds
Make Check w/Valgrind         PASS      347.96 seconds
Make Distcheck                PASS      300.51 seconds
Build w/ext ELL - Configure   PASS      10.48 seconds
Build w/ext ELL - Make        PASS      101.00 seconds
Incremental Build w/ patches  PASS      242.98 seconds
Scan Build                    WARNING   684.12 seconds

Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script with rule in .checkpatch.conf
Output:
[BlueZ,1/2] client/player: Fix checkpatch warning
WARNING:EMAIL_SUBJECT: A patch subject line should describe the change not the tool that found it
#69: 
Subject: [PATCH BlueZ 1/2] client/player: Fix checkpatch warning

/github/workspace/src/12959894.patch total: 0 errors, 1 warnings, 24 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/12959894.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:1755:25: warning: Dereference of null pointer
        iov_append(&cfg->caps, preset->data.iov_base, preset->data.iov_len);
                               ^~~~~~~~~~~~~~~~~~~~~
1 warning generated.
src/shared/shell.c:1136:19: warning: Null pointer passed to 1st parameter expecting 'nonnull'
                        data.timeout = strtol(optarg, &endptr, 0);
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~
src/shared/shell.c:1158:13: warning: Access to field 'options' results in a dereference of a null pointer (loaded from variable 'opt')
                        if (c != opt->options[index - offset].val) {
                                 ^~~~~~~~~~~~
2 warnings generated.




---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH BlueZ 1/2] client/player: Fix checkpatch warning
  2022-08-30 21:42 [PATCH BlueZ 1/2] client/player: Fix checkpatch warning Luiz Augusto von Dentz
  2022-08-30 21:42 ` [PATCH BlueZ 2/2] shared/shell: Fix scan-build error Luiz Augusto von Dentz
  2022-08-30 23:14 ` [BlueZ,1/2] client/player: Fix checkpatch warning bluez.test.bot
@ 2022-08-31 23:10 ` patchwork-bot+bluetooth
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+bluetooth @ 2022-08-31 23:10 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth

Hello:

This series was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Tue, 30 Aug 2022 14:42:14 -0700 you wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> This fixes the following checkpatch warning:
> 
> WARNING:LINE_SPACING: Missing a blank line after declarations
> 216: FILE: client/player.c:625:
> +               GDBusProxy *proxy = l->data;
> +               print_player(proxy, NULL);
> 
> [...]

Here is the summary with links:
  - [BlueZ,1/2] client/player: Fix checkpatch warning
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=d8febc76a43f
  - [BlueZ,2/2] shared/shell: Fix scan-build error
    (no matching commit)

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-08-31 23:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-30 21:42 [PATCH BlueZ 1/2] client/player: Fix checkpatch warning Luiz Augusto von Dentz
2022-08-30 21:42 ` [PATCH BlueZ 2/2] shared/shell: Fix scan-build error Luiz Augusto von Dentz
2022-08-30 23:14 ` [BlueZ,1/2] client/player: Fix checkpatch warning bluez.test.bot
2022-08-31 23:10 ` [PATCH BlueZ 1/2] " patchwork-bot+bluetooth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.