Skip to contentSkip to conversation

shared/shell: Fix build errors in fc42

PATCH Applied Luiz Augusto von Dentz 3 participants 4 messages Apr 17, 2025 – Apr 18, 2025 Bluetooth drivers

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/2 shared/shell: Fix build errors in fc42

From: Luiz Augusto von Dentz <[email protected]>

This fixes the following errors:

src/shared/shell.c: In function 'rl_cleanup':
src/shared/shell.c:1429:20: error: zero-length gnu_printf format string [-Werror=format-zero-length]
1429 | rl_message("");
| ^~

---
 src/shared/shell.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/shared/shell.c +1 -1
index b7784217723c..631a07f35625 100644
@@ -1426,7 +1426,7 @@ static void rl_cleanup(void)
 	if (data.history[0] != '\0')
 		write_history(data.history);
 
-	rl_message("");
+	rl_message("%s", "");
 	rl_callback_handler_remove();
 }
 
Signature · 1 line
2.49.0
author maintainer
#1 lore raw

PATCH 2/2 mesh: Fix build errors when compiling on fc42

From: Luiz Augusto von Dentz <[email protected]>

./mesh/crypto.c: In function ‘mesh_crypto_device_key’:
./mesh/crypto.c:436:33: error: initializer-string for array of ‘unsigned char’ truncates NUL terminator but destination lacks ‘nonstring’ attribute (5 chars into 4 available) [-Werror=unterminated-string-initialization]
436 | const uint8_t prdk[4] = "prdk";
| ^~~~~~

---
 mesh/crypto.c            | 8 ++++----
 tools/mesh-gatt/crypto.c | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)
mesh/crypto.c +4 -4
index b7607bb83794..ab44baee3427 100644
@@ -371,7 +371,7 @@ bool mesh_crypto_session_key(const uint8_t secret[32],
 					const uint8_t salt[16],
 					uint8_t session_key[16])
 {
-	const uint8_t prsk[4] = "prsk";
+	const uint8_t prsk[4] = { 'p', 'r', 's', 'k' };
 
 	if (!aes_cmac_one(salt, secret, 32, session_key))
 		return false;
@@ -383,7 +383,7 @@ bool mesh_crypto_nonce(const uint8_t secret[32],
 					const uint8_t salt[16],
 					uint8_t nonce[13])
 {
-	const uint8_t prsn[4] = "prsn";
+	const uint8_t prsn[4] = { 'p', 'r', 's', 'n' };
 	uint8_t tmp[16];
 	bool result;
 
@@ -421,7 +421,7 @@ bool mesh_crypto_prov_conf_key(const uint8_t secret[32],
 					const uint8_t salt[16],
 					uint8_t conf_key[16])
 {
-	const uint8_t prck[4] = "prck";
+	const uint8_t prck[4] = { 'p', 'r', 'c', 'k' };
 
 	if (!aes_cmac_one(salt, secret, 32, conf_key))
 		return false;
@@ -433,7 +433,7 @@ bool mesh_crypto_device_key(const uint8_t secret[32],
 						const uint8_t salt[16],
 						uint8_t device_key[16])
 {
-	const uint8_t prdk[4] = "prdk";
+	const uint8_t prdk[4] = { 'p', 'r', 'd', 'k' };
 
 	if (!aes_cmac_one(salt, secret, 32, device_key))
 		return false;
tools/mesh-gatt/crypto.c +4 -4
index c65974bb02d0..0dc796f004df 100644
@@ -902,7 +902,7 @@ bool mesh_crypto_session_key(const uint8_t secret[32],
 					const uint8_t salt[16],
 					uint8_t session_key[16])
 {
-	const uint8_t prsk[4] = "prsk";
+	const uint8_t prsk[4] = { 'p', 'r', 's', 'k' };
 
 	if (!aes_cmac_one(salt, secret, 32, session_key))
 		return false;
@@ -914,7 +914,7 @@ bool mesh_crypto_nonce(const uint8_t secret[32],
 					const uint8_t salt[16],
 					uint8_t nonce[13])
 {
-	const uint8_t prsn[4] = "prsn";
+	const uint8_t prsn[4] = { 'p', 'r', 's', 'n' };
 	uint8_t tmp[16];
 	bool result;
 
@@ -955,7 +955,7 @@ bool mesh_crypto_prov_conf_key(const uint8_t secret[32],
 					const uint8_t salt[16],
 					uint8_t conf_key[16])
 {
-	const uint8_t prck[4] = "prck";
+	const uint8_t prck[4] = { 'p', 'r', 'c', 'k' };
 
 	if (!aes_cmac_one(salt, secret, 32, conf_key))
 		return false;
@@ -967,7 +967,7 @@ bool mesh_crypto_device_key(const uint8_t secret[32],
 						const uint8_t salt[16],
 						uint8_t device_key[16])
 {
-	const uint8_t prdk[4] = "prdk";
+	const uint8_t prdk[4] = { 'p', 'r', 'd', 'k' };
 
 	if (!aes_cmac_one(salt, secret, 32, device_key))
 		return false;
Signature · 1 line
2.49.0
#2 lore raw
In reply to Luiz Augusto von Dentz

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

---Test result---

Test Summary:

CheckPatch                    PENDING   0.31 seconds
GitLint                       PENDING   0.19 seconds
BuildEll                      PASS      20.42 seconds
BluezMake                     PASS      2654.11 seconds
MakeCheck                     PASS      39.22 seconds
MakeDistcheck                 PASS      198.23 seconds
CheckValgrind                 PASS      280.23 seconds
CheckSmatch                   WARNING   301.86 seconds
bluezmakeextell               PASS      159.08 seconds
IncrementalBuild              PENDING   0.31 seconds
ScanBuild                     PASS      900.12 seconds

Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script Output:

##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:

##############################
Test: CheckSmatch - WARNING
Desc: Run smatch tool with source
Output:
src/shared/shell.c: note: in included file (through /usr/include/readline/readline.h):src/shared/shell.c: note: in included file (through /usr/include/readline/readline.h):src/shared/shell.c: note: in included file (through /usr/include/readline/readline.h):
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:

---
Regards,
Linux Bluetooth

#3 lore raw
In reply to Luiz Augusto von Dentz
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 Thu, 17 Apr 2025 16:21:12 -0400 you wrote:

From: Luiz Augusto von Dentz <[email protected]>

This fixes the following errors:

src/shared/shell.c: In function 'rl_cleanup':
src/shared/shell.c:1429:20: error: zero-length gnu_printf format string [-Werror=format-zero-length]
1429 | rl_message("");
| ^~

[...]

Here is the summary with links:
- [BlueZ,v1,1/2] shared/shell: Fix build errors in fc42

    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=e501c8ab3023
  - [BlueZ,v1,2/2] mesh: Fix build errors when compiling on fc42
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=2a569ec80ffb

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html