From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755816AbbBFU65 (ORCPT ); Fri, 6 Feb 2015 15:58:57 -0500 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:44584 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751877AbbBFU64 (ORCPT ); Fri, 6 Feb 2015 15:58:56 -0500 Date: Fri, 6 Feb 2015 21:58:52 +0100 From: Pavel Machek To: Quentin Lambert Cc: Ming Lei , Greg Kroah-Hartman , "Rafael J. Wysocki" , Len Brown , 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 Message-ID: <20150206205852.GA14126@amd> References: <20150206153912.GA8486@sloth> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150206153912.GA8486@sloth> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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