From: Rafael Aquini on
gitlab.com
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1598#note_8297...
Well, any pointer to pointer can be NULL, either by being not-initialized or
explicitly assigned so,
so the compiler warning (-Waddress) might be considering some other contextual
knowledge, as in:
mm/sparse.c:
225 /* Record a memory area against a node. */
226 static void __init memory_present(int nid, unsigned long start, unsigned
long end)
227 {
228 unsigned long pfn;
229
230 #ifdef CONFIG_SPARSEMEM_EXTREME
231 if (unlikely(!mem_section)) {
232 unsigned long size, align;
233
234 size = sizeof(struct mem_section *) * NR_SECTION_ROOTS;
235 align = 1 << (INTERNODE_CACHE_SHIFT);
236 mem_section = memblock_alloc(size, align);
...
The warning seems off, in a first glance, specially because there's no throw
for memory_present l:231...
Can't we just hint that preprocessor wrapped branch within __nr_to_section()
as unlikely, instead?