On 24.09.21 23:06, Marek Behún wrote:
From: Pali Rohár <p...@kernel.org>

Function kwboot_xm_makeblock() always returns length of xmodem block. It
is always non-negative and calculated from variable with size_t type. Set
return type of this function to size_t and remove dead code which checks
for negative value.

Signed-off-by: Pali Rohár <p...@kernel.org>
Reviewed-by: Marek Behún <marek.be...@nic.cz>

Reviewed-by: Stefan Roese <s...@denx.de>

Thanks,
Stefan

---
  tools/kwboot.c | 5 +----
  1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/tools/kwboot.c b/tools/kwboot.c
index b9a402ca91..88353d19c0 100644
--- a/tools/kwboot.c
+++ b/tools/kwboot.c
@@ -347,7 +347,7 @@ kwboot_debugmsg(int tty, void *msg)
        return rc;
  }
-static int
+static size_t
  kwboot_xm_makeblock(struct kwboot_block *block, const void *data,
                    size_t size, int pnum)
  {
@@ -441,9 +441,6 @@ kwboot_xmodem(int tty, const void *_data, size_t size)
                n = kwboot_xm_makeblock(&block,
                                        data + N, size - N,
                                        pnum++);
-               if (n < 0)
-                       goto can;
-
                if (!n)
                        break;


Viele Grüße,
Stefan

--
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: s...@denx.de

Reply via email to