Files
kernel_xiaomi_sm8250/include/linux
Richard Fitzgerald 7fb82d7854 random32: Fix implicit truncation warning in prandom_seed_state()
[ Upstream commit d327ea15a305024ef0085252fa3657bbb1ce25f5 ]

sparse generates the following warning:

 include/linux/prandom.h:114:45: sparse: sparse: cast truncates bits from
 constant value

This is because the 64-bit seed value is manipulated and then placed in a
u32, causing an implicit cast and truncation. A forced cast to u32 doesn't
prevent this warning, which is reasonable because a typecast doesn't prove
that truncation was expected.

Logical-AND the value with 0xffffffff to make explicit that truncation to
32-bit is intended.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20210525122012.6336-3-rf@opensource.cirrus.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-07-20 16:15:46 +02:00
..
2021-04-14 08:22:36 +02:00
2021-02-10 09:21:06 +01:00
2021-01-30 13:32:13 +01:00
2021-01-30 13:32:12 +01:00
2021-05-22 10:59:50 +02:00
2021-03-04 09:39:44 +01:00
2021-02-07 14:48:38 +01:00
2021-07-11 12:49:26 +02:00
2021-06-30 08:48:18 -04:00
2021-01-30 13:32:12 +01:00
2020-12-11 13:25:01 +01:00