Received: by 10.223.164.202 with SMTP id h10csp2233558wrb; Mon, 27 Nov 2017 13:59:15 -0800 (PST) X-Google-Smtp-Source: AGs4zMYw9Owt/IDCpx5wL7ccrVJA4F730pNPY3pG/67dMz30TpvPA94Ser+sEvkkQd27KCEEPYWY X-Received: by 10.98.23.68 with SMTP id 65mr37333278pfx.25.1511819955523; Mon, 27 Nov 2017 13:59:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511819955; cv=none; d=google.com; s=arc-20160816; b=DIV9V11OPkBKny/AXR0l0dV2ugYAxm/tYBj/Z9ItilNziOGsq2C8Ow0vWKHiPVzWAV 9rzxAL3Uy1NP/FLzw8K+mdjsZSH9DkMo4ELhbcgDJTaZ9MtXI79OPwxEayoCf/thMHGT PSEeKOygqMT1eOvQb4mOPXTIft4UVQhHQfrPQekt9IcwnrthcoNqvrtuCFmkMYc7fsOE 5ZKk5vPdsYtMv4bpwp4UQm2/YD60YqygMLp17CSuH8JlIPmXmpJe5scNJoqSOn2Y60FK vU8alk3moEMCmZQavtvmu9szQxeUrI4SReBivEn1MG1iocXQCjtn8mM71QNtVY65/zkr 2iMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=n/kQkzxIJq21BcGmRuOc8DoMSYiZ3cCUiHXGlYvok68=; b=SF7Uxon8M0+9YtEz14nBzbJ0aCKsJ81awlfu7Hehy08VztZpwQ4ImxqzqUHGKqKllf J2nZ/gUBg1GkC69axhwT/KFoFJYlWv6F9oAY9BELfDAJ5ITpRx180pn8MgPckxSoNna1 fOj/KUOGdLp+bbMHA3C2FNZRm9AjVIvYM2RLt6jvvnTJb3EKcP+50bPxtBd0123ZNFbn UpMhYIqqgmdFIVPC9zXmnUC383auue5oWq+jvKBLc7S2ew3VidifTEm98suFP+Flc989 +pC4EL143Xm+popuAmtvRCv1QuG2pfoklrB9yZCVzQmd1le+KAZGv+R/hG+/KVqN6M8J vf2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=CZQ+kczf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p9si11153173pls.418.2017.11.27.13.59.03; Mon, 27 Nov 2017 13:59:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=CZQ+kczf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752689AbdK0Vd2 (ORCPT + 78 others); Mon, 27 Nov 2017 16:33:28 -0500 Received: from fllnx210.ext.ti.com ([198.47.19.17]:30986 "EHLO fllnx210.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751778AbdK0Vd0 (ORCPT ); Mon, 27 Nov 2017 16:33:26 -0500 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllnx210.ext.ti.com (8.15.1/8.15.1) with ESMTP id vARLXEmk019508; Mon, 27 Nov 2017 15:33:14 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1511818394; bh=Rr4gg7vjDUrK0Hjtf7NIdqlKP6JnZ706weYzTW/gMaw=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=CZQ+kczfSyVeEd1bTk7PuFMXqHlTK8VVxvL4s2WJXBhNASfqWS54TuDJZb4ZQeyTP vHmp7ACXjGsHA5qA6v5aWGdnoATGaGlELaU1ITADtGb+vWbefxoQ6kGehRuS7KR/DS CZFbSXVcHCGnprxuEagTLkOGrOGiIStkha2KePJI= Received: from DLEE112.ent.ti.com (dlee112.ent.ti.com [157.170.170.23]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id vARLXDDi020682; Mon, 27 Nov 2017 15:33:13 -0600 Received: from DLEE112.ent.ti.com (157.170.170.23) by DLEE112.ent.ti.com (157.170.170.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.845.34; Mon, 27 Nov 2017 15:33:13 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DLEE112.ent.ti.com (157.170.170.23) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.845.34 via Frontend Transport; Mon, 27 Nov 2017 15:33:13 -0600 Received: from [128.247.59.224] (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id vARLXD6W028572; Mon, 27 Nov 2017 15:33:13 -0600 Subject: Re: [PATCH] omapfb/dss: Delete an error message for a failed memory allocation in three functions To: Joe Perches , SF Markus Elfring , , , , Arvind Yadav , Bartlomiej Zolnierkiewicz , Tomi Valkeinen CC: LKML , References: <1511809633.32426.70.camel@perches.com> From: "Andrew F. Davis" Message-ID: <15209a13-c53b-068b-c0b2-f073117d39e2@ti.com> Date: Mon, 27 Nov 2017 15:33:13 -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: <1511809633.32426.70.camel@perches.com> 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/27/2017 01:07 PM, Joe Perches wrote: > 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. > If that is the case then I have no strong feelings either way. > 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. > True, these messages will probably only ever get displayed if someone is messing with the allocated structs and accidentally balloons their size, so these are more debug statements than anything. > 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: >>> From 1585257522393938674@xxx Mon Nov 27 21:49:43 +0000 2017 X-GM-THRID: 1585156039807309629 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread