Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp79246ybl; Tue, 7 Jan 2020 02:31:55 -0800 (PST) X-Google-Smtp-Source: APXvYqwQLdKUI5Z97E7WZ4WYCGkKEEV42jUjtcqm55NVnVq23Kn9VhFirZxIjXsRzf1hkd2jAdcC X-Received: by 2002:a9d:68cc:: with SMTP id i12mr83005160oto.207.1578393115435; Tue, 07 Jan 2020 02:31:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578393115; cv=none; d=google.com; s=arc-20160816; b=WdcyGw5Nh9OwZX+uDhRd9Q1ncvZWBD7bE6gbedCCEu1J32mr7vf+wfVZXRyZmxuFV6 0iKZDwYoyqcJosPwBLTomZ/2sbmaFK8fszfh0KXaFcJusBBR53hs9KwZs8UYWNgUFuaG bbG0DJyFOQRIZCOr9T0hpvnTM7EDYtuH6JDt6KPI1184egbLjZ2MuFY0RkEVJp47Ukrq iUEz8kppDvdZ9SB4uPFT5snUi8wxSfEbFf5tN5CXQMjycVrn+Zy3AJ18dasBnycnHDB5 Y7s0SG75eAjbg9l4oJGOn6IN3ceNrxpp2oEox0XSMLAeb32yPv1fGHHd4I/lCj0hlx8Y LqyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=rmzw6HkPYK64ryQA7oJUSuwOS5x77iQobF8WzJJV9tY=; b=X7AdW9iBGTm+9oekZC7sr71P5fUWgOgqgOYRtRDt4hbU5XNZNf8cfuPYgV1KXFEIag i/fQl6ZYvwcrJ1BBInDzA0fR5cmVbpr0LydD+JPjzHxcQ08oFOzQsESu7Urd4zedhaw+ ++/cK+BU0U+pu6gCXGnefUa/HGX9v+3bk/AzFJ35JEa0e31+D34L4gGyb6J6o5oBBOn7 oc3we/yXOS6KVvpVhuYOM9FkiuqC2e/vaU513ctr4QL5S3yVkfhqN7VMoSpoaleOB4vh hZgbY7lDDfJsHzL4yyY03cDiPeFrdedQvmtHVHkYIDEiQaGPcm07IvS0dXm81baWJ1ky Ivgw== 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 u127si28778576oig.71.2020.01.07.02.31.42; Tue, 07 Jan 2020 02:31:55 -0800 (PST) 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 S1727784AbgAGK34 (ORCPT + 99 others); Tue, 7 Jan 2020 05:29:56 -0500 Received: from sauhun.de ([88.99.104.3]:49270 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727154AbgAGK34 (ORCPT ); Tue, 7 Jan 2020 05:29:56 -0500 Received: from localhost (p5486CF8B.dip0.t-ipconnect.de [84.134.207.139]) by pokefinder.org (Postfix) with ESMTPSA id 134CD2C05BA; Tue, 7 Jan 2020 11:29:55 +0100 (CET) Date: Tue, 7 Jan 2020 11:29:54 +0100 From: Wolfram Sang To: Julia Lawall Cc: Maxime Ripard , michal.lkml@markovi.net, Gilles.Muller@lip6.fr, Tomi Valkeinen , Mark Brown , nicolas.palix@imag.fr, linux-kernel@vger.kernel.org, Jani Nikula , Julia.Lawall@lip6.fr, Thierry Reding , cocci@systeme.lip6.fr Subject: Re: [Cocci] [PATCH] coccinnelle: Remove ptr_ret script Message-ID: <20200107102954.GB1135@ninjato> References: <20200107073629.325249-1-maxime@cerno.tech> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Y7xTucakfITjPcLV" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Y7xTucakfITjPcLV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 07, 2020 at 11:06:56AM +0100, Julia Lawall wrote: >=20 >=20 > On Tue, 7 Jan 2020, Maxime Ripard wrote: >=20 > > The ptr_ret script script addresses a number of situations where we end= up > > testing an error pointer, and if it's an error returning it, or return 0 > > otherwise to transform it into a PTR_ERR_OR_ZERO call. > > > > So it will convert a block like this: > > > > if (IS_ERR(err)) > > return PTR_ERR(err); > > > > return 0; > > > > into > > > > return PTR_ERR_OR_ZERO(err); > > > > While this is technically correct, it has a number of drawbacks. First,= it > > merges the error and success path, which will make it harder for a revi= ewer > > or reader to grasp. > > > > It's also more difficult to extend if we were to add some code between = the > > error check and the function return, making the author essentially reve= rt > > that patch before adding new lines, while it would have been a trivial > > addition otherwise for the rewiever. > > > > Therefore, since that script is only about cosmetic in the first place, > > let's remove it since it's not worth it. > > > > Cc: Jani Nikula > > Cc: Thierry Reding > > Cc: Tomi Valkeinen > > Cc: Mark Brown > > Signed-off-by: Maxime Ripard >=20 > Acked-by: Julia Lawall Convincing patch description, good catch! Reviewed-by: Wolfram Sang --Y7xTucakfITjPcLV Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAl4UXaIACgkQFA3kzBSg KbZSJA//eaZ9Y30oBx4dvR9MAfnqJNL8vx1eaSQyTcuwrb1agcOSP2yBfkZE+sH4 Co+Zly+1IjKpRE6r9zLFbv83rFFK4Lt6JA/L5tXTBIMxEXXA3Cb2plnpfsMbDq8I ah6RUroz4n46w1Kd5cU78RB813tchIizvvhdWIbuSUqgeE6FurBJOW0ybrNOYO+8 L9q9tM5rKGZIfEs68rxMIZnL+MkcO+47jykNqrJOrqsX87pVJtoiY7uuH36OvuUn 7bgC8LWQJvRG3U7wKyugqZhqkLCfqUN1dAtYCEZC0IcrzUfZO6HNOK4dzOg9W8Xd nVcLA7z0PEFDYdP1uMyprUT9HnwN4zktCF6Bm+xIMgMSI0ukiOaYnx4bFXMVecl0 JudONZisFLHZ9KzOfSzXhfv/Pltwzs0KUul8k6KYqRrHuC+lmFiV7juKccPX6Y3g FIjd2K5S3ITQDXrbixxfEhRFaqhOflgtvYoNnHZYs4F7SoSJx3iR7RLpyNdlKXjp fJWOohJo9xoOiphmueC6QO2hG18UXMEfP0CcJFUfU4WCGS//3rLlH9O/XZp2V/rU 9taGESdnSAubzx72/mvsi7fkYC/p5gvFFqRxOwFpDcOoaN0yrQ/2WlQ5//AazC0O ZwinD8thAFb1EA7fGSYeVv6+37e8EnAX0T2M6YPs30UBW4yYczo= =kiKB -----END PGP SIGNATURE----- --Y7xTucakfITjPcLV--