public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <khali@linux-fr.org>
To: "Fenghua Yu" <fenghua.yu@intel.com>
Cc: "Ingo Molnar" <mingo@elte.hu>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"H Peter Anvin" <hpa@zytor.com>, "Len Brown" <lenb@kernel.org>,
	"Jin Dongming" <jin.dongming@np.css.fujitsu.com>,
	"Hidetoshi Seto" <seto.hidetoshi@jp.fujitsu.com>,
	"linux-kernel" <linux-kernel@vger.kernel.org>,
	"lm-sensors" <lm-sensors@lm-sensors.org>,
	Fenghua Yu <fenghua.yu@intel.com>
Subject: Re: [PATCH] therm_throt.c: Fix error handling in thermal_throttle_add_dev
Date: Fri, 3 Sep 2010 10:48:01 +0200	[thread overview]
Message-ID: <20100903104801.4b41ec56@hyperion.delvare> (raw)
In-Reply-To: <1283474726-20109-1-git-send-email-fenghua.yu@intel.com>

On Thu,  2 Sep 2010 17:45:26 -0700, Fenghua Yu wrote:
> From: Fenghua Yu <fenghua.yu@intel.com>
> 
> Warn when sysfs_add_file_to_group fails.
> 
> Also add missing curly braces.
> 
> Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>

Acked-by: Jean Delvare <khali@linux-fr.org>

> ---
>  arch/x86/kernel/cpu/mcheck/therm_throt.c |   14 ++++++++++----
>  1 files changed, 10 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/x86/kernel/cpu/mcheck/therm_throt.c b/arch/x86/kernel/cpu/mcheck/therm_throt.c
> index c2a8b26..4c3cd62 100644
> --- a/arch/x86/kernel/cpu/mcheck/therm_throt.c
> +++ b/arch/x86/kernel/cpu/mcheck/therm_throt.c
> @@ -211,20 +211,26 @@ static __cpuinit int thermal_throttle_add_dev(struct sys_device *sys_dev)
>  	if (err)
>  		return err;
>  
> -	if (cpu_has(c, X86_FEATURE_PLN))
> +	if (cpu_has(c, X86_FEATURE_PLN)) {
>  		err = sysfs_add_file_to_group(&sys_dev->kobj,
>  					      &attr_core_power_limit_count.attr,
>  					      thermal_attr_group.name);
> -	if (cpu_has(c, X86_FEATURE_PTS))
> +		WARN_ON(err);
> +	}
> +	if (cpu_has(c, X86_FEATURE_PTS)) {
>  		err = sysfs_add_file_to_group(&sys_dev->kobj,
>  					      &attr_package_throttle_count.attr,
>  					      thermal_attr_group.name);
> -		if (cpu_has(c, X86_FEATURE_PLN))
> +		WARN_ON(err);
> +		if (cpu_has(c, X86_FEATURE_PLN)) {
>  			err = sysfs_add_file_to_group(&sys_dev->kobj,
>  					&attr_package_power_limit_count.attr,
>  					thermal_attr_group.name);
> +			WARN_ON(err);
> +		}
> +	}
>  
> -	return err;
> +	return 0;
>  }
>  
>  static __cpuinit void thermal_throttle_remove_dev(struct sys_device *sys_dev)


-- 
Jean Delvare

  reply	other threads:[~2010-09-03  8:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-03  0:45 [PATCH] therm_throt.c: Fix error handling in thermal_throttle_add_dev Fenghua Yu
2010-09-03  8:48 ` Jean Delvare [this message]
2010-09-03  9:35 ` Ingo Molnar
2010-09-03 21:34   ` Fenghua Yu
2010-09-05 12:32     ` Ingo Molnar
2010-09-05 16:35       ` [lm-sensors] " Guenter Roeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100903104801.4b41ec56@hyperion.delvare \
    --to=khali@linux-fr.org \
    --cc=fenghua.yu@intel.com \
    --cc=hpa@zytor.com \
    --cc=jin.dongming@np.css.fujitsu.com \
    --cc=lenb@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lm-sensors@lm-sensors.org \
    --cc=mingo@elte.hu \
    --cc=seto.hidetoshi@jp.fujitsu.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox