Re: [PATCH -tip] cleanup: Remove address space of returned pointer

From: Peter Zijlstra
Date: Fri Oct 18 2024 - 07:23:11 EST


On Mon, Aug 19, 2024 at 09:41:15AM +0200, Uros Bizjak wrote:
> Guard functions in local_lock.h are defined using DEFINE_GUARD() and
> DEFINE_LOCK_GUARD_1() macros having lock type defined as pointer in
> the percpu address space. The functions, defined by these macros
> return value in generic address space, causing:
>
> cleanup.h:157:18: error: return from pointer to non-enclosed address space
>
> and
>
> cleanup.h:214:18: error: return from pointer to non-enclosed address space
>
> when strict percpu checks are enabled.
>
> Add explicit casts to remove address space of the returned pointer.
>
> Found by GCC's named address space checks.
>
> Fixes: e4ab322fbaaa ("cleanup: Add conditional guard support")
> Signed-off-by: Uros Bizjak <ubizjak@xxxxxxxxx>

Thanks!

Now lives in queue locking/core, and barring robot screams will make its
way into tip.