Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1288952ybb; Fri, 10 Apr 2020 23:15:43 -0700 (PDT) X-Google-Smtp-Source: APiQypKMqPqU0qJVP0sHzg8NvdsnLANoU7TK2YWdtA/dvPgKMhmPEgbmpFAdZENv5oR5uISUKLd4 X-Received: by 2002:a37:7783:: with SMTP id s125mr7144068qkc.492.1586585743080; Fri, 10 Apr 2020 23:15:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586585743; cv=none; d=google.com; s=arc-20160816; b=vU7gs4pkBKX/AN9m7W+q49YjZlP5e11E+VWkNE+WGn5psfvUVdSgSehDFWMXowzXHP mHMksbgy0bmkZ14v9/+P8bWHFb8SMWLYmJLc9cbAFa1FoecQFjsfAyQQ5dVzLPdvi2tf U7DLLd7sC8ER4+QpFHufTBd1bBwVMoPttIW2Z+rCUZuEsKUyufABKq4qTN8ZosXuoiW9 DckhALINGZosQftDobjj2BMQKT7leJeTzih53X4FW1WFuNf9rafegHmDJdmbUNw6rfTV P9+rMEXQAGLcLlm+dPEhZ1CfJqEFgW8P7BFFxbFxqu3GPUnmUyHqyYQOPxOzb7ALJKND YElw== 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:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=l0mO84D4oombaLO03yQ7KRCVvmohP24Ckbz3HTOD8Aw=; b=U7yKeYxtTLIycKbf8ZFV06j/KjScZ9FO+LQQSXenq6mtzOS8LEBwCg+UQFlqrzBs4Y 9yFDwr7GW5BT41MfV7v8L6j/cN8Y929sKuyFG538Q2QWw8agmKmmQAIhlXn5g/ZsLI6F VXrMfjzt8jOPzvBmaBjNGM/OlO7gXiKpbz781Bbr51B3VpFSMbKeMlTEs2BKcsz/q42o Q8/RgPPbjcCOb0NhAADcTcIOxmja2t7v5UDMXrn9u8ximzV0Tbgof8OGdejGdVKfCwPn kABhza4+FHzhG+0j43z8JlawLMZirvszo1ucYcyRPmQ9FEBW8cNjIML83CBHg4/H1fwR cOHA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r75si1690201qke.251.2020.04.10.23.15.15; Fri, 10 Apr 2020 23:15:43 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725905AbgDKGNC (ORCPT + 99 others); Sat, 11 Apr 2020 02:13:02 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:45324 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725867AbgDKGNC (ORCPT ); Sat, 11 Apr 2020 02:13:02 -0400 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 7C8EB85205F380D36F76; Sat, 11 Apr 2020 14:12:58 +0800 (CST) Received: from [127.0.0.1] (10.57.60.129) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.487.0; Sat, 11 Apr 2020 14:12:48 +0800 Subject: Re: [PATCH] drm/hisilicon: Code refactoring for hibmc_drv_vdac To: Joe Perches , Tian Tao , , , , , , , , , , CC: References: <1586573387-42003-1-git-send-email-tiantao6@hisilicon.com> <78e966cacffbab8c43be6a02aa3f5af2478917d0.camel@perches.com> From: "tiantao (H)" Message-ID: Date: Sat, 11 Apr 2020 14:12:48 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <78e966cacffbab8c43be6a02aa3f5af2478917d0.camel@perches.com> Content-Type: text/plain; charset="gbk"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.57.60.129] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thank you, your suggestion is accepted and I will issue v2 ?? 2020/4/11 11:43, Joe Perches ะด??: > On Sat, 2020-04-11 at 10:49 +0800, Tian Tao wrote: >> code refactoring for hibmc_drv_vdac.c, no actual function changes. > > Seems sensible. > >> diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c > [] >> @@ -109,13 +83,6 @@ int hibmc_vdac_init(struct hibmc_drm_private *priv) >> struct drm_connector *connector; >> int ret; >> >> - connector = hibmc_connector_init(priv); >> - if (IS_ERR(connector)) { >> - DRM_ERROR("failed to create connector: %ld\n", >> - PTR_ERR(connector)); >> - return PTR_ERR(connector); >> - } >> - >> encoder = devm_kzalloc(dev->dev, sizeof(*encoder), GFP_KERNEL); >> if (!encoder) { >> DRM_ERROR("failed to alloc memory when init encoder\n"); > > The alloc error messages could be removed. > >> @@ -131,6 +98,21 @@ int hibmc_vdac_init(struct hibmc_drm_private *priv) >> } >> >> drm_encoder_helper_add(encoder, &hibmc_encoder_helper_funcs); >> + >> + connector = devm_kzalloc(dev->dev, sizeof(*connector), GFP_KERNEL); >> + if (!connector) { >> + DRM_ERROR("failed to alloc memory when init connector\n"); > > and here. > > > > . >