Commit 16943a2f authored by Russell Currey's avatar Russell Currey Committed by Michael Ellerman

powerpc/secvar: Use sysfs_emit() instead of sprintf()

The secvar format string and object size sysfs files are both ASCII
text, and should use sysfs_emit().  No functional change.
Suggested-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarRussell Currey <ruscur@russell.cc>
Signed-off-by: default avatarAndrew Donnellan <ajd@linux.ibm.com>
Reviewed-by: default avatarStefan Berger <stefanb@linux.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20230210080401.345462-7-ajd@linux.ibm.com
parent 26149b02
......@@ -35,7 +35,7 @@ static ssize_t format_show(struct kobject *kobj, struct kobj_attribute *attr,
if (rc)
goto out;
rc = sprintf(buf, "%s\n", format);
rc = sysfs_emit(buf, "%s\n", format);
out:
of_node_put(node);
......@@ -57,7 +57,7 @@ static ssize_t size_show(struct kobject *kobj, struct kobj_attribute *attr,
return rc;
}
return sprintf(buf, "%llu\n", dsize);
return sysfs_emit(buf, "%llu\n", dsize);
}
static ssize_t data_read(struct file *filep, struct kobject *kobj,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment