]>
xen/dt: Remove loop in dt_read_number()
authorAlejandro Vallejo <agarciav@amd.com>
Thu, 19 Jun 2025 11:42:04 +0000 (13:42 +0200)
committerStefano Stabellini <stefano.stabellini@amd.com>
Sat, 21 Jun 2025 00:47:31 +0000 (17:47 -0700)
commitc65ff27d7158ca31cca0bb4b77a515c8a5bddced
tree271bddedab576cd87473daa531b2ff1681d98165
parent12d72d032e169082308efb9d44b9964ef9fa4340
xen/dt: Remove loop in dt_read_number()

The DT spec declares only two number types for a property: u32 and u64,
as per Table 2.3 in Section 2.2.4. Remove unbounded loop and replace
with a switch statement. Default to a size of 1 cell in the nonsensical
size case, with a warning printed on the Xen console.

Suggested-by: Daniel P. Smith" <dpsmith@apertussolutions.com>
Signed-off-by: Alejandro Vallejo <agarciav@amd.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/include/xen/device_tree.h