]> git.baikalelectronics.ru Git - kernel.git/commit
um: random: Don't initialise hwrng struct with zero
authorChristopher Obbard <chris.obbard@collabora.com>
Thu, 23 Jun 2022 08:58:42 +0000 (09:58 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:23:53 +0000 (14:23 +0200)
commitbd53d374a6654e0223beea17cd195c807cf4af8c
tree79332b9c3d9bd522e1a0320d1229dcce7c3e8c70
parent1e23d3a3b920b6bf78d5eab95fc66ff2b63cbd64
um: random: Don't initialise hwrng struct with zero

[ Upstream commit 98d1035eecc6a98c1675698cf3f02ea6375688d0 ]

Initialising the hwrng struct with zeros causes a
compile-time sparse warning:

 $ ARCH=um make -j10 W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
 ...
 CHECK   arch/um/drivers/random.c
 arch/um/drivers/random.c:31:31: sparse: warning: Using plain integer as NULL pointer

Fix the warning by not initialising the hwrng struct
with zeros as it is initialised anyway during module
init.

Fixes: 1721e65d56ef ("um: random: Register random as hwrng-core device")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/um/drivers/random.c