Skip to contentSkip to conversation

cmd: bcb: Fix bcb compilation when CONFIG_CMD_BCB=n

PATCH In review Mattijs Korpershoek 5 participants 5 messages Jun 3, 2024 – Jun 14, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cmd: bcb: Fix bcb compilation when CONFIG_CMD_BCB=n

commit dfeb4f0d7935 ("cmd: bcb: extend BCB C API to allow read/write the fields") introduced the bcb_get() function.

When CONFIG_CMD_BCB=n, that function is stubbed.
The stubbed function has a wrong prototype: value_size arg is missing.

Add the missing argument to fix build when CONFIG_CMD_BCB=n.

Fixes dfeb4f0d7935 ("cmd: bcb: extend BCB C API to allow read/write the fields")
---
 include/bcb.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
include/bcb.h +2 -1
index 1941d8c28b4f..a56b547595a6 100644
@@ -58,7 +58,8 @@ static inline int bcb_set(enum bcb_field field, const char *value)
 	return -EOPNOTSUPP;
 }
 
-static inline int bcb_get(enum bcb_field field, char *value_out)
+static inline int bcb_get(enum bcb_field field,
+			  char *value_out, size_t value_size)
 {
 	return -EOPNOTSUPP;
 }

---
base-commit: ea722aa5eb33740ae77e8816aeb72b385e621cd0
change-id: 20240603-bcb-compil-d8eaf7074475

Best regards,

Signature · 1 line
Mattijs Korpershoek <[email protected]>
Reviewed-by on v1 1/1
#1 lore raw

hi,

Le 03/06/2024 à 11:04, Mattijs Korpershoek a écrit :

Quoted 33 lines

commit dfeb4f0d7935 ("cmd: bcb: extend BCB C API to allow read/write the fields") introduced the bcb_get() function.

When CONFIG_CMD_BCB=n, that function is stubbed.
The stubbed function has a wrong prototype: value_size arg is missing.

Add the missing argument to fix build when CONFIG_CMD_BCB=n.

Fixes dfeb4f0d7935 ("cmd: bcb: extend BCB C API to allow read/write the fields")
---
  include/bcb.h | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
include/bcb.h +2 -2
index 1941d8c28b4f..a56b547595a6 100644
@@ -58,7 +58,8 @@ static inline int bcb_set(enum bcb_field field, const char *value)
  	return -EOPNOTSUPP;
  }
 
-static inline int bcb_get(enum bcb_field field, char *value_out)
+static inline int bcb_get(enum bcb_field field,
+			  char *value_out, size_t value_size)
  {
  	return -EOPNOTSUPP;
  }
 
---

base-commit: ea722aa5eb33740ae77e8816aeb72b385e621cd0
change-id: 20240603-bcb-compil-d8eaf7074475

Quoted 1 line

Best regards,

Regards
Guillaume

Reviewed-by on v1 1/1
#3 lore raw
In reply to Mattijs Korpershoek
Quoted 33 lines · Mattijs Korpershoek

commit dfeb4f0d7935 ("cmd: bcb: extend BCB C API to allow read/write the fields") introduced the bcb_get() function.

When CONFIG_CMD_BCB=n, that function is stubbed.
The stubbed function has a wrong prototype: value_size arg is missing.

Add the missing argument to fix build when CONFIG_CMD_BCB=n.

Fixes dfeb4f0d7935 ("cmd: bcb: extend BCB C API to allow read/write the fields")
---
 include/bcb.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
include/bcb.h +2 -2
index 1941d8c28b4f..a56b547595a6 100644
@@ -58,7 +58,8 @@ static inline int bcb_set(enum bcb_field field, const char *value)
 	return -EOPNOTSUPP;
 }
 
-static inline int bcb_get(enum bcb_field field, char *value_out)
+static inline int bcb_get(enum bcb_field field,
+			  char *value_out, size_t value_size)
 {
 	return -EOPNOTSUPP;
 }
 
---

base-commit: ea722aa5eb33740ae77e8816aeb72b385e621cd0
change-id: 20240603-bcb-compil-d8eaf7074475

Quoted 5 lines

Best regards,

Signature · 1 line
Mattijs Korpershoek <[email protected]>
Signature · 1 line
Julien Masson
#4 lore raw
In reply to Mattijs Korpershoek
Quoted 9 lines · Mattijs Korpershoek

commit dfeb4f0d7935 ("cmd: bcb: extend BCB C API to allow read/write the fields") introduced the bcb_get() function.

When CONFIG_CMD_BCB=n, that function is stubbed.
The stubbed function has a wrong prototype: value_size arg is missing.

Add the missing argument to fix build when CONFIG_CMD_BCB=n.

[...]

Applied to u-boot/master, thanks!

Signature · 1 line
Tom