All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nishanth Menon <nm@ti.com>
To: "Gopinath, Thara" <thara@ti.com>
Cc: "linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	"khilman@deeprootsystems.com" <khilman@deeprootsystems.com>,
	"paul@pwsan.com" <paul@pwsan.com>,
	"tony@atomide.com" <tony@atomide.com>,
	"Cousson, Benoit" <b-cousson@ti.com>,
	"Sawant, Anand" <sawant@ti.com>,
	"Sripathy, Vishwanath" <vishwanath.bs@ti.com>,
	"Premi, Sanjeev" <premi@ti.com>
Subject: Re: [PM-OPP][PATCH 2/4] OMAP: Correct the return value check after call into find_device_opp
Date: Tue, 13 Jul 2010 09:42:04 -0500	[thread overview]
Message-ID: <4C3C7B3C.9090704@ti.com> (raw)
In-Reply-To: <5A47E75E594F054BAF48C5E4FC4B92AB0323A2BCB7@dbde02.ent.ti.com>

Gopinath, Thara had written, on 07/13/2010 09:32 AM, the following:
> 
>>> -----Original Message-----
>>> From: Menon, Nishanth
>>> Sent: Tuesday, July 13, 2010 5:53 PM
>>> To: Gopinath, Thara
>>> Cc: linux-omap@vger.kernel.org; khilman@deeprootsystems.com; paul@pwsan.com; tony@atomide.com;
>>> Cousson, Benoit; Sawant, Anand; Sripathy, Vishwanath; Premi, Sanjeev
>>> Subject: Re: [PM-OPP][PATCH 2/4] OMAP: Correct the return value check after call into find_device_opp
>>>
>>> Gopinath, Thara had written, on 07/13/2010 12:47 AM, the following:
>>>> Earlier we were checking on !dev_opp where as find_device_opp returns
>>>> a error pointer in case of error. So correcting the check as in the earlier
>>>> code even if find_device_opp returns an error opp_init_cpufreq_table
>>>> was not exiting.
>>>>
>>>> Signed-off-by: Thara Gopinath <thara@ti.com>
>>>> ---
>>>>  arch/arm/plat-omap/opp.c |    4 +++-
>>>>  1 files changed, 3 insertions(+), 1 deletions(-)
>>>>
>>>> diff --git a/arch/arm/plat-omap/opp.c b/arch/arm/plat-omap/opp.c
>>>> index a06b88d..d88a2e0 100644
>>>> --- a/arch/arm/plat-omap/opp.c
>>>> +++ b/arch/arm/plat-omap/opp.c
>>>> @@ -457,8 +457,10 @@ void opp_init_cpufreq_table(struct device *dev,
>>>>  	int i = 0;
>>>>
>>>>  	dev_opp = find_device_opp(dev);
>>>> -	if (WARN_ON(!dev_opp))
>>>> +	if (IS_ERR(dev_opp)) {
>>>> +		WARN_ON(1);
>>> could we use pr_warning here instead of WARN_ON?
> The WARN_ON was already in the code. Added by you or Kevin. I just corrected the error checking.

:) using a WARN_ON() for an operational code is not a good idea - who 
ever added it (git annotate can help you there). WARN_ON(1) give no 
useful information when debugging in the field - just gives a line 
number and function name which changes btw.. useful info is something like:
pr_warning("%s: failed to find device\n", __func__);

useful when someone posts a log and we need to debug such logic.. esp 
useful after a period of time.

> 
> Regards
> Thara
>>>>  		return;
>>>> +	}
>>>>
>>>>  	freq_table = kzalloc(sizeof(struct cpufreq_frequency_table) *
>>>>  			     (dev_opp->enabled_opp_count + 1), GFP_ATOMIC);
>>>
>>> --
>>> Regards,
>>> Nishanth Menon


-- 
Regards,
Nishanth Menon

  reply	other threads:[~2010-07-13 14:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-13  5:47 [PM-OPP][PATCH 0/4] OMAP: Clean up series for generic opp layer Thara Gopinath
2010-07-13  5:47 ` [PM-OPP][PATCH 1/4] OMAP: Fix the compilation warning in the " Thara Gopinath
2010-07-13  5:47   ` [PM-OPP][PATCH 2/4] OMAP: Correct the return value check after call into find_device_opp Thara Gopinath
2010-07-13  5:47     ` [PM-OPP][PATCH 3/4] OMAP: Remove inclusion of PMIC specific header file in generic opp layer Thara Gopinath
2010-07-13  5:47       ` [PM-OPP][PATCH 4/4] OMAP: Remove dependency of generic opp layer on cpufreq Thara Gopinath
2010-07-13 12:23     ` [PM-OPP][PATCH 2/4] OMAP: Correct the return value check after call into find_device_opp Nishanth Menon
2010-07-13 14:32       ` Gopinath, Thara
2010-07-13 14:42         ` Nishanth Menon [this message]
2010-07-13 15:53 ` [PM-OPP][PATCH 0/4] OMAP: Clean up series for generic opp layer Nishanth Menon
2010-07-14  0:39   ` Gopinath, Thara

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=4C3C7B3C.9090704@ti.com \
    --to=nm@ti.com \
    --cc=b-cousson@ti.com \
    --cc=khilman@deeprootsystems.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=paul@pwsan.com \
    --cc=premi@ti.com \
    --cc=sawant@ti.com \
    --cc=thara@ti.com \
    --cc=tony@atomide.com \
    --cc=vishwanath.bs@ti.com \
    /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 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.