[PATCH 1/3] CPU frequency scaling addon

Bastien Nocera hadess at hadess.net
Sun Aug 13 05:44:53 PDT 2006


On Fri, 2006-08-11 at 19:45 +0200, Holger Macht wrote:
> Patch adding the cpufreq addon itself.
> 
> This version implements the following new things:
> 
>   - specific DBus errors on failure (exceptions)
>   - PolicyKit integration
>   - add DBus method to get a list of all available governors
> 
> Signed-off-by: Holger Macht <hmacht at suse.de>
> ---
> 
<snip>
> +/********************* userspace interface *********************/
> +static gboolean write_speed(unsigned kHz, int cpu_id)
> +{
> +	GString  *speed_file = g_string_new("");
> +	gboolean ret = TRUE;
> +
> +	if (!cpu_online(cpu_id)) {
> +		ret = FALSE;
> +		goto Out;
> +	}
> +
> +	g_string_printf(speed_file, SYSFS_SCALING_SETSPEED_FILE, cpu_id); 

That should be:
char *speed_file;

speed_file = g_strdup_printf (SYSFS_SCALING_SETSPEED_FILE, cpu_id);
<do stuff>
g_free (speed_file);

-- 
Bastien Nocera <hadess at hadess.net> 



More information about the hal mailing list