mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-10-22 23:13:01 +02:00
s390/nospec: Switch over to sysfs_emit()
Per Documentation/filesystems/sysfs.rst, sysfs_emit() is preferred over sprintf for presenting attributes to user space. Convert the left-over uses in the s390/nospec-sysfs code. Signed-off-by: Mete Durlu <meted@linux.ibm.com> Reviewed-by: Gerd Bayer <gbayer@linux.ibm.com> Reviewed-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
This commit is contained in:
parent
d151f8f788
commit
c50262498d
|
@ -7,17 +7,17 @@
|
||||||
ssize_t cpu_show_spectre_v1(struct device *dev,
|
ssize_t cpu_show_spectre_v1(struct device *dev,
|
||||||
struct device_attribute *attr, char *buf)
|
struct device_attribute *attr, char *buf)
|
||||||
{
|
{
|
||||||
return sprintf(buf, "Mitigation: __user pointer sanitization\n");
|
return sysfs_emit(buf, "Mitigation: __user pointer sanitization\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
ssize_t cpu_show_spectre_v2(struct device *dev,
|
ssize_t cpu_show_spectre_v2(struct device *dev,
|
||||||
struct device_attribute *attr, char *buf)
|
struct device_attribute *attr, char *buf)
|
||||||
{
|
{
|
||||||
if (test_facility(156))
|
if (test_facility(156))
|
||||||
return sprintf(buf, "Mitigation: etokens\n");
|
return sysfs_emit(buf, "Mitigation: etokens\n");
|
||||||
if (nospec_uses_trampoline())
|
if (nospec_uses_trampoline())
|
||||||
return sprintf(buf, "Mitigation: execute trampolines\n");
|
return sysfs_emit(buf, "Mitigation: execute trampolines\n");
|
||||||
if (nobp_enabled())
|
if (nobp_enabled())
|
||||||
return sprintf(buf, "Mitigation: limited branch prediction\n");
|
return sysfs_emit(buf, "Mitigation: limited branch prediction\n");
|
||||||
return sprintf(buf, "Vulnerable\n");
|
return sysfs_emit(buf, "Vulnerable\n");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user