mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:07:47 +00:00
Kernel: Fix incorrect argument when constructing DiskPartitionMetadata
The existing code invokes operator bool for the partition_type variable.
This commit is contained in:
parent
24376e7759
commit
4b5dbc15df
2 changed files with 3 additions and 9 deletions
|
@ -64,9 +64,7 @@ EBRPartitionTable::EBRPartitionTable(const StorageDevice& device)
|
||||||
if (entry.offset == 0x00) {
|
if (entry.offset == 0x00) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
auto partition_type = ByteBuffer::create_zeroed(sizeof(u8));
|
m_partitions.empend(entry.offset, (entry.offset + entry.length), entry.type);
|
||||||
partition_type.data()[0] = entry.type;
|
|
||||||
m_partitions.append(DiskPartitionMetadata({ entry.offset, (entry.offset + entry.length), partition_type }));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,9 +60,7 @@ MBRPartitionTable::MBRPartitionTable(const StorageDevice& device, u32 start_lba)
|
||||||
if (entry.offset == 0x00) {
|
if (entry.offset == 0x00) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
auto partition_type = ByteBuffer::create_zeroed(sizeof(u8));
|
m_partitions.empend(entry.offset, (entry.offset + entry.length), entry.type);
|
||||||
partition_type.data()[0] = entry.type;
|
|
||||||
m_partitions.append(DiskPartitionMetadata({ entry.offset, (entry.offset + entry.length), partition_type }));
|
|
||||||
}
|
}
|
||||||
m_valid = true;
|
m_valid = true;
|
||||||
}
|
}
|
||||||
|
@ -81,9 +79,7 @@ MBRPartitionTable::MBRPartitionTable(const StorageDevice& device)
|
||||||
if (entry.offset == 0x00) {
|
if (entry.offset == 0x00) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
auto partition_type = ByteBuffer::create_zeroed(sizeof(u8));
|
m_partitions.empend(entry.offset, (entry.offset + entry.length), entry.type);
|
||||||
partition_type.data()[0] = entry.type;
|
|
||||||
m_partitions.append(DiskPartitionMetadata({ entry.offset, (entry.offset + entry.length), partition_type }));
|
|
||||||
}
|
}
|
||||||
m_valid = true;
|
m_valid = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue