mirror of
https://github.com/torvalds/linux.git
synced 2026-05-26 16:12:59 +02:00
s390/dcssblk: 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 block/dcssblk 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
2c798d583d
commit
9d20d35072
|
|
@ -339,7 +339,7 @@ dcssblk_shared_show(struct device *dev, struct device_attribute *attr, char *buf
|
|||
struct dcssblk_dev_info *dev_info;
|
||||
|
||||
dev_info = container_of(dev, struct dcssblk_dev_info, dev);
|
||||
return sprintf(buf, dev_info->is_shared ? "1\n" : "0\n");
|
||||
return sysfs_emit(buf, dev_info->is_shared ? "1\n" : "0\n");
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
|
|
@ -444,7 +444,7 @@ dcssblk_save_show(struct device *dev, struct device_attribute *attr, char *buf)
|
|||
struct dcssblk_dev_info *dev_info;
|
||||
|
||||
dev_info = container_of(dev, struct dcssblk_dev_info, dev);
|
||||
return sprintf(buf, dev_info->save_pending ? "1\n" : "0\n");
|
||||
return sysfs_emit(buf, dev_info->save_pending ? "1\n" : "0\n");
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
|
|
@ -506,21 +506,15 @@ static ssize_t
|
|||
dcssblk_seglist_show(struct device *dev, struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
int i;
|
||||
|
||||
struct dcssblk_dev_info *dev_info;
|
||||
struct segment_info *entry;
|
||||
int i;
|
||||
|
||||
i = 0;
|
||||
down_read(&dcssblk_devices_sem);
|
||||
dev_info = container_of(dev, struct dcssblk_dev_info, dev);
|
||||
i = 0;
|
||||
buf[0] = '\0';
|
||||
list_for_each_entry(entry, &dev_info->seg_list, lh) {
|
||||
strcpy(&buf[i], entry->segment_name);
|
||||
i += strlen(entry->segment_name);
|
||||
buf[i] = '\n';
|
||||
i++;
|
||||
}
|
||||
list_for_each_entry(entry, &dev_info->seg_list, lh)
|
||||
i += sysfs_emit_at(buf, i, "%s\n", entry->segment_name);
|
||||
up_read(&dcssblk_devices_sem);
|
||||
return i;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user