Skip to content

Commit c205218

Browse files
Xuezhi Zhangdavem330
authored andcommitted
s390/qeth: convert sysfs snprintf to sysfs_emit
Follow the advice of the Documentation/filesystems/sysfs.rst and show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. Signed-off-by: Xuezhi Zhang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 0e3d183 commit c205218

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/s390/net/qeth_core_sys.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -410,13 +410,13 @@ static ssize_t qeth_dev_isolation_show(struct device *dev,
410410

411411
switch (card->options.isolation) {
412412
case ISOLATION_MODE_NONE:
413-
return snprintf(buf, 6, "%s\n", ATTR_QETH_ISOLATION_NONE);
413+
return sysfs_emit(buf, "%s\n", ATTR_QETH_ISOLATION_NONE);
414414
case ISOLATION_MODE_FWD:
415-
return snprintf(buf, 9, "%s\n", ATTR_QETH_ISOLATION_FWD);
415+
return sysfs_emit(buf, "%s\n", ATTR_QETH_ISOLATION_FWD);
416416
case ISOLATION_MODE_DROP:
417-
return snprintf(buf, 6, "%s\n", ATTR_QETH_ISOLATION_DROP);
417+
return sysfs_emit(buf, "%s\n", ATTR_QETH_ISOLATION_DROP);
418418
default:
419-
return snprintf(buf, 5, "%s\n", "N/A");
419+
return sysfs_emit(buf, "%s\n", "N/A");
420420
}
421421
}
422422

@@ -500,9 +500,9 @@ static ssize_t qeth_hw_trap_show(struct device *dev,
500500
struct qeth_card *card = dev_get_drvdata(dev);
501501

502502
if (card->info.hwtrap)
503-
return snprintf(buf, 5, "arm\n");
503+
return sysfs_emit(buf, "arm\n");
504504
else
505-
return snprintf(buf, 8, "disarm\n");
505+
return sysfs_emit(buf, "disarm\n");
506506
}
507507

508508
static ssize_t qeth_hw_trap_store(struct device *dev,

0 commit comments

Comments
 (0)