summaryrefslogtreecommitdiff
path: root/Kernel/Storage
diff options
context:
space:
mode:
Diffstat (limited to 'Kernel/Storage')
-rw-r--r--Kernel/Storage/ATA/ATADiskDevice.cpp6
-rw-r--r--Kernel/Storage/ATA/ATAPIDiscDevice.cpp6
-rw-r--r--Kernel/Storage/RamdiskDevice.cpp6
3 files changed, 6 insertions, 12 deletions
diff --git a/Kernel/Storage/ATA/ATADiskDevice.cpp b/Kernel/Storage/ATA/ATADiskDevice.cpp
index 09e867164f..dd2f484661 100644
--- a/Kernel/Storage/ATA/ATADiskDevice.cpp
+++ b/Kernel/Storage/ATA/ATADiskDevice.cpp
@@ -18,11 +18,9 @@ NonnullRefPtr<ATADiskDevice> ATADiskDevice::create(const ATAController& controll
{
auto minor_device_number = StorageManagement::generate_storage_minor_number();
- // FIXME: We need a way of formatting strings with KString.
- auto device_name = String::formatted("hd{:c}", 'a' + minor_device_number.value());
- auto device_name_kstring = KString::must_create(device_name.view());
+ auto device_name = MUST(KString::formatted("hd{:c}", 'a' + minor_device_number.value()));
- auto disk_device_or_error = DeviceManagement::try_create_device<ATADiskDevice>(controller, ata_address, minor_device_number, capabilities, logical_sector_size, max_addressable_block, move(device_name_kstring));
+ auto disk_device_or_error = DeviceManagement::try_create_device<ATADiskDevice>(controller, ata_address, minor_device_number, capabilities, logical_sector_size, max_addressable_block, move(device_name));
// FIXME: Find a way to propagate errors
VERIFY(!disk_device_or_error.is_error());
return disk_device_or_error.release_value();
diff --git a/Kernel/Storage/ATA/ATAPIDiscDevice.cpp b/Kernel/Storage/ATA/ATAPIDiscDevice.cpp
index 984312bf08..a9f7a91447 100644
--- a/Kernel/Storage/ATA/ATAPIDiscDevice.cpp
+++ b/Kernel/Storage/ATA/ATAPIDiscDevice.cpp
@@ -18,11 +18,9 @@ NonnullRefPtr<ATAPIDiscDevice> ATAPIDiscDevice::create(const ATAController& cont
{
auto minor_device_number = StorageManagement::generate_storage_minor_number();
- // FIXME: We need a way of formatting strings with KString.
- auto device_name = String::formatted("hd{:c}", 'a' + minor_device_number.value());
- auto device_name_kstring = KString::must_create(device_name.view());
+ auto device_name = MUST(KString::formatted("hd{:c}", 'a' + minor_device_number.value()));
- auto disc_device_or_error = DeviceManagement::try_create_device<ATAPIDiscDevice>(controller, ata_address, minor_device_number.value(), capabilities, max_addressable_block, move(device_name_kstring));
+ auto disc_device_or_error = DeviceManagement::try_create_device<ATAPIDiscDevice>(controller, ata_address, minor_device_number.value(), capabilities, max_addressable_block, move(device_name));
// FIXME: Find a way to propagate errors
VERIFY(!disc_device_or_error.is_error());
return disc_device_or_error.release_value();
diff --git a/Kernel/Storage/RamdiskDevice.cpp b/Kernel/Storage/RamdiskDevice.cpp
index 6d5a6ebd4f..2b3bda9240 100644
--- a/Kernel/Storage/RamdiskDevice.cpp
+++ b/Kernel/Storage/RamdiskDevice.cpp
@@ -17,11 +17,9 @@ NonnullRefPtr<RamdiskDevice> RamdiskDevice::create(const RamdiskController& cont
{
// FIXME: Try to not hardcode a maximum of 16 partitions per drive!
size_t drive_index = minor / 16;
- // FIXME: We need a way of formatting strings with KString!
- auto device_name = String::formatted("ramdisk{}", drive_index);
- auto device_name_kstring = KString::must_create(device_name.view());
+ auto device_name = MUST(KString::formatted("ramdisk{}", drive_index));
- auto device_or_error = DeviceManagement::try_create_device<RamdiskDevice>(controller, move(region), major, minor, move(device_name_kstring));
+ auto device_or_error = DeviceManagement::try_create_device<RamdiskDevice>(controller, move(region), major, minor, move(device_name));
// FIXME: Find a way to propagate errors
VERIFY(!device_or_error.is_error());
return device_or_error.release_value();