[GIT PULL] RISC-V Patches for the 5.13 Merge Window, Part 1

Linus Torvalds torvalds at linux-foundation.org
Thu May 6 17:26:06 BST 2021


On Wed, May 5, 2021 at 10:51 PM Palmer Dabbelt <palmer at dabbelt.com> wrote:
>
> Here are my conflict resolutions, if that helps:

I think you've unnecessarily done that "+1" twice:

>  +      /* + 1 as memblock_alloc() might increase memblock.reserved.cnt */
>  +      num_resources = memblock.memory.cnt + memblock.reserved.cnt + 1;
>  +      res_idx = num_resources - 1;
>
> -       mem_res_sz = num_resources * sizeof(*mem_res);
> +       /* + 1 as memblock_alloc() might increase memblock.reserved.cnt */
> +       mem_res_sz = (memblock.memory.cnt + memblock.reserved.cnt + 1) * sizeof(*mem_res);
>         mem_res = memblock_alloc(mem_res_sz, SMP_CACHE_BYTES);
>         if (!mem_res)
>                 panic("%s: Failed to allocate %zu bytes\n", __func__, mem_res_sz);

and I kept that as just the first one.

               Linus



More information about the linux-riscv mailing list