Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp244835pxb; Tue, 2 Feb 2021 04:13:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJz0fyoOomPEa5OIBgAQMhkptkFQbLQAz05JI2cSLhhY1TfQaO6AfmP85n6iDLWQt7m3i4Fu X-Received: by 2002:a17:906:391b:: with SMTP id f27mr13252795eje.228.1612268029876; Tue, 02 Feb 2021 04:13:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612268029; cv=none; d=google.com; s=arc-20160816; b=Z57+lERymmtS5SHLoCT6kCDu83To6P3P7byFlFu5n79c5Jwu5BxXR5X2Su39qTso9C QzzxqoE/q24Y1+7LBsu5zEAg1XdKmvimTA/zXFWowlbVUnyeZgzWo3t+Bx/9//KS/GiL KIWHhFZksDD7Q4sPzi9Qzul04CPnAAXNr1cTqIH+PWBpIA4Yi8Sex5ElD2VV3Pm6D5BT BSdgDzlJa5qhGLLjB7GkddAwjhS53VA+Yy8ARlvrhBePpXVCgqaGfrT1po4D7pDAKuRg d5o339uMTY8+EeOnwJXUeZovuJcr9ykZmdGzoZRLpcQZUs2eiYkgxWPoTsmhlwrsp+RP LwOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Dd5pT6EPpsMxrS51I32YPMsgBGfhwnubHi5VcJ0dkpk=; b=E21af7sVdbW562rgm5xIl/Hz3Mkk2TvJP7OtZUSuhM6EJwpWTQI4HfNjNUy3u54P63 xpGd3H0Vs9tlTPbXehJjn3z1yI4XMiVyLkeLqWH0IRK1UDOoE3m8uCGzWbS9fq5vb2E8 jL/pAz20/hUf/dWA2UsqyHqhemK/v+dU8GVEWuZ/RRSYG6m1ZfRJDhhI0ux7dbZGEgF0 4Lx233jNu17J9zbyaz9T6jxzW1wbYzWAtnZ1+HJKhWnlCjVR6M+PbYYH/N80IEoWyCui GVQXY2QGJ3MgznMVadwpX71KwYeTnzq3ic+JTlc7qiZ2CxHclO6mzfMULnjtC3yyLCEF q9LQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=vivo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f22si12300232edw.413.2021.02.02.04.13.25; Tue, 02 Feb 2021 04:13:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230368AbhBBML7 (ORCPT + 99 others); Tue, 2 Feb 2021 07:11:59 -0500 Received: from mail-m17640.qiye.163.com ([59.111.176.40]:48152 "EHLO mail-m17640.qiye.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231429AbhBBMLf (ORCPT ); Tue, 2 Feb 2021 07:11:35 -0500 Received: from ubuntu.localdomain (unknown [157.0.31.124]) by mail-m17640.qiye.163.com (Hmail) with ESMTPA id B83F75402D9; Tue, 2 Feb 2021 20:10:45 +0800 (CST) From: Bernard Zhao To: Xinliang Liu , Tian Tao , John Stultz , Xinwei Kong , Chen Feng , David Airlie , Daniel Vetter , Laurent Pinchart , Tomi Valkeinen , Sam Ravnborg , Boris Brezillon , Bernard Zhao , Thomas Zimmermann , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: opensource.kernel@vivo.com Subject: [PATCH] drm/hisilicon: remove redundant when devm_kzalloc failed Date: Tue, 2 Feb 2021 04:10:37 -0800 Message-Id: <20210202121039.14945-1-bernard@vivo.com> X-Mailer: git-send-email 2.29.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-HM-Spam-Status: e1kfGhgUHx5ZQUtXWQgYFAkeWUFZS1VLWVdZKFlBSE83V1ktWUFJV1kPCR oVCBIfWUFZS0wYGk9CTRpPSkxOVkpNSklJTUxDT01LQkNVEwETFhoSFyQUDg9ZV1kWGg8SFR0UWU FZT0tIVUpKS0hNSlVLWQY+ X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6OhQ6Sxw*TD8INTYsFD9KEQMp PklPCwxVSlVKTUpJSU1MQ09NT0xPVTMWGhIXVRkeCRUaCR87DRINFFUYFBZFWVdZEgtZQVlKTkxV S1VISlVKSU9ZV1kIAVlBSU5NTDcG X-HM-Tid: 0a7762a6f996d995kuwsb83f75402d9 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Line 852 DRM_ERROR is redundant because memory alloc already prints an error when failed. Signed-off-by: Bernard Zhao --- drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c b/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c index 00e87c290796..8491d8267f07 100644 --- a/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c +++ b/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c @@ -852,10 +852,9 @@ static int dsi_probe(struct platform_device *pdev) int ret; data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); - if (!data) { - DRM_ERROR("failed to allocate dsi data.\n"); + if (!data) return -ENOMEM; - } + dsi = &data->dsi; ctx = &data->ctx; dsi->ctx = ctx; -- 2.29.0