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

From: Linus Torvalds
Date: Thu May 06 2021 - 12:26:30 EST


On Wed, May 5, 2021 at 10:51 PM Palmer Dabbelt <palmer@xxxxxxxxxxx> 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