Linux kernel staging patches
 help / color / mirror / Atom feed
* [PATCH v2] staging: greybus: bootrom: fix firmware size endianness in debug log
@ 2026-12-04 18:25 Omar Yiğitcan Mengü
  2026-12-05 11:27 ` Dan Carpenter
  0 siblings, 1 reply; 2+ messages in thread
From: Omar Yiğitcan Mengü @ 2026-12-04 18:25 UTC (permalink / raw)
  To: Viresh Kumar, Johan Hovold, Alex Elder, Greg Kroah-Hartman
  Cc: Dan Carpenter, greybus-dev, linux-staging,
	Omar Yiğitcan Mengü

In gb_bootrom_firmware_size_request(), size_response->size is a __le32
field populated with cpu_to_le32(bootrom->fw->size). Printing
size_response->size directly with %u outputs a byte-swapped value on
big-endian hosts.

Print bootrom->fw->size directly with %zu instead so the logged size is
always in host byte order.

Signed-off-by: Omar Yiğitcan Mengü <menguomary@gmail.com>
---

Changes in v2:
- Resend using git send-email to avoid line wrapping.

 drivers/staging/greybus/bootrom.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/greybus/bootrom.c b/drivers/staging/greybus/bootrom.c
index fb1fbd3f7b9..4e225084851 100644
--- a/drivers/staging/greybus/bootrom.c
+++ b/drivers/staging/greybus/bootrom.c
@@ -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);
-- 
2.53.0


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

* Re: [PATCH v2] staging: greybus: bootrom: fix firmware size endianness in debug log
  2026-12-04 18:25 [PATCH v2] staging: greybus: bootrom: fix firmware size endianness in debug log Omar Yiğitcan Mengü
@ 2026-12-05 11:27 ` Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2026-12-05 11:27 UTC (permalink / raw)
  To: Omar Yiğitcan Mengü
  Cc: Viresh Kumar, Johan Hovold, Alex Elder, Greg Kroah-Hartman,
	greybus-dev, linux-staging

On Fri, Dec 04, 2026 at 09:25:25PM +0300, Omar Yiğitcan Mengü wrote:
> In gb_bootrom_firmware_size_request(), size_response->size is a __le32
> field populated with cpu_to_le32(bootrom->fw->size). Printing
> size_response->size directly with %u outputs a byte-swapped value on
> big-endian hosts.
> 
> Print bootrom->fw->size directly with %zu instead so the logged size is
> always in host byte order.

When you're writing this commit message the only thing that matters in
what you've changed is the s/size_response->size/bootrom->fw->size/.
The change from %u to %zu is really sort of an unnecessary detail to
mention and reviewers maybe will see that instead of the important bits.

I guess where the line is, if reviewers are going to ask about why you
made an unrelated change then you have to explain it.  But if it's so
trivial like this it's better to not add it to the commit message so it
stays focused.

But it's fine.

Reviewed-by: Dan Carpenter <error27@gmail.com>

regards,
dan carpenter



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

end of thread, other threads:[~2026-12-05 11:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04 18:25 [PATCH v2] staging: greybus: bootrom: fix firmware size endianness in debug log Omar Yiğitcan Mengü
2026-12-05 11:27 ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox