Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3136515pxk; Mon, 21 Sep 2020 06:15:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzfAJ5drPACg3ca5n9UtVfdMyGtdKmo+IVypYfGuGkutezlWkokWaHgOew4Rz81plmHEdpo X-Received: by 2002:a17:906:d045:: with SMTP id bo5mr48204177ejb.320.1600694110922; Mon, 21 Sep 2020 06:15:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600694110; cv=none; d=google.com; s=arc-20160816; b=IwmEjKZ9MGyAg836ppJhflolMd3aNPbRGKM7PxSLgRyvW4uhsbXyQHHKR1hcgiLkd4 qduZXj3xBVJ5MUV6vX3RX27yMSWT4M2mEW8/+gSXDjz5xi2U9GfoQlOku+rpwdA6y1xn QKG4y55NmtjB0YOXs27MFNoGk8YXryvwFFG/0Mjer3GpHZCiFxxAuPB729R60C3vyT00 xzWFF2S7eBmJFiriCPT3+FXNw5CMPHB3D/l679p8WTSX9dpyihumLLIuzWwWpYS0W4CW GetlYYtZ0xVdXnaLuOQSOhMWTvkQDHypGc1FWBOcMJlo9yfXc1H9Td3KagrLDLt1w/C7 46Ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=vqonmA7dPy+5LJkip5U9O8/KVJ5XsAg9XSTuRLG/KXs=; b=xiMrnsfvJjDAzAGd3Hxhtdq6ZIIbmhvvTCx8t5O6uHO5FSTI2oXztU18QveaErIfCW //NXfaJqUSXrO1PRQ8FGtpZXCUxC0TAtdyspnP5uTaPOsVaDQ+IukEVoAyqpuaLiYsOL XFSPyOMiJ37gQD7sl8F+8l+9LyqrPlANhRcru9OHalBtVAiOApSnagFoJJRVT8hYvI9d eAJqZd6U2xovL4Ip8YIoHZ5VqEAGYWXJR59PEcsjNkLNaYHAaVBhNKviWVw9VGe5j/lN 4JsgtAOntMyYo4VzMddkSGyCjVqksVZpFaq4G9bipcokntQZyZZVUqtNThxWefTDytHF 5ZbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kapsi.fi header.s=20161220 header.b=JD6xVeVx; 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 v21si8450668edl.133.2020.09.21.06.14.42; Mon, 21 Sep 2020 06:15:10 -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; dkim=fail header.i=@kapsi.fi header.s=20161220 header.b=JD6xVeVx; 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 S1727690AbgIUNMm (ORCPT + 99 others); Mon, 21 Sep 2020 09:12:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727685AbgIUNMk (ORCPT ); Mon, 21 Sep 2020 09:12:40 -0400 Received: from mail.kapsi.fi (mail.kapsi.fi [IPv6:2001:67c:1be8::25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B53BC061755; Mon, 21 Sep 2020 06:12:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kapsi.fi; s=20161220; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=vqonmA7dPy+5LJkip5U9O8/KVJ5XsAg9XSTuRLG/KXs=; b=JD6xVeVxsOz4IkiHbEEq8fJLKg 1lp+tGyn9dMv2L+Zsn9fX9+3bS01+iLnNGvXjZV0dzAFFDg+jSOmL3vB1xpnIPgTCLfsnQXx0yU3E QYAnZF01X36VYRCpHR3jmSPxIcAW5pcD3qjUN5dT3Kzc4tFQKzGBB8C7lJKYIOCxwhZtkEzBitet7 CRkz2G43h9ZQ0/PsRhDOPcGX0JsBm9kECOoMhuSRuWNL+4aNllEQOVaEshlqPI3DdtJliHBs0CUYa beBO76OHhmZYeaUQ3TGPVRmnkmRr84tb9rjcMwmbpGOXSX1XHWIyMxfhR0kzfZMV2VPH1ZB9TDxSn KiE/pwMA==; Received: from dsl-hkibng22-54f986-236.dhcp.inet.fi ([84.249.134.236] helo=[192.168.1.10]) by mail.kapsi.fi with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1kKLcR-00068D-5n; Mon, 21 Sep 2020 16:12:35 +0300 Subject: Re: [PATCH -next] gpu: host1x: simplify the return expression of host1x_cdma_init() To: Qinglang Miao , Thierry Reding Cc: dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org References: <20200921131032.91972-1-miaoqinglang@huawei.com> From: Mikko Perttunen Message-ID: <4378d69a-2338-779f-ab4d-3c64fbf7dfd3@kapsi.fi> Date: Mon, 21 Sep 2020 16:12:20 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20200921131032.91972-1-miaoqinglang@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 84.249.134.236 X-SA-Exim-Mail-From: cyndis@kapsi.fi X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > } > > /* >