Skip to content

Commit 09a95b8

Browse files
rizlikdanielinux
authored andcommitted
disk.c: remove dead-code check
len can never be less negative.
1 parent e7e6bf7 commit 09a95b8

1 file changed

Lines changed: 0 additions & 6 deletions

File tree

src/disk.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -297,9 +297,6 @@ int disk_part_read(int drv, int part, uint64_t off, uint64_t sz, uint8_t *buf)
297297
if ((p->end - start + 1) < sz) {
298298
len = (uint32_t)(p->end - start + 1);
299299
}
300-
if (len < 0) {
301-
return -1;
302-
}
303300
ret = disk_read(drv, start, len, buf);
304301
#ifdef DEBUG_DISK
305302
wolfBoot_printf("disk_part_read: drv: %d, part: %d, off: %llu, sz: %llu, "
@@ -348,9 +345,6 @@ int disk_part_write(int drv, int part, uint64_t off, uint64_t sz, const uint8_t
348345
if ((p->end - start + 1) < sz) {
349346
len = (uint32_t)(p->end - start + 1);
350347
}
351-
if (len < 0) {
352-
return -1;
353-
}
354348
ret = disk_write(drv, start, len, buf);
355349
#ifdef DEBUG_DISK
356350
wolfBoot_printf("disk_part_write: drv: %d, part: %d, off: %llu, sz: %llu, "

0 commit comments

Comments
 (0)