Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3149002pxk; Mon, 21 Sep 2020 06:31:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJziMbwhcLA40RrLz5AzMdctnMR6Y11YT21rFIWCoZQpaAYhiiXsSJTjbSvyb87qpw8vxqP+ X-Received: by 2002:a17:906:719a:: with SMTP id h26mr51072696ejk.336.1600695118763; Mon, 21 Sep 2020 06:31:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600695118; cv=none; d=google.com; s=arc-20160816; b=GHWbydzqCTcpAnetqClFMM/bPn0yGOjjiHN6E5hOoDCfwOn8wixcA3izHWnsGTz+aw MiM0m+f+KS9yW7VntT4L8KkmTZ5NUf6mRURAhbJF0D1EwvgetXMfABci2Zv5j2WSxluU 4lxjaSxYw9sz9v1mP9U4ftOsLqjODSd2mbQpecpRO9KgJR4ZMqVfYGJQbwjs1McAT/b0 BvyLpRX3y15fwxEclPrt4sgoCxm++wHRYdO5frsHoHcTth4gMmzHfEX3EZM3qNfNngQv H1CShep3ny+qZFpaPuH2epY/MHCl+aHwt1Hht1y8hqM/FTu5qK414Q5+3QCQBetwXonO mWUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=HKuU7JpLVU1PBj0jVIiCYxaLdFW/3Q4BrrvDHD/vFoM=; b=QB2XggQkLuaQledUBtQdMu8Z4zebqTHiXxf/zTg6cQPDKoL5ucLKIIB1zMs8lEMnfy DxJZFBRk6zgPyL/irDxf2keXxO43zPEHLIv+Q6XId9AvTBv8sUgkXDh4B64ZNWkYjvRN wk8xlJ2EfP/65c4Fz/21JT8/Y1xQuRKEurw3WvkgjZsVjza57f3lAtStzFIHl1XtP1KP K7MySdplP0tcrOS517L7+sMToLjWWSDZ/QPyNNz8SrjTEPEmQmHKNjUl6cNTVQduc2oz ASn3kDKyDO7Raa6n7DGqVFm+9fE6g4Wuqej5FPPJYYNa8c/XJTwAHXctiUs+hHhArR8E M+Aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OjQfWOUG; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b26si3309819edu.250.2020.09.21.06.31.35; Mon, 21 Sep 2020 06:31:58 -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=pass header.i=@gmail.com header.s=20161025 header.b=OjQfWOUG; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727381AbgIUN1b (ORCPT + 99 others); Mon, 21 Sep 2020 09:27:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727216AbgIUN12 (ORCPT ); Mon, 21 Sep 2020 09:27:28 -0400 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77A54C061755; Mon, 21 Sep 2020 06:27:28 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id m6so12787494wrn.0; Mon, 21 Sep 2020 06:27:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=HKuU7JpLVU1PBj0jVIiCYxaLdFW/3Q4BrrvDHD/vFoM=; b=OjQfWOUGvS8vKD9rbIR3dJ08HDqYyREm1W/mAagKqnDl5qbkExQCWwYZwcwFzhW65d g+Krd0TSRSxmSrLmG6cwCGyArGhLNgVenAI6YgNEnXNPtw23BOsaJO0VC7UU2Y5zSUdU rHAXp2SzBL1sypBzEQA4T1xshK4AyA/D+UrLvtXtSaA+uzbKNY73Su/HeflR8CA84G90 VfCB6s0zz4KPl0Cwl9UwkuWJqvZyf9D7xEVBidkz+JvQp/0NyCZYzCiB9lUdCN6iuhkn g+xG6BlS2ZsJgg1brj/iE8PJSnzt0f4pXsxdNx1aw7OLlUkVYqNxlSjmj4PgaX39GVhd SOPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=HKuU7JpLVU1PBj0jVIiCYxaLdFW/3Q4BrrvDHD/vFoM=; b=WM6ZkhfXkphrGL26Wy1325y2cuZf5bMisM53JjCPOBpkbpie2U+p8eVhKMaO9VUm7j 1mbrh7pZ35kR5/h8vmEkPhSFD2r38Zu0+hZlYcns6tjnagnsUE948bQ7xIYDwaH//B4+ HhNykLP9aKy8fpQWl7+jwCrJogwXOZwO1iNG2t+PMDN6Hx2TmShjcw+hB5TKdDSdiiaL +9z11oLGpNXxDfbl5ylLJ29DhpmqjdQfV33pYPNjX/MiGTh8Yc7u7vWMX5hc7mEvEPh/ 9bmVwYL9MM6KQOSM5ZFSELWmNgUO4idb4u5QJZ+i2eAua8n9j/68qvQR6WPAsMGB51hp D7KA== X-Gm-Message-State: AOAM5332KvjTlVLIXx/yrWr0nqKp9zZOnWDiml3Bin5Peov3ZTvu3n8v ro04Z01rj+RyZ9ePyFhk+ucL0jPOOAg= X-Received: by 2002:adf:e690:: with SMTP id r16mr52023767wrm.15.1600694847222; Mon, 21 Sep 2020 06:27:27 -0700 (PDT) Received: from localhost ([217.111.27.204]) by smtp.gmail.com with ESMTPSA id g14sm21591201wrv.25.2020.09.21.06.27.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Sep 2020 06:27:25 -0700 (PDT) Date: Mon, 21 Sep 2020 15:27:24 +0200 From: Thierry Reding To: Mikko Perttunen Cc: Qinglang Miao , dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH -next] gpu: host1x: simplify the return expression of host1x_cdma_init() Message-ID: <20200921132724.GC3955907@ulmo> References: <20200921131032.91972-1-miaoqinglang@huawei.com> <4378d69a-2338-779f-ab4d-3c64fbf7dfd3@kapsi.fi> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="5QAgd0e35j3NYeGe" Content-Disposition: inline In-Reply-To: <4378d69a-2338-779f-ab4d-3c64fbf7dfd3@kapsi.fi> User-Agent: Mutt/1.14.6 (2020-07-11) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --5QAgd0e35j3NYeGe Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Sep 21, 2020 at 04:12:20PM +0300, Mikko Perttunen wrote: > On 9/21/20 4:10 PM, Qinglang Miao wrote: > > Simplify the return expression. > >=20 > > Signed-off-by: Qinglang Miao > > --- > > drivers/gpu/host1x/cdma.c | 8 +------- > > 1 file changed, 1 insertion(+), 7 deletions(-) > >=20 > > 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_cd= ma *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 =3D false; > > cdma->torndown =3D false; > > - err =3D host1x_pushbuffer_init(&cdma->push_buffer); > > - if (err) > > - return err; > > - > > - return 0; > > + return host1x_pushbuffer_init(&cdma->push_buffer); >=20 > 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. Agreed. Collapsing the error handling like this also makes adding code to the bottom of this function more complicated than necessary. Thierry --5QAgd0e35j3NYeGe Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEiOrDCAFJzPfAjcif3SOs138+s6EFAl9oqjoACgkQ3SOs138+ s6G9VBAAwKVijJXmqtUarO6foeE0wYjzdiAw+S3cuykrlg/Ji+72FwUlyjGRympc NEzmcqnFQkYFQjNoNQNToHEni79t2WL2XmhUzElTmrkYxR5xAgwC149EOuLQXLnl c+FLhNe6udpnt4DHTtqcL1AZRWRA+JZ02lPpObT5MzQj/t5XN8/cjgtamZbH1FHN moaFT24SQ1V1D1wlCBan1aze4ruCppchbklRpuChNSS11loqp/Ywb3pnKlz5y+2J xL0pVwAezOefXyJjk0TfRjYD1KvO+htYOhDJ8R71z04VpgT0vv9dlfWvzA4GUsBB Su6w0ndEaFqw4dStkIuVFyF5jBS+idCw5r8B4GUSgBgpMxa41xmHRfVwVaD6Zab1 mX3dAswkmq9g6Z5lsXswI23BCb7v6vdh4zsvpU3dlG6CgE237cnZSZgfo2oPtsNZ +DhjSxo4ZbnWFjU8U9MTxWi0kEXC7yZMmkw2RLCx+LDFMSAKOqNFXESfHSQoutQD rpOedKlY1YIamxTeUD8jT0qvKR4mufH/O4XNUZTU2TPdI0ONMiIA+23McNr6RmrF zOHwgWQUn8lYFhlgw7WtN6RXzR2Cr6Za/ekMPeAJRLwIGV9w0H6ZgmJYcA+ii4FX fNZQHGdlivmzHPOcXFATqQgFEaAR8pUBSdnGu5CrWhXq4BpcpSk= =SQV7 -----END PGP SIGNATURE----- --5QAgd0e35j3NYeGe--