summaryrefslogtreecommitdiff
path: root/drivers/watchdog/aspeed_wdt.c
diff options
context:
space:
mode:
authorJuerg Haefliger <juerg.haefliger@canonical.com>2021-05-11 08:18:12 +0200
committerWim Van Sebroeck <wim@linux-watchdog.org>2021-06-21 08:49:03 +0200
commit3bb21781d13516baf14dc051dbe2b3145c704cda (patch)
tree60a0b0c558688435c85d38bd5f6ae04e9fb34c0c /drivers/watchdog/aspeed_wdt.c
parentd0212f095ab56672f6f36aabc605bda205e1e0bf (diff)
watchdog: Use sysfs_emit() and sysfs_emit_at() in "show" functions
Convert sprintf() in sysfs "show" functions to sysfs_emit() and sysfs_emit_at() in order to check for buffer overruns in sysfs outputs. Signed-off-by: Juerg Haefliger <juergh@canonical.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20210511061812.480172-1-juergh@canonical.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
Diffstat (limited to 'drivers/watchdog/aspeed_wdt.c')
-rw-r--r--drivers/watchdog/aspeed_wdt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/watchdog/aspeed_wdt.c b/drivers/watchdog/aspeed_wdt.c
index 7e00960651fa..933998e5a9de 100644
--- a/drivers/watchdog/aspeed_wdt.c
+++ b/drivers/watchdog/aspeed_wdt.c
@@ -175,8 +175,8 @@ static ssize_t access_cs0_show(struct device *dev,
struct aspeed_wdt *wdt = dev_get_drvdata(dev);
u32 status = readl(wdt->base + WDT_TIMEOUT_STATUS);
- return sprintf(buf, "%u\n",
- !(status & WDT_TIMEOUT_STATUS_BOOT_SECONDARY));
+ return sysfs_emit(buf, "%u\n",
+ !(status & WDT_TIMEOUT_STATUS_BOOT_SECONDARY));
}
static ssize_t access_cs0_store(struct device *dev,