Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp449073ybi; Fri, 21 Jun 2019 02:23:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqxcpkLidu8gfGPO0O6NVFQPZeVIXeWh5Bo27EqUGsH5rPhA7mEUuopcYwm6nFKKjqiby2XB X-Received: by 2002:a63:4d05:: with SMTP id a5mr16186482pgb.19.1561108983642; Fri, 21 Jun 2019 02:23:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561108983; cv=none; d=google.com; s=arc-20160816; b=OGCX0zj38hh4H6GWmcZIrXB7q7CajFFc19Bdc215QLHPS2mczxULdv+HQZ67MhiXpl 0JHM2VO+euM5C6FQtnoMGq87tMMDTcs2U5mYgUuQ/fpgHZ7Zv1c8kCwM2mOSs+ZzC6f0 dbeHe6JkGE37FTeElgfK0EmuX6nYdI4oMVHvQAGhs2m2av6+g173BNXw843ZaJw2lVoV z35Y2REd+cw1+iB/BqoQE+CB9cD029RxDFPVe3mOS2SaWIjANs7Ahuwhf72pShQfus2e B6d9Vo2uPZ6V3hznt0+C+CSGc1aTayqYTZj11GqY8u8Reh7a7/gD6hz6/dElK9XGeZsZ gr3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=nh/DE1BaLg8E3v6QA0UoP3icBMKHCvKnx75WJk/T5NA=; b=PrdWj1Ey+DxWaSCSeQxzOWzayGp5XE/KAzF/2SQu9v2NeME6wdXFdQN0g/CxpjKqYK f7JOrZJNC8aTs+kqTMDdOJQYMxfbbcc1gGPwsoeB7fssvqrpi7lWNZMrU0RWOl0PDBSq cXq+jzHyxFnofyNOYbLpHYdvfMN9UZH8ilpKr8lFgWOP5z3srRM98XXyi+AHMkORjqhI Ox9c5g2Td2QTCQPnVCbgFUCgb3t8zBmVp6o+n9HiOhWn7BxbvcY7xVADKzDUd8NARqHY 8BHkGfQPpEkGUHec9F8o/cPB7KK9xRAGeUQaTlSxNCKKdoFrXHqEcSD6L5+DoPCTM7sS evjQ== 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 cp14si2205753plb.183.2019.06.21.02.22.48; Fri, 21 Jun 2019 02:23:03 -0700 (PDT) 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 S1726487AbfFUJVP (ORCPT + 99 others); Fri, 21 Jun 2019 05:21:15 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:35903 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726210AbfFUJVP (ORCPT ); Fri, 21 Jun 2019 05:21:15 -0400 X-IronPort-AV: E=Sophos;i="5.63,399,1557180000"; d="scan'208";a="388479067" Received: from vaio-julia.rsr.lip6.fr ([132.227.76.33]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Jun 2019 11:21:13 +0200 Date: Fri, 21 Jun 2019 11:21:11 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Markus Elfring cc: kernel-janitors@vger.kernel.org, Gilles Muller , Masahiro Yamada , Michal Marek , Nicolas Palix , Coccinelle , LKML , Ding Xiang Subject: Re: Coccinelle: Add a SmPL script for the reconsideration of redundant dev_err() calls In-Reply-To: <13890878-9e5f-f297-7f7c-bcc1212d83b7@web.de> Message-ID: References: <05d85182-7ec3-8fc1-4bcd-fd2528de3a40@web.de> <34d528db-5582-5fe2-caeb-89bcb07a1d30@web.de> <13890878-9e5f-f297-7f7c-bcc1212d83b7@web.de> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 21 Jun 2019, Markus Elfring wrote: > > I think that something like > > > > if (IS_ERR(e)) > > { > > <+... > > *dev_err(...) > > ...+> > > } > > > > would be more appropriate. Whether there is a return or not doesn't > > really matter. > > Do you find the following SmPL change specification useful and acceptable? > > > @deletion depends on patch@ > expression e; > @@ > e = devm_ioremap_resource(...); > if (IS_ERR(e)) > ( > -{ > - dev_err(...); > return (...); I still don't see the point of specifying return. Why not just S, where S is a statement metavariable? julia > -} > |{ I realize that you confuse conciseness with readability, but it would really look better to have the | on a line by itself. julia > <+... > - dev_err(...); > ...+> > } > ) > > > Would this approach need a version check for the Coccinelle software? Why would that be necessary?