mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-15 13:15:57 +00:00
s390/sclp_ocf: Switch over to sysfs_emit()
Per Documentation/filesystems/sysfs.rst, sysfs_emit() is preferred for presenting attributes to user space in sysfs. Convert the left-over uses in the char/sclp_ocf code. Signed-off-by: Mete Durlu <meted@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
182d54671c
commit
92a201b764
@ -101,7 +101,7 @@ static ssize_t cpc_name_show(struct kobject *kobj,
|
||||
sclp_ocf_cpc_name_copy(name);
|
||||
name[OCF_LENGTH_CPC_NAME] = 0;
|
||||
EBCASC(name, OCF_LENGTH_CPC_NAME);
|
||||
return snprintf(page, PAGE_SIZE, "%s\n", name);
|
||||
return sysfs_emit(page, "%s\n", name);
|
||||
}
|
||||
|
||||
static struct kobj_attribute cpc_name_attr =
|
||||
@ -113,7 +113,7 @@ static ssize_t hmc_network_show(struct kobject *kobj,
|
||||
int rc;
|
||||
|
||||
spin_lock_irq(&sclp_ocf_lock);
|
||||
rc = snprintf(page, PAGE_SIZE, "%s\n", hmc_network);
|
||||
rc = sysfs_emit(page, "%s\n", hmc_network);
|
||||
spin_unlock_irq(&sclp_ocf_lock);
|
||||
return rc;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user