Skip to content

Commit f5dd7c4

Browse files
Chenghai Huangherbertx
authored andcommitted
crypto: hisilicon/trng - modifying the order of header files
Header files is included Order-ref: standard library headers, OS library headers, and project-specific headers. This patch modifies the order of header files according to suggestions. In addition, use %u to print unsigned int variables to prevent overflow. Signed-off-by: Chenghai Huang <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 5fdb4b3 commit f5dd7c4

File tree

1 file changed

+2
-2
lines changed
  • drivers/crypto/hisilicon/trng

1 file changed

+2
-2
lines changed

drivers/crypto/hisilicon/trng/trng.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// SPDX-License-Identifier: GPL-2.0
22
/* Copyright (c) 2019 HiSilicon Limited. */
33

4+
#include <crypto/internal/rng.h>
45
#include <linux/acpi.h>
56
#include <linux/crypto.h>
67
#include <linux/err.h>
@@ -13,7 +14,6 @@
1314
#include <linux/mutex.h>
1415
#include <linux/platform_device.h>
1516
#include <linux/random.h>
16-
#include <crypto/internal/rng.h>
1717

1818
#define HISI_TRNG_REG 0x00F0
1919
#define HISI_TRNG_BYTES 4
@@ -121,7 +121,7 @@ static int hisi_trng_generate(struct crypto_rng *tfm, const u8 *src,
121121
u32 i;
122122

123123
if (dlen > SW_DRBG_BLOCKS_NUM * SW_DRBG_BYTES || dlen == 0) {
124-
pr_err("dlen(%d) exceeds limit(%d)!\n", dlen,
124+
pr_err("dlen(%u) exceeds limit(%d)!\n", dlen,
125125
SW_DRBG_BLOCKS_NUM * SW_DRBG_BYTES);
126126
return -EINVAL;
127127
}

0 commit comments

Comments
 (0)