]> Git Repo - u-boot.git/commitdiff
cmd: ubi: remove unnecessary logical constraint
author[email protected] <[email protected]>
Sat, 15 Apr 2017 14:25:25 +0000 (16:25 +0200)
committerHeiko Schocher <[email protected]>
Tue, 18 Apr 2017 04:08:32 +0000 (06:08 +0200)
A size_t variable can never be negative.

The problem was indicated by cppcheck.

Signed-off-by: Heinrich Schuchardt <[email protected]>
Reviewed-by: Tom Rini <[email protected]>
Reviewed-by: Heiko Schocher <[email protected]>
cmd/ubi.c

index efc43ffde91ec5863adfc3382087afcca5358ba9..222be5a3576cb7aa96121b449889766550d1885d 100644 (file)
--- 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;
        }
This page took 0.033979 seconds and 4 git commands to generate.