[PATCHv2 01/18] asm-generic: make __set_fixmap_offset a static inline

Will Deacon will.deacon at arm.com
Thu Jan 28 07:10:05 PST 2016


On Mon, Jan 04, 2016 at 05:56:34PM +0000, Mark Rutland wrote:
> Currently __set_fixmap_offset is a macro function which has a local
> variable called 'addr'. If a caller passes a 'phys' parameter which is
> derived from a variable also called 'addr', the local variable will
> shadow this, and the compiler will complain about the use of an
> uninitialized variable.
> 
> It is likely that fixmap users may use the name 'addr' for variables
> that may be directly passed to __set_fixmap_offset, or that may be
> indirectly generated via other macros. Rather than placing the burden on
> callers to avoid the name 'addr', this patch changes __set_fixmap_offset
> into a static inline function, avoiding namespace collisions.
> 
> Signed-off-by: Mark Rutland <mark.rutland at arm.com>
> Cc: Ard Biesheuvel <ard.biesheuvel at linaro.org>
> Cc: Arnd Bergmann <arnd at arndb.de>
> Cc: Catalin Marinas <catalin.marinas at arm.com>
> Cc: Jeremy Linton <jeremy.linton at arm.com>
> Cc: Laura Abbott <labbott at fedoraproject.org>
> Cc: Will Deacon <will.deacon at arm.com>
> ---
>  include/asm-generic/fixmap.h | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)

Acked-by: Will Deacon <will.deacon at arm.com>

Catalin can pick this up for 4.6 along with Arnd's ack.

Will



More information about the linux-arm-kernel mailing list