On 02.11.2024 18:25, Daniel P. Smith wrote:
> --- a/xen/arch/x86/cpu/microcode/core.c
> +++ b/xen/arch/x86/cpu/microcode/core.c
> @@ -790,15 +790,13 @@ static int __init early_microcode_load(struct boot_info
> *bi)
>
> if ( opt_scan ) /* Scan for a CPIO archive */
> {
> - for ( idx = 1; idx < bi->nr_modules; ++idx )
> + for_each_boot_module_by_type(idx, bi, BOOTMOD_UNKNOWN)
> {
> + struct boot_module *bm = &bi->mods[idx];
pointer-to-const? You really want to get used to applying const to pointed-to
types whenever possible. IOW ...
> --- a/xen/xsm/xsm_policy.c
> +++ b/xen/xsm/xsm_policy.c
> @@ -33,22 +33,18 @@
> int __init xsm_multiboot_policy_init(
> struct boot_info *bi, void **policy_buffer, size_t *policy_size)
> {
> - int i;
> + unsigned int i;
> int rc = 0;
> u32 *_policy_start;
> unsigned long _policy_len;
>
> - /*
> - * Try all modules and see whichever could be the binary policy.
> - * Adjust module_map for the module that is the binary policy.
> - */
> - for ( i = bi->nr_modules - 1; i >= 1; i-- )
> + /* Try all unknown modules and see whichever could be the binary policy.
> */
> + for_each_boot_module_by_type(i, bi, BOOTMOD_UNKNOWN)
> {
> - if ( !test_bit(i, bi->module_map) )
> - continue;
> + struct boot_module *bm = &bi->mods[i];
... same here (and likely elsewhere in the series).
Jan