summaryrefslogtreecommitdiff
path: root/drivers/mtd/sm_ftl.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/sm_ftl.c')
-rw-r--r--drivers/mtd/sm_ftl.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/mtd/sm_ftl.c b/drivers/mtd/sm_ftl.c
index abc7b186353f..5988cba30eb3 100644
--- a/drivers/mtd/sm_ftl.c
+++ b/drivers/mtd/sm_ftl.c
@@ -44,8 +44,7 @@ static ssize_t sm_attr_show(struct device *dev, struct device_attribute *attr,
struct sm_sysfs_attribute *sm_attr =
container_of(attr, struct sm_sysfs_attribute, dev_attr);
- strncpy(buf, sm_attr->data, sm_attr->len);
- return sm_attr->len;
+ return sysfs_emit(buf, "%.*s", sm_attr->len, sm_attr->data);
}
@@ -157,7 +156,7 @@ static int sm_read_lba(struct sm_oob *oob)
if (!memcmp(oob, erased_pattern, SM_OOB_SIZE))
return -1;
- /* Now check is both copies of the LBA differ too much */
+ /* Now check if both copies of the LBA differ too much */
lba_test = *(uint16_t *)oob->lba_copy1 ^ *(uint16_t*)oob->lba_copy2;
if (lba_test && !is_power_of_2(lba_test))
return -2;