OSDN Git Service

asm-generic: Fix local variable shadow in __set_fixmap_offset
authorMark Rutland <mark.rutland@arm.com>
Mon, 25 Jan 2016 11:44:55 +0000 (11:44 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Apr 2019 04:23:23 +0000 (06:23 +0200)
commit021c0d5cdfc0e228963ade79c18015ce7cc181bb
tree5d3cc3aabce5aec831386b0ddec993b29b25f66c
parent43ea28e71c2d54cd40eeb97fcdf71da38f84c963
asm-generic: Fix local variable shadow in __set_fixmap_offset

[ Upstream commit 3694bd76781b76c4f8d2ecd85018feeb1609f0e5 ]

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. To avoid the issue with namespace clashes,
'addr' is prefixed with a liberal sprinkling of underscores.

Turning __set_fixmap_offset into a static inline breaks the build for
several architectures. Fixing this properly requires updates to a number
of architectures to make them agree on the prototype of __set_fixmap (it
could be done as a subsequent patch series).

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Arnd Bergmann <arnd@arndb.de>
[catalin.marinas@arm.com: squashed the original function patch and macro fixup]
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/asm-generic/fixmap.h