]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
s390/sclp_cpi: Switch over to sysfs_emit()
authorMete Durlu <meted@linux.ibm.com>
Wed, 23 Oct 2024 12:11:12 +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_cpi_sys 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_cpi_sys.c

index f60d7ea8268d106ecd2dd4aeb719b0888dd4467f..d8f91aab11e8305ab3079b29c3087a74b905573c 100644 (file)
@@ -223,7 +223,7 @@ static ssize_t system_name_show(struct kobject *kobj,
        int rc;
 
        mutex_lock(&sclp_cpi_mutex);
-       rc = snprintf(page, PAGE_SIZE, "%s\n", system_name);
+       rc = sysfs_emit(page, "%s\n", system_name);
        mutex_unlock(&sclp_cpi_mutex);
        return rc;
 }
@@ -255,7 +255,7 @@ static ssize_t sysplex_name_show(struct kobject *kobj,
        int rc;
 
        mutex_lock(&sclp_cpi_mutex);
-       rc = snprintf(page, PAGE_SIZE, "%s\n", sysplex_name);
+       rc = sysfs_emit(page, "%s\n", sysplex_name);
        mutex_unlock(&sclp_cpi_mutex);
        return rc;
 }
@@ -287,7 +287,7 @@ static ssize_t system_type_show(struct kobject *kobj,
        int rc;
 
        mutex_lock(&sclp_cpi_mutex);
-       rc = snprintf(page, PAGE_SIZE, "%s\n", system_type);
+       rc = sysfs_emit(page, "%s\n", system_type);
        mutex_unlock(&sclp_cpi_mutex);
        return rc;
 }
@@ -321,7 +321,7 @@ static ssize_t system_level_show(struct kobject *kobj,
        mutex_lock(&sclp_cpi_mutex);
        level = system_level;
        mutex_unlock(&sclp_cpi_mutex);
-       return snprintf(page, PAGE_SIZE, "%#018llx\n", level);
+       return sysfs_emit(page, "%#018llx\n", level);
 }
 
 static ssize_t system_level_store(struct kobject *kobj,