Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3204756pxu; Tue, 15 Dec 2020 00:57:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJzsPgY1dXnwrOb9evRcl/FxnTVZauGSXDrYTPhk3BEOl2/m6iYcqUQgMklhXCk5bQVyYYjf X-Received: by 2002:a50:ec18:: with SMTP id g24mr1423124edr.6.1608022679677; Tue, 15 Dec 2020 00:57:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608022679; cv=none; d=google.com; s=arc-20160816; b=FvNVgZALnH4xfh9mbK0cLwRWxO/sIno1BVuB1XD7PRYGxHxX3yBmTs4bE8IYe6RmpP eoa0wPcWnCIIlGl6hesZQfA8T4IrMI9t0J67kbzPuVbwZTwXupN9qKpacIVvOxR5P7N8 L9b8ebMNNT2cshnFAJmo/qXX/bSwKZZt6tEp37HqBAZWM17Pv7TINj2NqjmGh6BAiBTM tZYhS61oJVGxndejpky9B7YC7kMwoSmqKDcaQ6ovNIzB7B+e2d4DX0zf/0F0Bg12F6iQ 5ps7O10sV6sQPdrj6rx0gyW+rjk7sAE8gIGcc40Uk7U2+dQY4RAPvxDduR46i8ns/eJP Hp/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date; bh=Nj5wglUpX30GhKi91Al7UBtc0b6kcbnhjyKnGjQwHb8=; b=nCevz0WwLNrv2g90aW0q1dXwDsOEFbtYy2WugY/a5ldueGHDZYMtMN8LaQdE9egXzt K6DckEWgO+GUptwH2glFmsREQGLvLiEqNjYHGoSoQftUQruhEj3+bWMILwHeirqHkRi9 NrnTQo/VV6V7bPC4bw3VfmZRmiNY2iQK8LMgKOmqpSBjo6iOr279zjNTCvH9XpKmyA49 F77ZLxvGu+Eqsgzl6bVMB2HK2qn4iSxXlou3sG01WCY8hUZLwW3a9PiDLOfGGdZA52vs dxATxvs4bEHrvW8AqNHjHq8txa9gXbWOUbAo2IglvTcdcrVihRZ81L8w5YJ45tx/0iey /okA== 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 g8si557295eje.472.2020.12.15.00.57.34; Tue, 15 Dec 2020 00:57:59 -0800 (PST) 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 S1727370AbgLOIxT (ORCPT + 99 others); Tue, 15 Dec 2020 03:53:19 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:55109 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726982AbgLOIxS (ORCPT ); Tue, 15 Dec 2020 03:53:18 -0500 X-IronPort-AV: E=Sophos;i="5.78,420,1599516000"; d="scan'208";a="483005226" Received: from 173.121.68.85.rev.sfr.net (HELO hadrien) ([85.68.121.173]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Dec 2020 09:52:36 +0100 Date: Tue, 15 Dec 2020 09:52:36 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: Maxime Ripard cc: Wolfram Sang , michal.lkml@markovi.net, Gilles.Muller@lip6.fr, Mark Brown , nicolas.palix@imag.fr, linux-kernel@vger.kernel.org, Jani Nikula , Julia Lawall , Tomi Valkeinen , Thierry Reding , cocci@systeme.lip6.fr Subject: Re: [Cocci] [PATCH] coccinnelle: Remove ptr_ret script In-Reply-To: <20201215084823.towbaqay5tgdh7dw@gilmour> Message-ID: References: <20200107073629.325249-1-maxime@cerno.tech> <20200107102954.GB1135@ninjato> <20201215084823.towbaqay5tgdh7dw@gilmour> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 15 Dec 2020, Maxime Ripard wrote: > Hi, > > On Tue, Jan 07, 2020 at 11:29:54AM +0100, Wolfram Sang wrote: > > On Tue, Jan 07, 2020 at 11:06:56AM +0100, Julia Lawall wrote: > > > > > > > > > On Tue, 7 Jan 2020, Maxime Ripard wrote: > > > > > > > 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 reviewer > > > > 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 revert > > > > 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 > > > > > > Acked-by: Julia Lawall > > > > Convincing patch description, good catch! > > > > Reviewed-by: Wolfram Sang > > It looks like this patch was never applied, whose tree should it go > through? Sorry. I can take it. I'm not sure that I still have the original message, though. If you have it handy, that would be helpful. julia