Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932523AbbFBQLp (ORCPT ); Tue, 2 Jun 2015 12:11:45 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:27567 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753814AbbFBQLg (ORCPT ); Tue, 2 Jun 2015 12:11:36 -0400 X-AuditID: cbfec7f5-f794b6d000001495-50-556dd5b58cb4 From: Daniel Granat To: Julia.Lawall@lip6.fr, cocci@systeme.lip6.fr, linux-kernel@vger.kernel.org Cc: Gilles.Muller@lip6.fr, nicolas.palix@imag.fr, k.wrona@samsung.com, k.kozlowski@samsung.com, Daniel Granat Subject: [PATCH v4] Added tables i2c_device_id and platform_device_id for checking. Extend checking on tables containing structures which are initialized without specifying member name. Date: Tue, 02 Jun 2015 18:10:52 +0200 Message-id: <1433261452-27874-2-git-send-email-d.granat@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1433261452-27874-1-git-send-email-d.granat@samsung.com> References: <1432036729-20809-1-git-send-email-d.granat@samsung.com> <1433261452-27874-1-git-send-email-d.granat@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprGLMWRmVeSWpSXmKPExsVy+t/xq7pbr+aGGjR18ln82LSazWLCI2OL 2T8vMVkse3Ca0eL1C0OLU8v2M1lc3jWHzeLYy+VMDhwex461Mnvs3ZLl0bdlFaPHo2X3WTw+ b5ILYI3isklJzcksSy3St0vgylixv6rgHV/Fl3WzGBsYb3J3MXJySAiYSNyY9pIFwhaTuHBv PVsXIxeHkMBSRonvk/4wgSSEBJqYJO7Mjgex2QS0JC7feQAWFxHwlbiwZzoLSAOzQBujxJ7H bewgjrDAXkaJC3MWsoNUsQioSpxoOQpm8wq4SMy/PI0VYp2cxMljk8FsTgFXiZ8nZ7FCbKuX uHPxE9sERt4FjAyrGEVTS5MLipPSc430ihNzi0vz0vWS83M3MUJC6+sOxqXHrA4xCnAwKvHw MnzKCRViTSwrrsw9xCjBwawkwiu4ITdUiDclsbIqtSg/vqg0J7X4EKM0B4uSOO/MXe9DhATS E0tSs1NTC1KLYLJMHJxSDYybtCp+ckuqv1o7jWmW+LsNH1LKVoV+3MXkujRXIbSEZXPKZdXU uO79D74xmd/dtFjv9S6dreGnHseZZiQn5/H5LFrPxDrv+R8Oweiuj3a7DNfuOm0p8pOncP67 vD+8WdyzE6QbY6sjHPOebNI3T3h67eS/JWedFXfP45oZ8V3muE2t88Y9B3mVWIozEg21mIuK EwG5hn6oKQIAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2060 Lines: 92 Signed-off-by: Daniel Granat --- scripts/coccinelle/misc/of_table.cocci | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/scripts/coccinelle/misc/of_table.cocci b/scripts/coccinelle/misc/of_table.cocci index 3c93404..bc3c944 100644 --- a/scripts/coccinelle/misc/of_table.cocci +++ b/scripts/coccinelle/misc/of_table.cocci @@ -1,6 +1,6 @@ -/// Make sure of_device_id tables are NULL terminated +/// Make sure (of_device_id | i2c_device_id | platform_device_id) tables are NULL terminated // -// Keywords: of_table +// Keywords: of_table i2c_table platform_table // Confidence: Medium // Options: --include-headers @@ -13,18 +13,27 @@ virtual report identifier var, arr; expression E; @@ -struct of_device_id arr[] = { +( +struct \(of_device_id \| i2c_device_id \| platform_device_id\) arr[] = { ..., { .var = E, * } }; +| +struct \(of_device_id \| i2c_device_id \| platform_device_id\) arr[] = { + ..., + { ..., E, ... }, +* { }, +}; +) @depends on patch@ identifier var, arr; expression E; @@ -struct of_device_id arr[] = { +( +struct \(of_device_id \| i2c_device_id \| platform_device_id\) arr[] = { ..., { .var = E, @@ -32,19 +41,34 @@ struct of_device_id arr[] = { + }, + { } }; +| +struct \(of_device_id \| i2c_device_id \| platform_device_id\) arr[] = { + ..., + { ..., E, ... }, ++ { }, +}; +) @r depends on org || report@ position p1; identifier var, arr; expression E; @@ -struct of_device_id arr[] = { +( +struct \(of_device_id \| i2c_device_id \| platform_device_id\) arr[] = { ..., { .var = E, } @p1 }; +| +struct \(of_device_id \| i2c_device_id \| platform_device_id\) arr[] = { + ..., + { ..., E, ... } + @p1 +}; +) @script:python depends on org@ p1 << r.p1; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/