From patchwork Sun Nov 26 20:42:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 10075531 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 930CD602BD for ; Sun, 26 Nov 2017 20:43:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8559828AB5 for ; Sun, 26 Nov 2017 20:43:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 77CE628AB7; Sun, 26 Nov 2017 20:43:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 163E428AB5 for ; Sun, 26 Nov 2017 20:43:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751934AbdKZUnA (ORCPT ); Sun, 26 Nov 2017 15:43:00 -0500 Received: from mout.web.de ([212.227.15.4]:57381 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751662AbdKZUm7 (ORCPT ); Sun, 26 Nov 2017 15:42:59 -0500 Received: from [192.168.1.3] ([78.49.168.181]) by smtp.web.de (mrweb003 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MD8Au-1eMLYr3f2q-00GXOS; Sun, 26 Nov 2017 21:42:49 +0100 Subject: [PATCH 1/2] video: fbdev-MMP: Delete an error message for a failed memory allocation in two functions From: SF Markus Elfring To: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, Bartlomiej Zolnierkiewicz Cc: LKML , kernel-janitors@vger.kernel.org References: Message-ID: <9aa9c376-22a3-f682-d9a4-5ee95cfd75a0@users.sourceforge.net> Date: Sun, 26 Nov 2017 21:42:49 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-GB X-Provags-ID: V03:K0:osHQIYXvQoWBlqPOKUg+aBzwLHrvuHru9D6dFVoUFSn6pWKmfXL B00nS1CIs+1gf+QLnJ3hL8+b+V432uCL+mvu19Bl7eWumKaqrYsXlg41sNHaCZ6eiLe7PHA tMu1xMa8ntHiFHdNbd4ZxobVU1QVf4bmZ+fHrutrLz0buuMk2+cx7noUHTUlwyUtU/oHJmJ Rw1OY8V6GvlVS1/xmu0EA== X-UI-Out-Filterresults: notjunk:1; V01:K0:Mq1P3uCI/Bo=:+LEVWGGp+VFcCBajvFnp+u Tl7CFkgL+ytfWTBpEcmJKXDIzEz36Fy4ttF7fAI9ogbHACfhvcabc9x90tvgEw1KBQA2YuJ14 BUrluG2l7Bo9FzF3ulyDuRrX2sG4PoDwhG0m4KOwyVLPIz5zI8waAuz1g4NHYNqtqjLOok6+c yk7aeFemmfZxJew+Ka9ujb/o0Xa2JDMa38VGt2NcsjRNiFI2Sgrac/blj0PTtPJK5r9mwmH9z nnOzLdc0202jydzz21SBw5z10ntXJG9U1LQHE6nm8CziMmdOOIkrfmhJSUco0tP437poU0ktg SME8xTw3bNCpqs8b2dLjB+1Bsm8nW2Xdg3Rj6QHQgSJrEv12vOl5O7zEfprdykFZT8hw8OYue WiYznaBFJxwkaShjI2f7UPmXk6WSUvY+L5/8phi9z09iCuAlmXNzuieTxixTI35VT9wvRfKtR 6FSNvjNWkQTC0EW40gu9WMVF1XZ2+GkVEMux4XdF86M4rSciINh5CEK75Y7R2z0szsfP06kjD xSBRVf31IXCKAkl14dpeoFJlkjySe+gGZL0tam0H9KPa10mc3uWWy/vzKAZRJiAe3sLOTf7sM YulQbgQepJxf7mX0pPoNBCkpH/arDO3L20mLCbm/jKUjtp9JrRgZS3JKQjy6CZAgiSeQFM5+u AFqOs3cDmyqBjsGh0gtIZ+rDr95I3mlMfITro23o55ChSNMTKOC8tbC6vsqTUT0McSpDqeEbN 7ZNAA0jPd2dtkLIj/mslzPdGCJcfEv11h4uEn8NR/YVWu0iDyacJ1fEewwXDX2QTWuIXZxn5x r4qaZ9eUi16YgDiGQnWzwgW7XK5PSwAsHqTGwOu7P8yBvnY69U= Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sun, 26 Nov 2017 21:16:30 +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 --- drivers/video/fbdev/mmp/fb/mmpfb.c | 5 ++--- drivers/video/fbdev/mmp/hw/mmp_ctrl.c | 6 ++---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/video/fbdev/mmp/fb/mmpfb.c b/drivers/video/fbdev/mmp/fb/mmpfb.c index 92279e02dd94..292b3e403044 100644 --- a/drivers/video/fbdev/mmp/fb/mmpfb.c +++ b/drivers/video/fbdev/mmp/fb/mmpfb.c @@ -495,10 +495,9 @@ static int modes_setup(struct mmpfb_info *fbi) /* put videomode list to info structure */ videomodes = kzalloc(sizeof(struct fb_videomode) * videomode_num, GFP_KERNEL); - if (!videomodes) { - dev_err(fbi->dev, "can't malloc video modes\n"); + if (!videomodes) return -ENOMEM; - } + for (i = 0; i < videomode_num; i++) mmpmode_to_fbmode(&videomodes[i], &mmp_modes[i]); fb_videomode_to_modelist(videomodes, videomode_num, &info->modelist); diff --git a/drivers/video/fbdev/mmp/hw/mmp_ctrl.c b/drivers/video/fbdev/mmp/hw/mmp_ctrl.c index b6f83d5df9fd..9f912ea0bfce 100644 --- a/drivers/video/fbdev/mmp/hw/mmp_ctrl.c +++ b/drivers/video/fbdev/mmp/hw/mmp_ctrl.c @@ -407,11 +407,9 @@ static int path_init(struct mmphw_path_plat *path_plat, /* init driver data */ path_info = kzalloc(sizeof(struct mmp_path_info), GFP_KERNEL); - if (!path_info) { - dev_err(ctrl->dev, "%s: unable to alloc path_info for %s\n", - __func__, config->name); + if (!path_info) return 0; - } + path_info->name = config->name; path_info->id = path_plat->id; path_info->dev = ctrl->dev;