Re: [GIT PULL] tracing: Fixes to bootconfig memory management

From: Linus Torvalds
Date: Tue Sep 14 2021 - 15:38:30 EST


On Tue, Sep 14, 2021 at 12:23 PM Linus Torvalds
<torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> Actually, never mind. I'll just do the automated replacement, it will
> fix that NULL pointer thing too.

Sadly, the automated replacement isn't quite as simple as the
sed-script I planned on using.

Because this:

sed -i \
's:memblock_free(__pa(\([^)]*\)),:memblock_free_sane(\1,:' \
$(git grep -wl memblock_free)

does actually mostly work, but because "__pa()" takes either a pointer
or a integer value, the end result is that sometimes we call
memblock_free_sane() with things that aren't pointers.

Very annoying. That "__pa()" macro has the two underscores for a
reason. It shouldn't be "use this thing willy nilly".

So I'll do a minimal conversion that adds "memblock_free_ptr()" and
hope that people start using that. And then we can later try to move
"memblock_free()" to a name that isn't so misleading.

Linus