2023-07-31 08:21:58

by Zijun Hu

[permalink] [raw]
Subject: [PATCH v1] main: Fix a logical error within parse_config_int()

Fix a logical error within parse_config_int().
---
src/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main.c b/src/main.c
index 150a5af4cca4..13501440b052 100644
--- a/src/main.c
+++ b/src/main.c
@@ -458,7 +458,7 @@ static bool parse_config_int(GKeyFile *config, const char *group,
return false;
}

- if (tmp < max) {
+ if (tmp > max) {
warn("%s.%s = %d is out of range (> %d)", group, key, tmp, max);
return false;
}
--
2.7.4



2023-07-31 09:12:18

by Paul Menzel

[permalink] [raw]
Subject: Re: [PATCH v1] main: Fix a logical error within parse_config_int()

Dear Zijun,


Am 31.07.23 um 09:46 schrieb Zijun Hu:
> Fix a logical error within parse_config_int().

Thank you for spotting and fixing this. I guess this warning was printed
on the terminal?

Although obvious, instead of duplicating the commit message summary in
the body, it would be great, if you still wrote a more elaborate commit
message. Maybe:

Having a config file with the line below



causes the config file to be ignored, and the warning below:



> ---
> src/main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/main.c b/src/main.c
> index 150a5af4cca4..13501440b052 100644
> --- a/src/main.c
> +++ b/src/main.c
> @@ -458,7 +458,7 @@ static bool parse_config_int(GKeyFile *config, const char *group,
> return false;
> }
>
> - if (tmp < max) {
> + if (tmp > max) {
> warn("%s.%s = %d is out of range (> %d)", group, key, tmp, max);
> return false;
> }

Reviewed-by: Paul Menzel <[email protected]>


Kind regards,

Paul

2023-07-31 09:18:27

by Zijun Hu

[permalink] [raw]
Subject: Re: [PATCH v1] main: Fix a logical error within parse_config_int()

On 7/31/2023 4:48 PM, Paul Menzel wrote:
> Dear Zijun,
>
>
> Am 31.07.23 um 09:46 schrieb Zijun Hu:
>> Fix a logical error within parse_config_int().
>
> Thank you for spotting and fixing this. I guess this warning was printed on the terminal?
no any warnings by following Compilation steps of README.
>
> Although obvious, instead of duplicating the commit message summary in the body, it would be great, if you still wrote a more elaborate commit message. Maybe:
>
> Having a config file with the line below
>
>     …
>
> causes the config file to be ignored, and the warning below:
>
>     …
>
the error is very simple, so i don't write more to explain it.
>> ---
>>   src/main.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/main.c b/src/main.c
>> index 150a5af4cca4..13501440b052 100644
>> --- a/src/main.c
>> +++ b/src/main.c
>> @@ -458,7 +458,7 @@ static bool parse_config_int(GKeyFile *config, const char *group,
>>           return false;
>>       }
>>   -    if (tmp < max) {
>> +    if (tmp > max) {
>>           warn("%s.%s = %d is out of range (> %d)", group, key, tmp, max);
>>           return false;
>>       }
>
> Reviewed-by: Paul Menzel <[email protected]>
>
>
> Kind regards,
>
> Paul


2023-07-31 09:34:13

by bluez.test.bot

[permalink] [raw]
Subject: RE: [v1] main: Fix a logical error within parse_config_int()

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

---Test result---

Test Summary:
CheckPatch PASS 0.41 seconds
GitLint PASS 0.30 seconds
BuildEll PASS 26.97 seconds
BluezMake PASS 819.40 seconds
MakeCheck PASS 11.22 seconds
MakeDistcheck PASS 158.87 seconds
CheckValgrind PASS 253.18 seconds
CheckSmatch PASS 343.26 seconds
bluezmakeextell PASS 103.67 seconds
IncrementalBuild PASS 679.27 seconds
ScanBuild PASS 1095.06 seconds



---
Regards,
Linux Bluetooth

2023-07-31 09:51:29

by Zijun Hu

[permalink] [raw]
Subject: [PATCH BlueZ v2] main: Fix integer configuration option parse failures

parse_config_int() has a obvious logical error, so causes many
parse failures of integer configuration options, fixed by this
change.
---
src/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main.c b/src/main.c
index 150a5af4cca4..13501440b052 100644
--- a/src/main.c
+++ b/src/main.c
@@ -458,7 +458,7 @@ static bool parse_config_int(GKeyFile *config, const char *group,
return false;
}

- if (tmp < max) {
+ if (tmp > max) {
warn("%s.%s = %d is out of range (> %d)", group, key, tmp, max);
return false;
}
--
2.7.4


2023-07-31 11:02:20

by bluez.test.bot

[permalink] [raw]
Subject: RE: [BlueZ,v2] main: Fix integer configuration option parse failures

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

---Test result---

Test Summary:
CheckPatch PASS 0.36 seconds
GitLint PASS 0.26 seconds
BuildEll PASS 32.64 seconds
BluezMake PASS 972.40 seconds
MakeCheck PASS 13.63 seconds
MakeDistcheck PASS 187.41 seconds
CheckValgrind PASS 311.54 seconds
CheckSmatch PASS 411.05 seconds
bluezmakeextell PASS 123.87 seconds
IncrementalBuild PASS 797.78 seconds
ScanBuild PASS 1256.69 seconds



---
Regards,
Linux Bluetooth

2023-07-31 18:26:40

by patchwork-bot+bluetooth

[permalink] [raw]
Subject: Re: [PATCH BlueZ v2] main: Fix integer configuration option parse failures

Hello:

This patch was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <[email protected]>:

On Mon, 31 Jul 2023 17:28:42 +0800 you wrote:
> parse_config_int() has a obvious logical error, so causes many
> parse failures of integer configuration options, fixed by this
> change.
> ---
> src/main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
- [BlueZ,v2] main: Fix integer configuration option parse failures
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=446d8ada5790

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



2023-07-31 18:26:40

by patchwork-bot+bluetooth

[permalink] [raw]
Subject: Re: [PATCH v1] main: Fix a logical error within parse_config_int()

Hello:

This patch was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <[email protected]>:

On Mon, 31 Jul 2023 15:46:44 +0800 you wrote:
> Fix a logical error within parse_config_int().
> ---
> src/main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
- [v1] main: Fix a logical error within parse_config_int()
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=446d8ada5790

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