Files
twx-linux/include/linux
Richard Fitzgerald b6c469a850 random32: Fix implicit truncation warning in prandom_seed_state()
[ Upstream commit d327ea15a3 ]

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-14 16:53:17 +02:00
..
2021-01-23 15:57:55 +01:00
2021-01-30 13:54:11 +01:00
2021-01-06 14:48:35 +01:00
2021-05-19 10:08:30 +02:00
2021-03-04 10:26:29 +01:00
2021-02-07 15:35:49 +01:00
2021-06-30 08:47:51 -04:00
2021-03-07 12:20:49 +01:00
2020-12-11 13:23:28 +01:00
2021-06-10 13:37:14 +02:00