Re: [PATCH v2] xen/dt: Remove loop in dt_read_number()

2025-06-18 Thread Alejandro Vallejo
On Wed Jun 18, 2025 at 9:06 AM CEST, Michal Orzel wrote: > > > On 17/06/2025 19:13, Alejandro Vallejo wrote: >> 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 si

Re: [PATCH v2] xen/dt: Remove loop in dt_read_number()

2025-06-18 Thread Julien Grall
Hi Michal, On 18/06/2025 08:06, Orzel, Michal wrote: On 17/06/2025 19:13, Alejandro Vallejo wrote: 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

Re: [PATCH v2] xen/dt: Remove loop in dt_read_number()

2025-06-18 Thread Orzel, Michal
On 17/06/2025 19:13, Alejandro Vallejo wrote: > 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 pri

Re: [PATCH v2] xen/dt: Remove loop in dt_read_number()

2025-06-17 Thread Jan Beulich
On 17.06.2025 19:13, Alejandro Vallejo wrote: > --- a/xen/include/xen/device_tree.h > +++ b/xen/include/xen/device_tree.h > @@ -261,10 +261,21 @@ void intc_dt_preinit(void); > /* Helper to read a big number; size is in cells (not bytes) */ > static inline u64 dt_read_number(const __be32 *cell, in

Re: [PATCH v2] xen/dt: Remove loop in dt_read_number()

2025-06-17 Thread Julien Grall
Hi Alejandro, Sorry I didn't see there was a v2. On 17/06/2025 18:13, Alejandro Vallejo wrote: 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

Re: [PATCH v2] xen/dt: Remove loop in dt_read_number()

2025-06-17 Thread Stefano Stabellini
On Tue, 17 Jun 2025, Alejandro Vallejo wrote: > 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 printe