* [PATCH] cpufreq: speedstep: convert BUG() to BUG_ON()
@ 2019-02-16 16:15 Yangtao Li
2019-02-18 4:59 ` Viresh Kumar
0 siblings, 1 reply; 2+ messages in thread
From: Yangtao Li @ 2019-02-16 16:15 UTC (permalink / raw)
To: rjw, viresh.kumar; +Cc: linux-pm, linux-kernel, Yangtao Li
To fix coccinelle WARNING.
WARNING: Use BUG_ON instead of if condition followed by BUG.
Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
---
drivers/cpufreq/speedstep-ich.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/cpufreq/speedstep-ich.c b/drivers/cpufreq/speedstep-ich.c
index fbbcb88db061..5d8a09b82efb 100644
--- a/drivers/cpufreq/speedstep-ich.c
+++ b/drivers/cpufreq/speedstep-ich.c
@@ -243,8 +243,7 @@ static unsigned int speedstep_get(unsigned int cpu)
unsigned int speed;
/* You're supposed to ensure CPU is online. */
- if (smp_call_function_single(cpu, get_freq_data, &speed, 1) != 0)
- BUG();
+ BUG_ON(smp_call_function_single(cpu, get_freq_data, &speed, 1));
pr_debug("detected %u kHz as current frequency\n", speed);
return speed;
--
2.17.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] cpufreq: speedstep: convert BUG() to BUG_ON()
2019-02-16 16:15 [PATCH] cpufreq: speedstep: convert BUG() to BUG_ON() Yangtao Li
@ 2019-02-18 4:59 ` Viresh Kumar
0 siblings, 0 replies; 2+ messages in thread
From: Viresh Kumar @ 2019-02-18 4:59 UTC (permalink / raw)
To: Yangtao Li; +Cc: rjw, linux-pm, linux-kernel
On 16-02-19, 11:15, Yangtao Li wrote:
> To fix coccinelle WARNING.
>
> WARNING: Use BUG_ON instead of if condition followed by BUG.
>
> Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
> ---
> drivers/cpufreq/speedstep-ich.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/cpufreq/speedstep-ich.c b/drivers/cpufreq/speedstep-ich.c
> index fbbcb88db061..5d8a09b82efb 100644
> --- a/drivers/cpufreq/speedstep-ich.c
> +++ b/drivers/cpufreq/speedstep-ich.c
> @@ -243,8 +243,7 @@ static unsigned int speedstep_get(unsigned int cpu)
> unsigned int speed;
>
> /* You're supposed to ensure CPU is online. */
> - if (smp_call_function_single(cpu, get_freq_data, &speed, 1) != 0)
> - BUG();
> + BUG_ON(smp_call_function_single(cpu, get_freq_data, &speed, 1));
>
> pr_debug("detected %u kHz as current frequency\n", speed);
> return speed;
Applied. Thanks.
--
viresh
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-02-18 4:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-16 16:15 [PATCH] cpufreq: speedstep: convert BUG() to BUG_ON() Yangtao Li
2019-02-18 4:59 ` Viresh Kumar
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.