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

Signed-off-by: Mete Durlu <meted@linux.ibm.com>
Acked-by: Vineeth Vijayan <vneethv@linux.ibm.com>
Tested-by: Vineeth Vijayan <vneethv@linux.ibm.com>
Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
drivers/s390/cio/css.c

index 7b59d20bf7850e5c1f11bd2227496a55b04e6cf5..be78a57f9bfdef28a6e85545e0846f8a9bf916e2 100644 (file)
@@ -380,11 +380,11 @@ static ssize_t chpids_show(struct device *dev,
        for (chp = 0; chp < 8; chp++) {
                mask = 0x80 >> chp;
                if (ssd->path_mask & mask)
-                       ret += sprintf(buf + ret, "%02x ", ssd->chpid[chp].id);
+                       ret += sysfs_emit_at(buf, ret, "%02x ", ssd->chpid[chp].id);
                else
-                       ret += sprintf(buf + ret, "00 ");
+                       ret += sysfs_emit_at(buf, ret, "00 ");
        }
-       ret += sprintf(buf + ret, "\n");
+       ret += sysfs_emit_at(buf, ret, "\n");
        return ret;
 }
 static DEVICE_ATTR_RO(chpids);