]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
crypto: hisilicon/trng - modifying the order of header files
authorChenghai Huang <huangchenghai2@huawei.com>
Sat, 31 Aug 2024 09:50:09 +0000 (17:50 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 6 Sep 2024 06:50:46 +0000 (14:50 +0800)
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 <huangchenghai2@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/hisilicon/trng/trng.c

index 451b167bcc73dcd3d70bb4c04a266fa3b5b07c07..66c551ecdee80f0ca825d3e58dc4c7a36f212275 100644 (file)
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0
 /* Copyright (c) 2019 HiSilicon Limited. */
 
+#include <crypto/internal/rng.h>
 #include <linux/acpi.h>
 #include <linux/crypto.h>
 #include <linux/err.h>
@@ -13,7 +14,6 @@
 #include <linux/mutex.h>
 #include <linux/platform_device.h>
 #include <linux/random.h>
-#include <crypto/internal/rng.h>
 
 #define HISI_TRNG_REG          0x00F0
 #define HISI_TRNG_BYTES                4
@@ -121,7 +121,7 @@ static int hisi_trng_generate(struct crypto_rng *tfm, const u8 *src,
        u32 i;
 
        if (dlen > SW_DRBG_BLOCKS_NUM * SW_DRBG_BYTES || dlen == 0) {
-               pr_err("dlen(%d) exceeds limit(%d)!\n", dlen,
+               pr_err("dlen(%u) exceeds limit(%d)!\n", dlen,
                        SW_DRBG_BLOCKS_NUM * SW_DRBG_BYTES);
                return -EINVAL;
        }