Skip to content

Commit

Permalink
Remove obsolete methods
Browse files Browse the repository at this point in the history
  • Loading branch information
uweseimet committed Dec 11, 2024
1 parent 8b00245 commit db44b54
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 46 deletions.
30 changes: 10 additions & 20 deletions cpp/devices/disk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,27 +45,27 @@ bool Disk::SetUp()
});
AddCommand(scsi_command::read_6, [this]
{
Read6();
Read(RW6);
});
AddCommand(scsi_command::write_6, [this]
{
Write6();
Write(RW6);
});
AddCommand(scsi_command::seek_6, [this]
{
Seek6();
Seek(SEEK6);
});
AddCommand(scsi_command::read_capacity_10, [this]
{
ReadCapacity10();
});
AddCommand(scsi_command::read_10, [this]
{
Read10();
Read(RW10);
});
AddCommand(scsi_command::write_10, [this]
{
Write10();
Write(RW10);
});
AddCommand(scsi_command::read_long_10, [this]
{
Expand All @@ -81,7 +81,7 @@ bool Disk::SetUp()
});
AddCommand(scsi_command::seek_10, [this]
{
Seek10();
Seek(SEEK10);
});
AddCommand(scsi_command::verify_10, [this]
{
Expand All @@ -101,11 +101,11 @@ bool Disk::SetUp()
});
AddCommand(scsi_command::read_16, [this]
{
Read16();
Read(RW16);
});
AddCommand(scsi_command::write_16, [this]
{
Write16();
Write(RW16);
});
AddCommand(scsi_command::verify_16, [this]
{
Expand Down Expand Up @@ -459,19 +459,9 @@ void Disk::ReAssignBlocks()
StatusPhase();
}

void Disk::Seek6()
void Disk::Seek(access_mode mode)
{
const auto& [valid, _, __] = CheckAndGetStartAndCount(SEEK6);
if (valid) {
CheckReady();
}

StatusPhase();
}

void Disk::Seek10()
{
const auto& [valid, _, __] = CheckAndGetStartAndCount(SEEK10);
const auto& [valid, _, __] = CheckAndGetStartAndCount(mode);
if (valid) {
CheckReady();
}
Expand Down
27 changes: 1 addition & 26 deletions cpp/devices/disk.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,40 +77,15 @@ class Disk : public StorageDevice

void SynchronizeCache();
void ReadDefectData10() const;
virtual void Read6()
{
Read(RW6);
}
void Read10()
{
Read(RW10);
}
void Read16()
{
Read(RW16);
}
virtual void Write6()
{
Write(RW6);
}
void Write10()
{
Write(RW10);
}
void Write16()
{
Write(RW16);
}
void ReAssignBlocks();
void Seek10();
void ReadCapacity10();
void ReadCapacity16();
void ReadFormatCapacities();
void FormatUnit();
void Seek6();
void Read(access_mode);
void Write(access_mode);
void Verify(access_mode);
void Seek(access_mode);
void ReadLong10();
void ReadLong16();
void WriteLong10();
Expand Down

0 comments on commit db44b54

Please sign in to comment.