From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932083AbdK0QoI (ORCPT ); Mon, 27 Nov 2017 11:44:08 -0500 Received: from lelnx194.ext.ti.com ([198.47.27.80]:25398 "EHLO lelnx194.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753079AbdK0QoG (ORCPT ); Mon, 27 Nov 2017 11:44:06 -0500 Subject: Re: [PATCH] omapfb/dss: Delete an error message for a failed memory allocation in three functions To: SF Markus Elfring , , , , Arvind Yadav , Bartlomiej Zolnierkiewicz , Tomi Valkeinen CC: LKML , References: From: "Andrew F. Davis" Message-ID: Date: Mon, 27 Nov 2017 10:43:54 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > 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: >