Skip to content

Commit f94f6cf

Browse files
Zhushuai Yinherbertx
authored andcommitted
crypto: hisilicon - fix the format string type error
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>
1 parent 02c6405 commit f94f6cf

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/crypto/hisilicon/debugfs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ static int q_dump_param_parse(struct hisi_qm *qm, char *s,
305305

306306
ret = kstrtou32(presult, 0, e_id);
307307
if (ret || *e_id >= q_depth) {
308-
dev_err(dev, "Please input sqe num (0-%u)", q_depth - 1);
308+
dev_err(dev, "Please input sqe num (0-%d)", q_depth - 1);
309309
return -EINVAL;
310310
}
311311

@@ -388,7 +388,7 @@ static int qm_eq_aeq_dump(struct hisi_qm *qm, char *s, char *name)
388388
}
389389

390390
if (xeqe_id >= xeq_depth) {
391-
dev_err(dev, "Please input eqe or aeqe num (0-%u)", xeq_depth - 1);
391+
dev_err(dev, "Please input eqe or aeqe num (0-%d)", xeq_depth - 1);
392392
return -EINVAL;
393393
}
394394

drivers/crypto/hisilicon/sec2/sec_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,7 @@ static int sec_debugfs_atomic64_set(void *data, u64 val)
909909
}
910910

911911
DEFINE_DEBUGFS_ATTRIBUTE(sec_atomic64_ops, sec_debugfs_atomic64_get,
912-
sec_debugfs_atomic64_set, "%lld\n");
912+
sec_debugfs_atomic64_set, "%llu\n");
913913

914914
static int sec_regs_show(struct seq_file *s, void *unused)
915915
{

0 commit comments

Comments
 (0)