Kernel: Fix incorrect argument when constructing DiskPartitionMetadata

The existing code invokes operator bool for the partition_type
variable.
This commit is contained in:
Gunnar Beutner 2021-05-15 17:15:10 +02:00 committed by Andreas Kling
parent 24376e7759
commit 4b5dbc15df
Notes: sideshowbarker 2024-07-18 18:01:50 +09:00
2 changed files with 3 additions and 9 deletions

View file

@ -64,9 +64,7 @@ EBRPartitionTable::EBRPartitionTable(const StorageDevice& device)
if (entry.offset == 0x00) {
continue;
}
auto partition_type = ByteBuffer::create_zeroed(sizeof(u8));
partition_type.data()[0] = entry.type;
m_partitions.append(DiskPartitionMetadata({ entry.offset, (entry.offset + entry.length), partition_type }));
m_partitions.empend(entry.offset, (entry.offset + entry.length), entry.type);
}
}

View file

@ -60,9 +60,7 @@ MBRPartitionTable::MBRPartitionTable(const StorageDevice& device, u32 start_lba)
if (entry.offset == 0x00) {
continue;
}
auto partition_type = ByteBuffer::create_zeroed(sizeof(u8));
partition_type.data()[0] = entry.type;
m_partitions.append(DiskPartitionMetadata({ entry.offset, (entry.offset + entry.length), partition_type }));
m_partitions.empend(entry.offset, (entry.offset + entry.length), entry.type);
}
m_valid = true;
}
@ -81,9 +79,7 @@ MBRPartitionTable::MBRPartitionTable(const StorageDevice& device)
if (entry.offset == 0x00) {
continue;
}
auto partition_type = ByteBuffer::create_zeroed(sizeof(u8));
partition_type.data()[0] = entry.type;
m_partitions.append(DiskPartitionMetadata({ entry.offset, (entry.offset + entry.length), partition_type }));
m_partitions.empend(entry.offset, (entry.offset + entry.length), entry.type);
}
m_valid = true;
}