Skip to content

Commit

Permalink
iio: trigger: stm32-timer: Convert sysfs sprintf/snprintf family to s…
Browse files Browse the repository at this point in the history
…ysfs_emit

Fix the following coccicheck warning:
drivers/iio/trigger/stm32-timer-trigger.c:299:8-16: WARNING:
use scnprintf or sprintf

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Link: https://lore.kernel.org/r/1618216751-1678-4-git-send-email-tiantao6@hisilicon.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
  • Loading branch information
Tian Tao authored and Jonathan Cameron committed May 17, 2021
1 parent c79859b commit 8bad605
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/iio/trigger/stm32-timer-trigger.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ static ssize_t stm32_tt_show_master_mode(struct device *dev,
else
cr2 = (cr2 & TIM_CR2_MMS) >> TIM_CR2_MMS_SHIFT;

return snprintf(buf, PAGE_SIZE, "%s\n", master_mode_table[cr2]);
return sysfs_emit(buf, "%s\n", master_mode_table[cr2]);
}

static ssize_t stm32_tt_store_master_mode(struct device *dev,
Expand Down

0 comments on commit 8bad605

Please sign in to comment.