arch: Improve arch::Error

Remove unused error enum entries, improve wording and derive
thiserror::Error.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford
2022-04-20 16:43:53 +01:00
parent 1c786610b7
commit 47529796d0
4 changed files with 24 additions and 23 deletions

View File

@@ -50,7 +50,7 @@ pub enum Error {
impl From<Error> for super::Error {
fn from(e: Error) -> super::Error {
super::Error::AArch64Setup(e)
super::Error::PlatformSpecific(e)
}
}
@@ -185,10 +185,10 @@ pub fn initramfs_load_addr(
if guest_mem.address_in_range(offset) {
Ok(offset.raw_value())
} else {
Err(super::Error::AArch64Setup(Error::InitramfsAddress))
Err(super::Error::PlatformSpecific(Error::InitramfsAddress))
}
}
None => Err(super::Error::AArch64Setup(Error::InitramfsAddress)),
None => Err(super::Error::PlatformSpecific(Error::InitramfsAddress)),
}
}