]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
crypto: hisilicon - fix the format string type error
authorZhushuai Yin <yinzhushuai@huawei.com>
Mon, 30 Mar 2026 06:25:27 +0000 (14:25 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sun, 12 Apr 2026 08:46:28 +0000 (16:46 +0800)
1. The return value val of sec_debugfs_atomic64_get is of the
u64 type, but %lld instead of %llu is used in DEFINE_DEBUGFS_ATTRIBUTE.
Fix it.
2. In debugfs.c, since the types of q_depth and xeq_depth are u16,
the results of q_depth - 1 and xeq_depth - 1 are int rather than
u16. Use %d for int.

Signed-off-by: Zhushuai Yin <yinzhushuai@huawei.com>
Signed-off-by: Chenghai Huang <huangchenghai2@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/hisilicon/debugfs.c
drivers/crypto/hisilicon/sec2/sec_main.c

index 5d8b4112c54346420a5d26aeee0b8c822f0b8db8..e5878558dc64c343a625a60ec958f54c25f3ca9f 100644 (file)
@@ -305,7 +305,7 @@ static int q_dump_param_parse(struct hisi_qm *qm, char *s,
 
        ret = kstrtou32(presult, 0, e_id);
        if (ret || *e_id >= q_depth) {
-               dev_err(dev, "Please input sqe num (0-%u)", q_depth - 1);
+               dev_err(dev, "Please input sqe num (0-%d)", q_depth - 1);
                return -EINVAL;
        }
 
@@ -388,7 +388,7 @@ static int qm_eq_aeq_dump(struct hisi_qm *qm, char *s, char *name)
        }
 
        if (xeqe_id >= xeq_depth) {
-               dev_err(dev, "Please input eqe or aeqe num (0-%u)", xeq_depth - 1);
+               dev_err(dev, "Please input eqe or aeqe num (0-%d)", xeq_depth - 1);
                return -EINVAL;
        }
 
index 6647b7340827ef253d7d0998976452e4e3421149..056bd8f4da5a382edf1c4a34061877d2e6c05349 100644 (file)
@@ -909,7 +909,7 @@ static int sec_debugfs_atomic64_set(void *data, u64 val)
 }
 
 DEFINE_DEBUGFS_ATTRIBUTE(sec_atomic64_ops, sec_debugfs_atomic64_get,
-                        sec_debugfs_atomic64_set, "%lld\n");
+                        sec_debugfs_atomic64_set, "%llu\n");
 
 static int sec_regs_show(struct seq_file *s, void *unused)
 {