From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752835AbdK0THW (ORCPT ); Mon, 27 Nov 2017 14:07:22 -0500 Received: from smtprelay0024.hostedemail.com ([216.40.44.24]:51899 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751475AbdK0THU (ORCPT ); Mon, 27 Nov 2017 14:07:20 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::,RULES_HIT:41:355:379:541:599:857:960:973:982:988:989:1042:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1543:1593:1594:1711:1730:1747:1777:1792:1981:2194:2199:2393:2553:2559:2562:2828:2899:3138:3139:3140:3141:3142:3355:3622:3865:3866:3867:3868:3870:3871:3873:3874:4250:4321:4605:5007:6119:7576:7903:8603:10004:10400:10848:10967:11026:11232:11473:11657:11658:11914:12043:12048:12296:12438:12555:12740:12760:12895:12986:13095:13161:13163:13229:13255:13439:14659:14721:21080:21212:21433:21451:21627:30012:30054:30075:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: drink65_5ca2f6946965e X-Filterd-Recvd-Size: 4605 Message-ID: <1511809633.32426.70.camel@perches.com> Subject: Re: [PATCH] omapfb/dss: Delete an error message for a failed memory allocation in three functions From: Joe Perches To: "Andrew F. Davis" , SF Markus Elfring , linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, Arvind Yadav , Bartlomiej Zolnierkiewicz , Tomi Valkeinen Cc: LKML , kernel-janitors@vger.kernel.org Date: Mon, 27 Nov 2017 11:07:13 -0800 In-Reply-To: References: Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.26.1-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2017-11-27 at 10:43 -0600, Andrew F. Davis wrote: > On 11/26/2017 12:55 PM, SF Markus Elfring wrote: > > From: Markus Elfring > > Date: Sun, 26 Nov 2017 19:46:09 +0100 > > > > Omit an extra message for a memory allocation failure in these functions. > > > > This issue was detected by using the Coccinelle software. > > > > Signed-off-by: Markus Elfring > > --- > > nak, unlike many others, these message give extra info on which > allocation failed, that can be useful. Not really. There are tradeoffs. There is the generic stack dump on OOM so the module/line is already known. The existence of these messages increases code size which also make the OOM condition slightly more likely. These are generally used only at initialization and those if you are OOM at initialization, bad things happen anyway so where the specific OOM occurred doesn't really matter. Markus' commit messages are always really poor descriptions of why these removals are somewhat useful and the commit could/should/might be applied. Your choice. > > drivers/video/fbdev/omap2/omapfb/dss/dispc.c | 4 +--- > > drivers/video/fbdev/omap2/omapfb/dss/dss.c | 4 +--- > > drivers/video/fbdev/omap2/omapfb/dss/hdmi_phy.c | 4 +--- > > 3 files changed, 3 insertions(+), 9 deletions(-) > > > > diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dispc.c b/drivers/video/fbdev/omap2/omapfb/dss/dispc.c > > index 7a75dfda9845..10164a3bae4a 100644 > > --- a/drivers/video/fbdev/omap2/omapfb/dss/dispc.c > > +++ b/drivers/video/fbdev/omap2/omapfb/dss/dispc.c > > @@ -3982,10 +3982,8 @@ static int dispc_init_features(struct platform_device *pdev) > > struct dispc_features *dst; > > > > dst = devm_kzalloc(&pdev->dev, sizeof(*dst), GFP_KERNEL); > > - if (!dst) { > > - dev_err(&pdev->dev, "Failed to allocate DISPC Features\n"); > > + if (!dst) > > return -ENOMEM; > > - } > > > > switch (omapdss_get_version()) { > > case OMAPDSS_VER_OMAP24xx: > > diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss.c b/drivers/video/fbdev/omap2/omapfb/dss/dss.c > > index 48c6500c24e1..a5de13777e2b 100644 > > --- a/drivers/video/fbdev/omap2/omapfb/dss/dss.c > > +++ b/drivers/video/fbdev/omap2/omapfb/dss/dss.c > > @@ -893,10 +893,8 @@ static int dss_init_features(struct platform_device *pdev) > > struct dss_features *dst; > > > > dst = devm_kzalloc(&pdev->dev, sizeof(*dst), GFP_KERNEL); > > - if (!dst) { > > - dev_err(&pdev->dev, "Failed to allocate local DSS Features\n"); > > + if (!dst) > > return -ENOMEM; > > - } > > > > switch (omapdss_get_version()) { > > case OMAPDSS_VER_OMAP24xx: > > diff --git a/drivers/video/fbdev/omap2/omapfb/dss/hdmi_phy.c b/drivers/video/fbdev/omap2/omapfb/dss/hdmi_phy.c > > index 9a13c35fd6d8..d25eea10c665 100644 > > --- a/drivers/video/fbdev/omap2/omapfb/dss/hdmi_phy.c > > +++ b/drivers/video/fbdev/omap2/omapfb/dss/hdmi_phy.c > > @@ -195,10 +195,8 @@ static int hdmi_phy_init_features(struct platform_device *pdev) > > const struct hdmi_phy_features *src; > > > > dst = devm_kzalloc(&pdev->dev, sizeof(*dst), GFP_KERNEL); > > - if (!dst) { > > - dev_err(&pdev->dev, "Failed to allocate HDMI PHY Features\n"); > > + if (!dst) > > return -ENOMEM; > > - } > > > > switch (omapdss_get_version()) { > > case OMAPDSS_VER_OMAP4430_ES1: > >