Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1055652ybc; Tue, 19 Nov 2019 13:45:40 -0800 (PST) X-Google-Smtp-Source: APXvYqwL9nhAdVUIY9MUxdL4LKEjVH0/zBf7/xdfxx2kXhhGmDJNIabpFVhU3PpY2ZHR92FIiknX X-Received: by 2002:a05:6000:1083:: with SMTP id y3mr38369035wrw.290.1574199940306; Tue, 19 Nov 2019 13:45:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574199940; cv=none; d=google.com; s=arc-20160816; b=gSUWVivh/sgjPqtn07q5WOhPZlD1ZvhrUlwk5L++7uR7CI7DK17+ZBKD4/Rps63YQi aDhDlQFaI4zmpKVJTq/HCb7X0QRP0RWcRyVzUNxcI+TFo0pjM9oEaCUhomQpCmErdLRv qnK/BUeVojq/xlZL5clE2szJFpSKOthakTKkUlBtiIIg0Z2nStRxNGwy2BrB1DTFgocO tUydnELDEjq0VFts74ADk4mqw9XCrKcBlMIiiEMkXAz6QMf+aZFzJazlB0cbxlTd5aMU tZM08G7j3yhpKN6gnxot+m5vAF5Vxt+HtzxRLSD73dUbxamaGMojvzzNsHjElsZv/7z0 yUNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=bsqk181aodrxkxQeYFSudy3+OJ19z1Rxl4GC3lK23No=; b=HoCFFzHh8FeGdLxqnHaxUWltXX2OnWyEpMrKyk3POwtE3iQ1/29iiZN6SjoCEAaFL9 Dnvxzhu/I0qanR3JnvNluIXtaAThOrLX5ItpgaErQd7ezmf/fl0TdWtDPrxteYdPuQ+A yLkbcF8ibk7EXGdVBWHr8gyYmIbMAcfGc6a+ISe5C15G5aK8VP6iQUSBsXhvKyVaH1My fSNSZ51wW/i3LwuN6shF6McPdmnqKTFnC7pQsC/RsPMn6a9S9fu0ys6r1hepGGypt8bD bAyxqGk7APkV9kfi0qXbjut551DuDXelcnQ/mpYB/KBSbWmiVuEUu0b78ewynNhaSk8X oj+Q== 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 l64si17995066edl.306.2019.11.19.13.45.15; Tue, 19 Nov 2019 13:45:40 -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 S1727417AbfKSVoI (ORCPT + 99 others); Tue, 19 Nov 2019 16:44:08 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:37891 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726892AbfKSVoH (ORCPT ); Tue, 19 Nov 2019 16:44:07 -0500 X-IronPort-AV: E=Sophos;i="5.69,219,1571695200"; d="scan'208";a="412575413" Received: from palace.lip6.fr ([132.227.105.202]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/AES128-SHA256; 19 Nov 2019 22:44:04 +0100 From: Julia Lawall To: Masahiro Yamada Cc: kernel-janitors@vger.kernel.org, Gilles Muller , Nicolas Palix , Michal Marek , cocci@systeme.lip6.fr, linux-kernel@vger.kernel.org Subject: [PATCH 2/4 v2] coccinelle: platform_get_irq: handle 2-statement branches Date: Tue, 19 Nov 2019 22:08:23 +0100 Message-Id: <1574197705-31132-3-git-send-email-Julia.Lawall@lip6.fr> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1574197705-31132-1-git-send-email-Julia.Lawall@lip6.fr> References: <1574197705-31132-1-git-send-email-Julia.Lawall@lip6.fr> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Treat separately the case where there is only one other statement in the branch, to be able to remove the outer {} as well. Signed-off-by: Julia Lawall --- v2: fix From and To (very sorry for the mistake) scripts/coccinelle/api/platform_get_irq.cocci | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/scripts/coccinelle/api/platform_get_irq.cocci b/scripts/coccinelle/api/platform_get_irq.cocci index c6ac755..7ac32ee 100644 --- a/scripts/coccinelle/api/platform_get_irq.cocci +++ b/scripts/coccinelle/api/platform_get_irq.cocci @@ -31,6 +31,25 @@ if ( \( ret < 0 \| ret <= 0 \) ) @depends on patch@ expression ret; struct platform_device *E; +statement S; +@@ + +ret = +( +platform_get_irq +| +platform_get_irq_byname +)(E, ...); + +if ( \( ret < 0 \| ret <= 0 \) ) +-{ +-dev_err(...); +S +-} + +@depends on patch@ +expression ret; +struct platform_device *E; @@ ret =