Skip to content

Commit 9e70cbd

Browse files
obbardcrichardweinberger
authored andcommitted
um: random: Don't initialise hwrng struct with zero
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: 72d3e09 ("um: random: Register random as hwrng-core device") Reported-by: kernel test robot <[email protected]> Signed-off-by: Christopher Obbard <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
1 parent 53078ce commit 9e70cbd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/um/drivers/random.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
* protects against a module being loaded twice at the same time.
2929
*/
3030
static int random_fd = -1;
31-
static struct hwrng hwrng = { 0, };
31+
static struct hwrng hwrng;
3232
static DECLARE_COMPLETION(have_data);
3333

3434
static int rng_dev_read(struct hwrng *rng, void *buf, size_t max, bool block)

0 commit comments

Comments
 (0)