On 06.10.2024 23:49, Daniel P. Smith wrote:
> --- a/xen/arch/x86/include/asm/bootinfo.h
> +++ b/xen/arch/x86/include/asm/bootinfo.h
> @@ -54,8 +54,24 @@ struct boot_info {
>      struct boot_module mods[MAX_NR_BOOTMODS + 1];
>  };
>  
> -#endif /* __XEN_X86_BOOTINFO_H__ */
> +static inline int __init next_boot_module_index(
> +    const struct boot_info *bi, enum bootmod_type t, int offset)

Instead of "offset" maybe better "start" or "from"? Further, plain int
(as also used ...

> +{
> +    int i;

... here) isn't really liked for ...

> +    for ( i = offset; i < bi->nr_modules; i++ )
> +    {
> +        if ( bi->mods[i].type == t )

... array indexing. Perhaps the function itself would better have
unsigned int return type as well, ...

> +            return i;
> +    }
> +
> +    return -1;

... using UINT_MAX or some other suitable constant here instead?

Jan

Reply via email to