* [PATCH] watchdog/hpwdt: Assign boolean values to a bool variable
@ 2021-01-20 7:48 Jiapeng Zhong
2021-01-20 17:52 ` Jerry Hoemann
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Jiapeng Zhong @ 2021-01-20 7:48 UTC (permalink / raw)
To: jerry.hoemann; +Cc: wim, linux, linux-watchdog, linux-kernel, Jiapeng Zhong
Fix the following coccicheck warnings:
./drivers/watchdog/hpwdt.c:345:2-12: WARNING: Assignment of
0/1 to bool variable.
./drivers/watchdog/hpwdt.c:126:2-12: WARNING: Assignment of
0/1 to bool variable.
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Zhong <abaci-bugfix@linux.alibaba.com>
---
drivers/watchdog/hpwdt.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c
index cbd1498..22ddba3 100644
--- a/drivers/watchdog/hpwdt.c
+++ b/drivers/watchdog/hpwdt.c
@@ -123,7 +123,7 @@ static int hpwdt_settimeout(struct watchdog_device *wdd, unsigned int val)
if (val <= wdd->pretimeout) {
dev_dbg(wdd->parent, "pretimeout < timeout. Setting to zero\n");
wdd->pretimeout = 0;
- pretimeout = 0;
+ pretimeout = false;
if (watchdog_active(wdd))
hpwdt_start(wdd);
}
@@ -336,13 +336,13 @@ static int hpwdt_init_one(struct pci_dev *dev,
watchdog_init_timeout(&hpwdt_dev, soft_margin, NULL);
if (is_kdump_kernel()) {
- pretimeout = 0;
+ pretimeout = false;
kdumptimeout = 0;
}
if (pretimeout && hpwdt_dev.timeout <= PRETIMEOUT_SEC) {
dev_warn(&dev->dev, "timeout <= pretimeout. Setting pretimeout to zero\n");
- pretimeout = 0;
+ pretimeout = false;
}
hpwdt_dev.pretimeout = pretimeout ? PRETIMEOUT_SEC : 0;
kdumptimeout = min(kdumptimeout, HPWDT_MAX_TIMER);
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] watchdog/hpwdt: Assign boolean values to a bool variable
2021-01-20 7:48 [PATCH] watchdog/hpwdt: Assign boolean values to a bool variable Jiapeng Zhong
@ 2021-01-20 17:52 ` Jerry Hoemann
2021-01-20 19:05 ` Guenter Roeck
2021-01-23 17:19 ` Guenter Roeck
2 siblings, 0 replies; 4+ messages in thread
From: Jerry Hoemann @ 2021-01-20 17:52 UTC (permalink / raw)
To: Jiapeng Zhong; +Cc: wim, linux, linux-watchdog, linux-kernel
On Wed, Jan 20, 2021 at 03:48:10PM +0800, Jiapeng Zhong wrote:
> Fix the following coccicheck warnings:
>
> ./drivers/watchdog/hpwdt.c:345:2-12: WARNING: Assignment of
> 0/1 to bool variable.
>
> ./drivers/watchdog/hpwdt.c:126:2-12: WARNING: Assignment of
> 0/1 to bool variable.
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Zhong <abaci-bugfix@linux.alibaba.com>
> ---
> drivers/watchdog/hpwdt.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
Reviewed-by: Jerry Hoemann <jerry.hoemann@hpe.com>
>
> diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c
> index cbd1498..22ddba3 100644
> --- a/drivers/watchdog/hpwdt.c
> +++ b/drivers/watchdog/hpwdt.c
> @@ -123,7 +123,7 @@ static int hpwdt_settimeout(struct watchdog_device *wdd, unsigned int val)
> if (val <= wdd->pretimeout) {
> dev_dbg(wdd->parent, "pretimeout < timeout. Setting to zero\n");
> wdd->pretimeout = 0;
> - pretimeout = 0;
> + pretimeout = false;
> if (watchdog_active(wdd))
> hpwdt_start(wdd);
> }
> @@ -336,13 +336,13 @@ static int hpwdt_init_one(struct pci_dev *dev,
> watchdog_init_timeout(&hpwdt_dev, soft_margin, NULL);
>
> if (is_kdump_kernel()) {
> - pretimeout = 0;
> + pretimeout = false;
> kdumptimeout = 0;
> }
>
> if (pretimeout && hpwdt_dev.timeout <= PRETIMEOUT_SEC) {
> dev_warn(&dev->dev, "timeout <= pretimeout. Setting pretimeout to zero\n");
> - pretimeout = 0;
> + pretimeout = false;
> }
> hpwdt_dev.pretimeout = pretimeout ? PRETIMEOUT_SEC : 0;
> kdumptimeout = min(kdumptimeout, HPWDT_MAX_TIMER);
> --
> 1.8.3.1
--
-----------------------------------------------------------------------------
Jerry Hoemann Software Engineer Hewlett Packard Enterprise
-----------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] watchdog/hpwdt: Assign boolean values to a bool variable
2021-01-20 7:48 [PATCH] watchdog/hpwdt: Assign boolean values to a bool variable Jiapeng Zhong
2021-01-20 17:52 ` Jerry Hoemann
@ 2021-01-20 19:05 ` Guenter Roeck
2021-01-23 17:19 ` Guenter Roeck
2 siblings, 0 replies; 4+ messages in thread
From: Guenter Roeck @ 2021-01-20 19:05 UTC (permalink / raw)
To: Jiapeng Zhong; +Cc: jerry.hoemann, wim, linux-watchdog, linux-kernel
On Wed, Jan 20, 2021 at 03:48:10PM +0800, Jiapeng Zhong wrote:
> Fix the following coccicheck warnings:
>
> ./drivers/watchdog/hpwdt.c:345:2-12: WARNING: Assignment of
> 0/1 to bool variable.
>
> ./drivers/watchdog/hpwdt.c:126:2-12: WARNING: Assignment of
> 0/1 to bool variable.
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Zhong <abaci-bugfix@linux.alibaba.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> ---
> drivers/watchdog/hpwdt.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c
> index cbd1498..22ddba3 100644
> --- a/drivers/watchdog/hpwdt.c
> +++ b/drivers/watchdog/hpwdt.c
> @@ -123,7 +123,7 @@ static int hpwdt_settimeout(struct watchdog_device *wdd, unsigned int val)
> if (val <= wdd->pretimeout) {
> dev_dbg(wdd->parent, "pretimeout < timeout. Setting to zero\n");
> wdd->pretimeout = 0;
> - pretimeout = 0;
> + pretimeout = false;
> if (watchdog_active(wdd))
> hpwdt_start(wdd);
> }
> @@ -336,13 +336,13 @@ static int hpwdt_init_one(struct pci_dev *dev,
> watchdog_init_timeout(&hpwdt_dev, soft_margin, NULL);
>
> if (is_kdump_kernel()) {
> - pretimeout = 0;
> + pretimeout = false;
> kdumptimeout = 0;
> }
>
> if (pretimeout && hpwdt_dev.timeout <= PRETIMEOUT_SEC) {
> dev_warn(&dev->dev, "timeout <= pretimeout. Setting pretimeout to zero\n");
> - pretimeout = 0;
> + pretimeout = false;
> }
> hpwdt_dev.pretimeout = pretimeout ? PRETIMEOUT_SEC : 0;
> kdumptimeout = min(kdumptimeout, HPWDT_MAX_TIMER);
> --
> 1.8.3.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] watchdog/hpwdt: Assign boolean values to a bool variable
2021-01-20 7:48 [PATCH] watchdog/hpwdt: Assign boolean values to a bool variable Jiapeng Zhong
2021-01-20 17:52 ` Jerry Hoemann
2021-01-20 19:05 ` Guenter Roeck
@ 2021-01-23 17:19 ` Guenter Roeck
2 siblings, 0 replies; 4+ messages in thread
From: Guenter Roeck @ 2021-01-23 17:19 UTC (permalink / raw)
To: Jiapeng Zhong; +Cc: jerry.hoemann, wim, linux-watchdog, linux-kernel
On Wed, Jan 20, 2021 at 03:48:10PM +0800, Jiapeng Zhong wrote:
> Fix the following coccicheck warnings:
>
> ./drivers/watchdog/hpwdt.c:345:2-12: WARNING: Assignment of
> 0/1 to bool variable.
>
> ./drivers/watchdog/hpwdt.c:126:2-12: WARNING: Assignment of
> 0/1 to bool variable.
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Zhong <abaci-bugfix@linux.alibaba.com>
> Reviewed-by: Jerry Hoemann <jerry.hoemann@hpe.com>
> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> ---
> drivers/watchdog/hpwdt.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c
> index cbd1498..22ddba3 100644
> --- a/drivers/watchdog/hpwdt.c
> +++ b/drivers/watchdog/hpwdt.c
> @@ -123,7 +123,7 @@ static int hpwdt_settimeout(struct watchdog_device *wdd, unsigned int val)
> if (val <= wdd->pretimeout) {
> dev_dbg(wdd->parent, "pretimeout < timeout. Setting to zero\n");
> wdd->pretimeout = 0;
> - pretimeout = 0;
> + pretimeout = false;
> if (watchdog_active(wdd))
> hpwdt_start(wdd);
> }
> @@ -336,13 +336,13 @@ static int hpwdt_init_one(struct pci_dev *dev,
> watchdog_init_timeout(&hpwdt_dev, soft_margin, NULL);
>
> if (is_kdump_kernel()) {
> - pretimeout = 0;
> + pretimeout = false;
> kdumptimeout = 0;
> }
>
> if (pretimeout && hpwdt_dev.timeout <= PRETIMEOUT_SEC) {
> dev_warn(&dev->dev, "timeout <= pretimeout. Setting pretimeout to zero\n");
> - pretimeout = 0;
> + pretimeout = false;
> }
> hpwdt_dev.pretimeout = pretimeout ? PRETIMEOUT_SEC : 0;
> kdumptimeout = min(kdumptimeout, HPWDT_MAX_TIMER);
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-01-23 17:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-20 7:48 [PATCH] watchdog/hpwdt: Assign boolean values to a bool variable Jiapeng Zhong
2021-01-20 17:52 ` Jerry Hoemann
2021-01-20 19:05 ` Guenter Roeck
2021-01-23 17:19 ` Guenter Roeck
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.