summaryrefslogtreecommitdiff
path: root/cmd/ubi.c
diff options
context:
space:
mode:
authorxypron.glpk@gmx.de <xypron.glpk@gmx.de>2017-04-15 16:25:25 +0200
committerHeiko Schocher <hs@denx.de>2017-04-18 06:08:32 +0200
commit18f41f2fa2d021f7baad37ba6fbe01b49309afbb (patch)
tree831ffe2ce7c8f7e5fa931c64bb1103f174a1b907 /cmd/ubi.c
parentf6c1df44b815a08585e7fd3805a1db51a5955d09 (diff)
cmd: ubi: remove unnecessary logical constraint
A size_t variable can never be negative. The problem was indicated by cppcheck. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Heiko Schocher <hs@denx.de>
Diffstat (limited to 'cmd/ubi.c')
-rw-r--r--cmd/ubi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/ubi.c b/cmd/ubi.c
index efc43ffde9..222be5a357 100644
--- a/cmd/ubi.c
+++ b/cmd/ubi.c
@@ -308,7 +308,7 @@ int ubi_volume_begin_write(char *volume, void *buf, size_t size,
return ENODEV;
rsvd_bytes = vol->reserved_pebs * (ubi->leb_size - vol->data_pad);
- if (size < 0 || size > rsvd_bytes) {
+ if (size > rsvd_bytes) {
printf("size > volume size! Aborting!\n");
return EINVAL;
}