Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3616525pxk; Mon, 21 Sep 2020 20:10:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJygb7ShcrsTS8qxOUEiSQVJY2VYIjYXaCaAcXiA/erYy+YeSjUf8c/8zOSfsbj8pWBcPrwo X-Received: by 2002:a17:906:480a:: with SMTP id w10mr2640681ejq.372.1600744234330; Mon, 21 Sep 2020 20:10:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600744234; cv=none; d=google.com; s=arc-20160816; b=BDvewuDa9ARcpWfCcQF1FDDvKZfIO/eBRGr+TtPz8PyQttmxahvyCauKFyoQwQhi9O r7IlMoODyq/TWQnmOwgPsqkHtWAhLzOE3agTQAjge5JcoQA+78QniwMziEjmy17ocawQ F8ehkXCxgZQfQv55rOuyysYyq4tpIyDIgnu2kPqJPXY/W2ofNWHlyGRukQb6/c+U48GA T9cSqKU0uf3mLSErotbDHADjB0E1fIcSr34Gb1n0NCaD+6s6OoiqfUDzc90r/DlyPcoO ito3zMvZ0eT6DQR3DoC6kRjPCVWJmivyBNVBLY7qTZTvL3mgOlKv2veoQgHQweX/Vjpa DtKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=IJKE4kqVD+S4SFzanJ1qOa6cjaIuE4Wd9tGwUUNGPOE=; b=kvCQO/8Qqg+TcwPmfCc8oFoJOJw6Y+s0aLwrMfaMzOvSIGpD7nXXl6X/R8PNEDmUaD qM1GaVTqepsJdijCXaXdehu82+ZptjtwYrPbp8QcY1/imu/dIRLZl//6CiJYOebz/32+ PrfxlPRXhfwAQ4SAHnWaMTXLUXyMN70o+XSTijPAdQVn/rH2DYRw08O+nTHlQLS3LHpA LeRX5fH8+19HhwwPqQfEX28udf6XTIUA7WAA/1j7HNtqciZqR4NAXN9XoAebEkMjA587 XNrXqZoY6K38D8L/Efq2whBX4A81rjr+WXC7IIcEB1L/WYAdHA8gsA4kl1ab8MKWW5Rc iSpA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id df7si11929982edb.271.2020.09.21.20.10.11; Mon, 21 Sep 2020 20:10:34 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729736AbgIVCdb (ORCPT + 99 others); Mon, 21 Sep 2020 22:33:31 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:13816 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729379AbgIVCdb (ORCPT ); Mon, 21 Sep 2020 22:33:31 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id A910716B416F9FC71983; Tue, 22 Sep 2020 10:33:26 +0800 (CST) Received: from [10.174.179.91] (10.174.179.91) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.487.0; Tue, 22 Sep 2020 10:33:21 +0800 Subject: Re: [PATCH -next] gpu: host1x: simplify the return expression of host1x_cdma_init() To: Mikko Perttunen , Thierry Reding CC: , , References: <20200921131032.91972-1-miaoqinglang@huawei.com> <4378d69a-2338-779f-ab4d-3c64fbf7dfd3@kapsi.fi> From: miaoqinglang Message-ID: <1d224422-a67d-8157-4212-646098f223c9@huawei.com> Date: Tue, 22 Sep 2020 10:33:21 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <4378d69a-2338-779f-ab4d-3c64fbf7dfd3@kapsi.fi> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.179.91] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 2020/9/21 21:12, Mikko Perttunen 写道: > On 9/21/20 4:10 PM, Qinglang Miao wrote: >> Simplify the return expression. >> >> Signed-off-by: Qinglang Miao >> --- >>   drivers/gpu/host1x/cdma.c | 8 +------- >>   1 file changed, 1 insertion(+), 7 deletions(-) >> >> diff --git a/drivers/gpu/host1x/cdma.c b/drivers/gpu/host1x/cdma.c >> index e8d3fda91..08a0f9e10 100644 >> --- a/drivers/gpu/host1x/cdma.c >> +++ b/drivers/gpu/host1x/cdma.c >> @@ -448,8 +448,6 @@ void host1x_cdma_update_sync_queue(struct >> host1x_cdma *cdma, >>    */ >>   int host1x_cdma_init(struct host1x_cdma *cdma) >>   { >> -    int err; >> - >>       mutex_init(&cdma->lock); >>       init_completion(&cdma->complete); >> @@ -459,11 +457,7 @@ int host1x_cdma_init(struct host1x_cdma *cdma) >>       cdma->running = false; >>       cdma->torndown = false; >> -    err = host1x_pushbuffer_init(&cdma->push_buffer); >> -    if (err) >> -        return err; >> - >> -    return 0; >> +    return host1x_pushbuffer_init(&cdma->push_buffer); > > IMHO, this makes it less readable since now it kind of looks like > host1x_pushbuffer_init is returning some meaningful value, instead of > the code just handling error values in a sequence. > > Mikko > Hi Mikko, It sounds resonable, thanks for your reply. >>   } >>   /* >> > .