All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Quentin Lambert <lambert.quentin@gmail.com>
Cc: Ming Lei <ming.lei@canonical.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Len Brown <len.brown@intel.com>,
	kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-pm@vger.kernel.org
Subject: Re: [PATCH 1/1] drivers/base: Remove unnecessary OOM message
Date: Fri, 06 Feb 2015 20:58:52 +0000	[thread overview]
Message-ID: <20150206205852.GA14126@amd> (raw)
In-Reply-To: <20150206153912.GA8486@sloth>

On Fri 2015-02-06 16:39:12, Quentin Lambert wrote:
> This patch fix checkpatch warnings concerning the possible
> duplication of an "out of memory" message.

So, instead of nice and readable "not enough memory for clock..." we
get OOM, stackdump, and backtrace...? Not sure it is improvement.

							Pavel

> --- a/drivers/base/power/clock_ops.c
> +++ b/drivers/base/power/clock_ops.c
> @@ -81,10 +81,8 @@ static int __pm_clk_add(struct device *dev, const char *con_id,
>  		return -EINVAL;
>  
>  	ce = kzalloc(sizeof(*ce), GFP_KERNEL);
> -	if (!ce) {
> -		dev_err(dev, "Not enough memory for clock entry.\n");
> +	if (!ce)
>  		return -ENOMEM;
> -	}
>  
>  	if (con_id) {
>  		ce->con_id = kstrdup(con_id, GFP_KERNEL);
> diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c
> index 15bf299..677fb28 100644
> --- a/drivers/base/power/opp.c
> +++ b/drivers/base/power/opp.c
> @@ -474,10 +474,8 @@ static int _opp_add_dynamic(struct device *dev, unsigned long freq,
>  
>  	/* allocate new OPP node */
>  	new_opp = kzalloc(sizeof(*new_opp), GFP_KERNEL);
> -	if (!new_opp) {
> -		dev_warn(dev, "%s: Unable to create new OPP node\n", __func__);
> +	if (!new_opp)
>  		return -ENOMEM;
> -	}
>  
>  	/* Hold our list modification lock here */
>  	mutex_lock(&dev_opp_list_lock);
> @@ -695,10 +693,8 @@ static int _opp_set_availability(struct device *dev, unsigned long freq,
>  
>  	/* keep the node allocated */
>  	new_opp = kmalloc(sizeof(*new_opp), GFP_KERNEL);
> -	if (!new_opp) {
> -		dev_warn(dev, "%s: Unable to create OPP\n", __func__);
> +	if (!new_opp)
>  		return -ENOMEM;
> -	}
>  
>  	mutex_lock(&dev_opp_list_lock);
>  

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

WARNING: multiple messages have this Message-ID (diff)
From: Pavel Machek <pavel@ucw.cz>
To: Quentin Lambert <lambert.quentin@gmail.com>
Cc: Ming Lei <ming.lei@canonical.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Len Brown <len.brown@intel.com>,
	kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-pm@vger.kernel.org
Subject: Re: [PATCH 1/1] drivers/base: Remove unnecessary OOM message
Date: Fri, 6 Feb 2015 21:58:52 +0100	[thread overview]
Message-ID: <20150206205852.GA14126@amd> (raw)
In-Reply-To: <20150206153912.GA8486@sloth>

On Fri 2015-02-06 16:39:12, Quentin Lambert wrote:
> This patch fix checkpatch warnings concerning the possible
> duplication of an "out of memory" message.

So, instead of nice and readable "not enough memory for clock..." we
get OOM, stackdump, and backtrace...? Not sure it is improvement.

							Pavel

> --- a/drivers/base/power/clock_ops.c
> +++ b/drivers/base/power/clock_ops.c
> @@ -81,10 +81,8 @@ static int __pm_clk_add(struct device *dev, const char *con_id,
>  		return -EINVAL;
>  
>  	ce = kzalloc(sizeof(*ce), GFP_KERNEL);
> -	if (!ce) {
> -		dev_err(dev, "Not enough memory for clock entry.\n");
> +	if (!ce)
>  		return -ENOMEM;
> -	}
>  
>  	if (con_id) {
>  		ce->con_id = kstrdup(con_id, GFP_KERNEL);
> diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c
> index 15bf299..677fb28 100644
> --- a/drivers/base/power/opp.c
> +++ b/drivers/base/power/opp.c
> @@ -474,10 +474,8 @@ static int _opp_add_dynamic(struct device *dev, unsigned long freq,
>  
>  	/* allocate new OPP node */
>  	new_opp = kzalloc(sizeof(*new_opp), GFP_KERNEL);
> -	if (!new_opp) {
> -		dev_warn(dev, "%s: Unable to create new OPP node\n", __func__);
> +	if (!new_opp)
>  		return -ENOMEM;
> -	}
>  
>  	/* Hold our list modification lock here */
>  	mutex_lock(&dev_opp_list_lock);
> @@ -695,10 +693,8 @@ static int _opp_set_availability(struct device *dev, unsigned long freq,
>  
>  	/* keep the node allocated */
>  	new_opp = kmalloc(sizeof(*new_opp), GFP_KERNEL);
> -	if (!new_opp) {
> -		dev_warn(dev, "%s: Unable to create OPP\n", __func__);
> +	if (!new_opp)
>  		return -ENOMEM;
> -	}
>  
>  	mutex_lock(&dev_opp_list_lock);
>  

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

  reply	other threads:[~2015-02-06 20:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-06 15:39 [PATCH 1/1] drivers/base: Remove unnecessary OOM message Quentin Lambert
2015-02-06 15:39 ` Quentin Lambert
2015-02-06 20:58 ` Pavel Machek [this message]
2015-02-06 20:58   ` Pavel Machek
2015-02-06 21:04   ` Joe Perches
2015-02-06 21:04     ` Joe Perches
2015-02-06 21:17     ` Pavel Machek
2015-02-06 21:17       ` Pavel Machek
2015-02-07 10:24       ` Dan Carpenter
2015-02-07 10:24         ` Dan Carpenter
2015-02-08 23:28         ` Rafael J. Wysocki
2015-02-08 23:28           ` Rafael J. Wysocki

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=20150206205852.GA14126@amd \
    --to=pavel@ucw.cz \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=lambert.quentin@gmail.com \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=ming.lei@canonical.com \
    --cc=rjw@rjwysocki.net \
    /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.