Allow converting Feature::Unknown(id) to u32
Firmware components responsible for forwarding FF-A messages may
encounter an FFA_FEATURE call that needs to be forwarded, but the
feature ID is not recognized. For example, this can happen, when a
caller queries an interface of a future version of FF-A. Relax the
Feature to u32 conversion function to support converting the
Feature::Unknown(id) enum variant into a u32 value instead of panicking.
Signed-off-by: Imre Kis <imre.kis@arm.com>
Change-Id: Ic0c6e5590cf9c94cd7af9870e0c59602d19f3d6d
diff --git a/src/lib.rs b/src/lib.rs
index f340ec2..8a6c49c 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -345,7 +345,7 @@
match value {
Feature::FuncId(func_id) => (1 << 31) | func_id as u32,
Feature::FeatureId(feature_id) => feature_id as u32,
- Feature::Unknown(id) => panic!("Unknown feature or function ID {:#x?}", id),
+ Feature::Unknown(id) => id,
}
}
}