lkml.org 
[lkml]   [2013]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v3 1/1] Introduce Intel RAPL cooling device driver
From
Date
On Tue, 2013-04-09 at 05:46 -0700, Jacob Pan wrote:
> RAPL(Running Average Power Limit) interface provides platform software
> with the ability to monitor, control, and get notifications on SOC
> power consumptions.

yet more trivia:

> diff --git a/drivers/platform/x86/intel_rapl.c b/drivers/platform/x86/intel_rapl.c
[]
> +static bool rapl_polling_should_cont(void)
> +{
> + unsigned int all_state = 0;
[]
> + return !!all_state;

The !! isn't needed.
!! should only be done when you are returning
int and you need to make sure it's 0 or 1.
It's not here. The return is bool.

return all_state;

The compiler, even icc, will do this internally.

> +static int start_periodic_polling(void)
> +{
> + if (polling_started)
> + goto out;
> + schedule_delayed_work(&rapl_polling_work, 0);
> + polling_started = true;

Should polling_started be device specific (in struct rapl_data ?)
instead of a single instance static?




\
 
 \ /
  Last update: 2013-04-09 18:41    [W:0.067 / U:1.684 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site