Skip to content

Commit edfc7e7

Browse files
ye xingchenherbertx
authored andcommitted
crypto: marvell/octeontx - use sysfs_emit() to instead of scnprintf()
Replace the open-code with sysfs_emit() to simplify the code. Signed-off-by: ye xingchen <[email protected]> Reviewed-by: Kees Cook <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent b006c43 commit edfc7e7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/crypto/marvell/octeontx/otx_cptvf_main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ static ssize_t vf_type_show(struct device *dev,
661661
msg = "Invalid";
662662
}
663663

664-
return scnprintf(buf, PAGE_SIZE, "%s\n", msg);
664+
return sysfs_emit(buf, "%s\n", msg);
665665
}
666666

667667
static ssize_t vf_engine_group_show(struct device *dev,
@@ -670,7 +670,7 @@ static ssize_t vf_engine_group_show(struct device *dev,
670670
{
671671
struct otx_cptvf *cptvf = dev_get_drvdata(dev);
672672

673-
return scnprintf(buf, PAGE_SIZE, "%d\n", cptvf->vfgrp);
673+
return sysfs_emit(buf, "%d\n", cptvf->vfgrp);
674674
}
675675

676676
static ssize_t vf_engine_group_store(struct device *dev,
@@ -706,7 +706,7 @@ static ssize_t vf_coalesc_time_wait_show(struct device *dev,
706706
{
707707
struct otx_cptvf *cptvf = dev_get_drvdata(dev);
708708

709-
return scnprintf(buf, PAGE_SIZE, "%d\n",
709+
return sysfs_emit(buf, "%d\n",
710710
cptvf_read_vq_done_timewait(cptvf));
711711
}
712712

@@ -716,7 +716,7 @@ static ssize_t vf_coalesc_num_wait_show(struct device *dev,
716716
{
717717
struct otx_cptvf *cptvf = dev_get_drvdata(dev);
718718

719-
return scnprintf(buf, PAGE_SIZE, "%d\n",
719+
return sysfs_emit(buf, "%d\n",
720720
cptvf_read_vq_done_numwait(cptvf));
721721
}
722722

0 commit comments

Comments
 (0)