Skip to contentSkip to conversation

staging: greybus: bootrom: use firmware size for debug output

PATCH In review [email protected] 2 participants 2 messages Nov 24

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: greybus: bootrom: use firmware size for debug output

From: Yalagada Pavan Kumar <[email protected]>

The firmware size is converted to little-endian byte order before being stored in size_response->size. However, the debug message prints size_response->size directly without converting it back to CPU byte order.

Use bootrom->fw->size instead, which already contains the firmware size in CPU byte order.

Fixes fc41c2da44c5 ("greybus: firmware/bootrom: debug output from bootrom protocol")
---
 drivers/staging/greybus/bootrom.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/greybus/bootrom.c +2 -2
index fb1fbd3f7b99..4e225084851b 100644
@@ -222,8 +222,8 @@ static int gb_bootrom_firmware_size_request(struct gb_operation *op)
 	size_response = op->response->payload;
 	size_response->size = cpu_to_le32(bootrom->fw->size);
 
-	dev_dbg(dev, "%s: firmware size %u bytes\n",
-		__func__, size_response->size);
+	dev_dbg(dev, "%s: firmware size %zu bytes\n",
+		__func__, bootrom->fw->size);
 
 unlock:
 	mutex_unlock(&bootrom->mutex);
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · On 11/24/26 12:10 PM, [email protected] wrote:

From: Yalagada Pavan Kumar <[email protected]>

The firmware size is converted to little-endian byte order before being stored in size_response->size. However, the debug message prints size_response->size directly without converting it back to CPU byte order.

Quoted 6 lines

Use bootrom->fw->size instead, which already contains the firmware size in CPU byte order.

Fixes fc41c2da44c5 ("greybus: firmware/bootrom: debug output from bootrom protocol")

Thanks for the patch, this looks good.

Quoted 19 lines
---
  drivers/staging/greybus/bootrom.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/greybus/bootrom.c +2 -2
index fb1fbd3f7b99..4e225084851b 100644
@@ -222,8 +222,8 @@ static int gb_bootrom_firmware_size_request(struct gb_operation *op)
  	size_response = op->response->payload;
  	size_response->size = cpu_to_le32(bootrom->fw->size);
 
-	dev_dbg(dev, "%s: firmware size %u bytes\n",
-		__func__, size_response->size);
+	dev_dbg(dev, "%s: firmware size %zu bytes\n",
+		__func__, bootrom->fw->size);
 
  unlock:
  	mutex_unlock(&bootrom->mutex);