From: xypron.glpk@gmx.de Date: Sat, 15 Apr 2017 14:25:25 +0000 (+0200) Subject: cmd: ubi: remove unnecessary logical constraint X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=18f41f2fa2d021f7baad37ba6fbe01b49309afbb;p=u-boot.git 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 Reviewed-by: Tom Rini Reviewed-by: Heiko Schocher --- 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; }