summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorPali Rohár <pali@kernel.org>2021-09-25 00:06:44 +0300
committerStefan Roese <sr@denx.de>2021-10-01 12:07:13 +0300
commitc5d666aab3a76a7c307f9261afcf4899ec7c6410 (patch)
tree67b10993bf0772b01bfec2b4847a50453d070e45 /tools
parent00a1deed1c8d5005499ac7a3c1c337de27102eee (diff)
downloadu-boot-c5d666aab3a76a7c307f9261afcf4899ec7c6410.tar.xz
tools: kwboot: Fix return type of kwboot_xm_makeblock() function
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 <pali@kernel.org> Reviewed-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'tools')
-rw-r--r--tools/kwboot.c5
1 files changed, 1 insertions, 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;