Skip to content

Commit 4eb4b62

Browse files
committed
disk.c: remove dead-code check
len can never be less than zero with the new: start = p->start + off; if (start > p->end) { return -1; } check.
1 parent 9fd64f6 commit 4eb4b62

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

src/disk.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -293,9 +293,6 @@ int disk_part_read(int drv, int part, uint64_t off, uint64_t sz, uint8_t *buf)
293293
if ((p->end - start + 1) < sz) {
294294
len = (uint32_t)(p->end - start + 1);
295295
}
296-
if (len < 0) {
297-
return -1;
298-
}
299296
ret = disk_read(drv, start, len, buf);
300297
#ifdef DEBUG_DISK
301298
wolfBoot_printf("disk_part_read: drv: %d, part: %d, off: %llu, sz: %llu, "
@@ -340,9 +337,6 @@ int disk_part_write(int drv, int part, uint64_t off, uint64_t sz, const uint8_t
340337
if ((p->end - start + 1) < sz) {
341338
len = (uint32_t)(p->end - start + 1);
342339
}
343-
if (len < 0) {
344-
return -1;
345-
}
346340
ret = disk_write(drv, start, len, buf);
347341
#ifdef DEBUG_DISK
348342
wolfBoot_printf("disk_part_write: drv: %d, part: %d, off: %llu, sz: %llu, "

0 commit comments

Comments
 (0)