arch/um/drivers/random.c:31:31: sparse: sparse: Using plain integer as NULL pointer

From: kernel test robot
Date: Sat Mar 27 2021 - 09:39:19 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 0f4498cef9f5cd18d7c6639a2a902ec1edc5be4e
commit: 72d3e093afae79611fa38f8f2cfab9a888fe66f2 um: random: Register random as hwrng-core device
date: 3 months ago
config: um-randconfig-s031-20210327 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-277-gc089cd2d-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=72d3e093afae79611fa38f8f2cfab9a888fe66f2
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 72d3e093afae79611fa38f8f2cfab9a888fe66f2
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=um

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>


sparse warnings: (new ones prefixed by >>)
>> arch/um/drivers/random.c:31:31: sparse: sparse: Using plain integer as NULL pointer

vim +31 arch/um/drivers/random.c

25
26 /* Changed at init time, in the non-modular case, and at module load
27 * time, in the module case. Presumably, the module subsystem
28 * protects against a module being loaded twice at the same time.
29 */
30 static int random_fd = -1;
> 31 static struct hwrng hwrng = { 0, };
32 static DECLARE_COMPLETION(have_data);
33

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip