]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
s390/sclp_ocf: Switch over to sysfs_emit()
authorMete Durlu <meted@linux.ibm.com>
Wed, 23 Oct 2024 12:11:11 +0000 (14:11 +0200)
committerHeiko Carstens <hca@linux.ibm.com>
Fri, 25 Oct 2024 14:03:26 +0000 (16:03 +0200)
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>
drivers/s390/char/sclp_ocf.c

index d35f10ea5b5218c2cd160bfa7fe689c1f7699517..ca6c5260dc53c8490c3361cd1fa2a4787dac3c61 100644 (file)
@@ -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;
 }