projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
788c2fd
)
watchdog: mei_wdt: don't use of variable length array
author
Tomas Winkler
<
[email protected]
>
Sun, 29 Oct 2017 07:51:19 +0000
(09:51 +0200)
committer
Wim Van Sebroeck
<
[email protected]
>
Thu, 28 Dec 2017 19:45:23 +0000
(20:45 +0100)
Fixes sparse warning:
drivers/watchdog/mei_wdt.c:530:18: warning: Variable length array is used
Signed-off-by: Tomas Winkler <
[email protected]
>
Reviewed-by: Alexander Usyskin <
[email protected]
>
Reviewed-by: Guenter Roeck <
[email protected]
>
Signed-off-by: Guenter Roeck <
[email protected]
>
Signed-off-by: Wim Van Sebroeck <
[email protected]
>
drivers/watchdog/mei_wdt.c
patch
|
blob
|
history
diff --git
a/drivers/watchdog/mei_wdt.c
b/drivers/watchdog/mei_wdt.c
index ea60b29494fb693bf7898e3f456b6ff8e9dfdb6f..b8194b02abe08eab14892a27ee02fbfb147356cd 100644
(file)
--- a/
drivers/watchdog/mei_wdt.c
+++ b/
drivers/watchdog/mei_wdt.c
@@
-526,12
+526,11
@@
static ssize_t mei_dbgfs_read_state(struct file *file, char __user *ubuf,
size_t cnt, loff_t *ppos)
{
struct mei_wdt *wdt = file->private_data;
- const size_t bufsz = 32;
- char buf[bufsz];
+ char buf[32];
ssize_t pos;
- pos = scnprintf(buf,
bufsz
, "state: %s\n",
-
mei_wdt_state_str(wdt->state));
+ pos = scnprintf(buf,
sizeof(buf)
, "state: %s\n",
+ mei_wdt_state_str(wdt->state));
return simple_read_from_buffer(ubuf, cnt, ppos, buf, pos);
}