Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3509527imw; Thu, 7 Jul 2022 03:04:02 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uSwSuRtk1UFqKTtTgD4G1pDxBSBFK7e+Xot6V9rzU9KoIUlBWdKIIQwyfIAA4AfAjypl4j X-Received: by 2002:a17:90b:1e4d:b0:1ed:27b7:5450 with SMTP id pi13-20020a17090b1e4d00b001ed27b75450mr4325861pjb.164.1657188242584; Thu, 07 Jul 2022 03:04:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657188242; cv=none; d=google.com; s=arc-20160816; b=bGwdHkSh/y4Qht5Dnldfo1phZmg97SJBmXk7aYeCwc+KXYVwXvKcvQN+vOKTbzxMPN HEbpJkqhkjxNT2Ftkz3Pe0O7acEUR3wnXPziMME40Ab2X5VW0zcyumZz5OQwBj2KMh3/ NDMKnr5TuInXjYE9drZXwzfiSvLlmOL1HfOF412mgPzlXatKQoZbg3pwY+IBcm9ng/90 HISHLfPCCszOReOoUXtcwj5Qdwu3n6Yuok1ZqvLvvAxfV1DY6ierhTSRixY5lTPe+e1+ a0kSuKMTQtbJM+L3s7Sz/y+puuNvgUn5DxfbwkRz7tRDP1Z6elusrb6ywzGkKcGvINK7 06SA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=ubih761XnwxtPXbFuQJ8YQAwsyvkemQJbsj1CXQ0KXw=; b=LVfUkI5yh9JJvZGuBQnq5nZwx64/KxM+05iAQNEbaLDn6luFMzAtDYujYI2RNw11jw /Q1rI+xPpMXfhO1IAnmTnLdpKqrVsG7M3Nx8i6JlhjlijNDagVQ3wkqw1wmTJdQpxqo8 ANfGm62Fj2wS7Vzvrode0luQiy5A2UQrqKJf7SYHodkCMTbnysA5pOOkPS7BTo3XIxwF C4j8jOCTWhUq46cHggkNKIjIcyT4jdFINWsJOw3rCoL+s26nuBrfy13wrQ/emZcSpel2 /D/ehv7yEL9FPiIwViP0tWfLiO6jA3bBFI6HlA+IkZkhOUTGACxNW2rmkJAKNy8Hi/b8 hP6Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u2-20020a62ed02000000b00528bf815becsi4762805pfh.291.2022.07.07.03.03.49; Thu, 07 Jul 2022 03:04:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235170AbiGGJUv (ORCPT + 99 others); Thu, 7 Jul 2022 05:20:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230222AbiGGJUt (ORCPT ); Thu, 7 Jul 2022 05:20:49 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C10A932EC7 for ; Thu, 7 Jul 2022 02:20:47 -0700 (PDT) Received: from dude02.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::28]) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1o9Ngi-0006DF-SW; Thu, 07 Jul 2022 11:20:44 +0200 From: Philipp Zabel To: Julia Lawall , Nicolas Palix Cc: linux-kernel@vger.kernel.org, cocci@inria.fr, Philipp Zabel Subject: [PATCH] coccinelle: api: explicitly request exclusive reset controls Date: Thu, 7 Jul 2022 11:20:30 +0200 Message-Id: <20220707092030.3319988-1-p.zabel@pengutronix.de> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2a0a:edc0:0:1101:1d::28 X-SA-Exim-Mail-From: p.zabel@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Match deprecated reset_control_get API calls and replace them with the corresponding _exclusive variants with the reset-exclusive.cocci rule, to hopefully advance the API transition started with commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting reset lines"). Signed-off-by: Philipp Zabel --- scripts/coccinelle/api/reset-exclusive.cocci | 49 ++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 scripts/coccinelle/api/reset-exclusive.cocci diff --git a/scripts/coccinelle/api/reset-exclusive.cocci b/scripts/coccinelle/api/reset-exclusive.cocci new file mode 100644 index 000000000000..c5d6938ca542 --- /dev/null +++ b/scripts/coccinelle/api/reset-exclusive.cocci @@ -0,0 +1,49 @@ +// SPDX-License-Identifier: GPL-2.0-only +/// Explicitly request exclusive reset controls. The implicitly exclusive reset +/// control request functions are deprecated. +/// +// Confidence: High +// Copyright: (C) 2022 Philipp Zabel. +// Comments: +// Options: --no-includes --include-headers +// Keywords: reset_control_get + +virtual patch +virtual report + +@depends on patch@ +expression x; +@@ + + x = +( +-devm_reset_control_get ++devm_reset_control_get_exclusive +| +-devm_reset_control_get_optional ++devm_reset_control_get_optional_exclusive +| +-of_reset_control_get ++of_reset_control_get_exclusive +| +-of_reset_control_get_by_index ++of_reset_control_get_exclusive_by_index +| +-devm_reset_control_get_by_index ++devm_reset_control_get_exclusive_by_index +) + (...) + +@r depends on !patch exists@ +expression x; +position p; +@@ + +*x = \(devm_reset_control_get@p\|devm_reset_control_get_optional@p\|of_reset_control_get@p\|of_rset_control_get_by_index@p\|devm_reset_control_get_by_index@p\)(...) + +@script:python depends on report@ +p << r.p; +@@ + +msg = "ERROR: explicitly request exclusive reset controls with reset_control_get_exclusive() and variants" +coccilib.report.print_report(p[0], msg) -- 2.30.2