Re: [PATCH v2 1/2] memblock: drop for_each_memblock_type() and open code its users
From: sashiko-bot
Date: Thu Sep 17 2026 - 20:29:29 EST
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] mm: commit message and implementation mismatch regarding variable scope
--
commit c0dca5a3d7239e89d9dccb549819f0c9f7139656
Author: Tarun Sahu <tarunsahu@xxxxxxxxxx>
memblock: drop for_each_memblock_type() and open code its users
Remove the for_each_memblock_type() macro and open code its users to
allow iterating from an arbitrary index. The three users modified are
memblock_add_range(), memblock_isolate_range(), and memblock_dump().
> Remove the macro and open code its three users: memblock_add_range(),
> memblock_isolate_range() and memblock_dump(). While at it, move the
> region pointer into the loop body scope.
[Severity: Low]
This isn't a bug, but the commit message mentions moving the region pointer
into the loop body scope.
Looking at memblock_add_range(), memblock_isolate_range(), and
memblock_dump() in mm/memblock.c, the declaration for
struct memblock_region *rgn remains at the top-level function scope rather
than being moved inside the newly open-coded for loops.
Did this patch miss moving the declaration of the rgn pointer into the
loop blocks as intended?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260918002239.4024231-1-tarunsahu@xxxxxxxxxx?part=1