host/limine: Simplify some redundantly written code
diff --git a/host/limine.c b/host/limine.c
index 833cef43..5bb60c32 100644
--- a/host/limine.c
+++ b/host/limine.c
@@ -720,41 +720,41 @@ static int bios_install(int argc, char *argv[]) {
if (!force_mbr) {
mbr = 0;
} else {
- hint8 = hint8 & 0x80 ? 0x80 : 0x00;
+ hint8 &= 0x80;
device_write(&hint8, 446, sizeof(uint8_t));
}
}
- any_active = any_active ? any_active : (hint8 & 0x80) != 0;
+ any_active = any_active || (hint8 & 0x80) != 0;
device_read(&hint8, 462, sizeof(uint8_t));
if (hint8 != 0x00 && hint8 != 0x80) {
if (!force_mbr) {
mbr = 0;
} else {
- hint8 = hint8 & 0x80 ? 0x80 : 0x00;
+ hint8 &= 0x80;
device_write(&hint8, 462, sizeof(uint8_t));
}
}
- any_active = any_active ? any_active : (hint8 & 0x80) != 0;
+ any_active = any_active || (hint8 & 0x80) != 0;
device_read(&hint8, 478, sizeof(uint8_t));
if (hint8 != 0x00 && hint8 != 0x80) {
if (!force_mbr) {
mbr = 0;
} else {
- hint8 = hint8 & 0x80 ? 0x80 : 0x00;
+ hint8 &= 0x80;
device_write(&hint8, 478, sizeof(uint8_t));
}
}
- any_active = any_active ? any_active : (hint8 & 0x80) != 0;
+ any_active = any_active || (hint8 & 0x80) != 0;
device_read(&hint8, 494, sizeof(uint8_t));
if (hint8 != 0x00 && hint8 != 0x80) {
if (!force_mbr) {
mbr = 0;
} else {
- hint8 = hint8 & 0x80 ? 0x80 : 0x00;
+ hint8 &= 0x80;
device_write(&hint8, 494, sizeof(uint8_t));
}
}
- any_active = any_active ? any_active : (hint8 & 0x80) != 0;
+ any_active = any_active || (hint8 & 0x80) != 0;
char hintc[64];
device_read(hintc, 4, 8);
