:: commit 71cfe73d677828f0ed439ff81e37fa6203392e25

mintsuki <mintsuki@protonmail.com> — 2024-05-07 18:11

parents: 10e0ca6aaa

disk: BIOS: Work around bogus GCC warning

diff --git a/common/drivers/disk.s2.c b/common/drivers/disk.s2.c
index 56a041c5..b8f5a64c 100644
--- a/common/drivers/disk.s2.c
+++ b/common/drivers/disk.s2.c
@@ -212,7 +212,7 @@ void disk_create_index(void) {
     volume_index = ext_mem_alloc(sizeof(struct volume) * MAX_VOLUMES);
 
     // Disk count (only non-removable) at 0040:0075
-    uint8_t *bda_disk_count = (void *)rm_desegment(0x0040, 0x0075);
+    uint8_t bda_disk_count = mminb(rm_desegment(0x0040, 0x0075));
 
     int optical_indices = 1, hdd_indices = 1;
 
@@ -246,7 +246,7 @@ void disk_create_index(void) {
             }
         }
 
-        if (!is_removable && hdd_indices > *bda_disk_count) {
+        if (!is_removable && hdd_indices > bda_disk_count) {
             continue;
         }
 
tab: 248 wrap: offon