Re: [PATCH v6 5/7] watchdog: Add Nuvoton NCT6694 WDT support

Vincent Mailhol
2025-01-26T10:13:50Z

On 23/01/2025 at 18:11, Ming Yu wrote:
> This driver supports Watchdog timer functionality for NCT6694 MFD
> device based on USB interface.
>
> Signed-off-by: Ming Yu <a0282524688@gmail.com>
> ---

(...)

> +static int nct6694_wdt_set_timeout(struct watchdog_device *wdev,
> + unsigned int timeout)
> +{
> + int ret;
> +
> + ret = nct6694_wdt_setting(wdev, timeout, NCT6694_ACTION_GPO,
> + wdev->pretimeout, NCT6694_ACTION_GPO);
> + if (ret)
> + return ret;
> +
> + wdev->timeout = timeout;
> +
> + return 0;
> +}

Not critical but I would rather like you to fix this shadow warning:

drivers/watchdog/nct6694_wdt.c: In function 'nct6694_wdt_set_timeout':
drivers/watchdog/nct6694_wdt.c:168:49: warning: declaration of
'timeout' shadows a global declaration [-Wshadow]
168 | unsigned int timeout)
| ~~~~~~~~~~~~~^~~~~~~
drivers/watchdog/nct6694_wdt.c:36:21: note: shadowed declaration is here
36 | static unsigned int timeout = NCT6694_DEFAULT_TIMEOUT;
| ^~~~~~~

> +static int nct6694_wdt_set_pretimeout(struct watchdog_device *wdev,
> + unsigned int pretimeout)
> +{
> + int ret;
> +
> + ret = nct6694_wdt_setting(wdev, wdev->timeout, NCT6694_ACTION_GPO,
> + pretimeout, NCT6694_ACTION_GPO);
> + if (ret)
> + return ret;
> +
> + wdev->pretimeout = pretimeout;
> +
> + return 0;
> +}

Idem:

drivers/watchdog/nct6694_wdt.c: In function 'nct6694_wdt_set_pretimeout':
drivers/watchdog/nct6694_wdt.c:183:52: warning: declaration of
'pretimeout' shadows a global declaration [-Wshadow]
183 | unsigned int pretimeout)
| ~~~~~~~~~~~~~^~~~~~~~~~
drivers/watchdog/nct6694_wdt.c:40:21: note: shadowed declaration is here
40 | static unsigned int pretimeout = NCT6694_DEFAULT_PRETIMEOUT;
| ^~~~~~~~~~

(...)

Yours sincerely,
Vincent Mailhol