pvmfw: Make the NonZeroUsize FDT_SIZE non-const

There seems to be a bug with clippy::undocumented_unsafe_blocks (in
whichever version Soong uses, AOSP ships 1.68, 1.69, and 1.70), where
the SAFETY comment preceding the definition of the const is ignored:

error: unsafe block missing a safety comment
  --> packages/modules/Virtualization/pvmfw/src/entry.rs:89:40
   |
89 |         const FDT_SIZE: NonZeroUsize = unsafe { NonZeroUsize::new_unchecked(FDT_MAX_SIZE) };
   |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: consider adding a safety comment on the preceding line

So please Clippy by replacing the unsafe with a (safe) runtime check.

Test: m pvmfw_bin
Change-Id: Iaf390027ec8be9f06c7a26928dfa5936736e26f2
1 file changed
tree: c97ab78d7ecc1790c3e097de9819acb375fb62d4
  1. apex/
  2. apkdmverity/
  3. authfs/
  4. compos/
  5. demo/
  6. demo_native/
  7. docs/
  8. encryptedstore/
  9. javalib/
  10. launcher/
  11. libs/
  12. microdroid/
  13. microdroid_manager/
  14. pvmfw/
  15. rialto/
  16. service_vm/
  17. tests/
  18. virtualizationmanager/
  19. virtualizationservice/
  20. vm/
  21. vm_payload/
  22. vmbase/
  23. vmclient/
  24. zipfuse/
  25. .clang-format
  26. .gitignore
  27. Android.bp
  28. OWNERS
  29. PREUPLOAD.cfg
  30. README.md
  31. TEST_MAPPING
README.md

Virtualization

This repository contains userspace services related to running virtual machines on Android, especially protected virtual machines. See the getting started documentation and Microdroid README for more information.