Patchwork [U-Boot,1/4] dfu:cosmetic: Fix printf text for buffer overflow condition

login
register
mail settings
Submitter Łukasz Majewski
Date Sept. 10, 2013, 1:29 p.m.
Message ID <1378819765-20159-2-git-send-email-l.majewski@samsung.com>
Download mbox | patch
Permalink /patch/273875/
State Superseded
Delegated to: Marek Vasut
Headers show

Comments

Łukasz Majewski - Sept. 10, 2013, 1:29 p.m.
Correct error message if overflow is detected.

Change-Id: I8a915c7353d49822c046fbc36241237b370e6c98
Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
---
 drivers/dfu/dfu.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Heiko Schocher - Sept. 11, 2013, 4:38 a.m.
Hello Lukasz,

Am 10.09.2013 15:29, schrieb Lukasz Majewski:
> Correct error message if overflow is detected.
>
> Change-Id: I8a915c7353d49822c046fbc36241237b370e6c98
> Signed-off-by: Lukasz Majewski<l.majewski@samsung.com>
> ---
>   drivers/dfu/dfu.c |    4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)

Tested on the dxr2 and rut board, so:

Tested-by: Heiko Schocher <hs@denx.de>

bye,
Heiko

Patch

diff --git a/drivers/dfu/dfu.c b/drivers/dfu/dfu.c
index d73d510..2f1e2af 100644
--- a/drivers/dfu/dfu.c
+++ b/drivers/dfu/dfu.c
@@ -153,8 +153,8 @@  int dfu_write(struct dfu_entity *dfu, void *buf, int size, int blk_seq_num)
 
 	/* we should be in buffer now (if not then size too large) */
 	if ((dfu->i_buf + size) > dfu->i_buf_end) {
-		printf("%s: Wrong size! [%d] [%d] - %d\n",
-		       __func__, dfu->i_blk_seq_num, blk_seq_num, size);
+		error("Buffer overflow! (0x%p + 0x%x > 0x%p)\n", dfu->i_buf,
+		      size, dfu->i_buf_end);
 		return -1;
 	}