Home
last modified time | relevance | path

Searched hist:"0 a0a542f6bbb2ebe956f0117c842302442ef52da" (Results 1 – 1 of 1) sorted by relevance

/openbmc/linux/drivers/watchdog/
H A Dgpio_wdt.cdiff 0a0a542f6bbb2ebe956f0117c842302442ef52da Thu Jul 30 04:32:23 CDT 2015 Uwe Kleine-König <u.kleine-koenig@pengutronix.de> watchdog: gpio-wdt: be more strict about hw_algo matching

strncmp(algo, "toggle", 6) doesn't compare the trailing '\0' byte, so
using

hw_algo = "toggleboggle"

is recognized the same way as

hw_algo = "toggle"

. While this doesn't introduce any problems for a device tree that
sticks to the documented settings it's still ugly.

Fix this by using strcmp to only match on "toggle" and "level".

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>