From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755170AbbESL7F (ORCPT ); Tue, 19 May 2015 07:59:05 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:36169 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752786AbbESL7C (ORCPT ); Tue, 19 May 2015 07:59:02 -0400 X-AuditID: cbfec7f5-f794b6d000001495-1b-555b2583a512 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, Daniel Granat Subject: [PATCH v3] 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, 19 May 2015 13:58:49 +0200 Message-id: <1432036729-20809-1-git-send-email-d.granat@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1425043313-15844-1-git-send-email-d.granat@samsung.com> References: <1425043313-15844-1-git-send-email-d.granat@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuplluLIzCtJLcpLzFFi42I5/e/4Fd1m1ehQgy2rNC1+bFrNZjHhkbHF 7J+XmCyWPTjNaHF51xw2i2MvlzM5sHkcO9bK7LF3S5ZH35ZVjB6Plt1n8fi8SS6ANYrLJiU1 J7MstUjfLoEr48mSCUwFH3krLmzdy9jA2MTdxcjJISFgInF9xl4mCFtM4sK99WxdjFwcQgJL GSXevG9kh3CamCQO7TjHBlLFJqAlcfnOA7AOEQFfiQt7prOA2MwCERKrHixnAWkQFtjLKHFu +kKgbg4OFgFViVmNmiA1vAIuEgemtzBCbJOTOHlsMiuIzSngKnF1wy6wmUJANVN7OxknMPIu YGRYxSiaWppcUJyUnmukV5yYW1yal66XnJ+7iRESSF93MC49ZnWIUYCDUYmH9wd3dKgQa2JZ cWXuIUYJDmYlEV5xkBBvSmJlVWpRfnxRaU5q8SFGaQ4WJXHembvehwgJpCeWpGanphakFsFk mTg4pRoYG1VkC0QqsnTK1zEd0Z7O/G87r5PAlU81GrJzp2VWFggcPlc96cOVw0KBc9d12XsJ Za9huX6ZY8HROfw83r/CVFbIbRG8f2jlDDu269Mjboqo9S49ya/zJEvg46xvefeT1in3BrUn liZevmvJf0HsTBHHF+7f1zq6E+N3T7hrOtfW5JF28lw9JZbijERDLeai4kQA02c0IyACAAA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Daniel Granat --- scripts/coccinelle/misc/of_table.cocci | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/scripts/coccinelle/misc/of_table.cocci b/scripts/coccinelle/misc/of_table.cocci index 3c93404..74f7dbb 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,7 +13,7 @@ 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, @@ -24,7 +24,8 @@ struct of_device_id arr[] = { 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 +33,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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: d.granat@samsung.com (Daniel Granat) Date: Tue, 19 May 2015 13:58:49 +0200 Subject: [Cocci] [PATCH v3] Added tables i2c_device_id and platform_device_id for checking. Extend checking on tables containing structures which are initialized without specifying member name. In-Reply-To: <1425043313-15844-1-git-send-email-d.granat@samsung.com> References: <1425043313-15844-1-git-send-email-d.granat@samsung.com> Message-ID: <1432036729-20809-1-git-send-email-d.granat@samsung.com> To: cocci@systeme.lip6.fr List-Id: cocci@systeme.lip6.fr Signed-off-by: Daniel Granat --- scripts/coccinelle/misc/of_table.cocci | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/scripts/coccinelle/misc/of_table.cocci b/scripts/coccinelle/misc/of_table.cocci index 3c93404..74f7dbb 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,7 +13,7 @@ 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, @@ -24,7 +24,8 @@ struct of_device_id arr[] = { 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 +33,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