Skip to content

Commit 347b564

Browse files
krzkakpm00
authored andcommitted
coccinelle: of_table: handle SPI device ID tables
'struct spi_device_id' tables also need to be NULL terminated. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Krzysztof Kozlowski <[email protected]> Cc: Julia Lawall <[email protected]> Cc: Nathan Chancellor <[email protected]> Cc: Nicolas Palix <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 04ae01a commit 347b564

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

scripts/coccinelle/misc/of_table.cocci

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: GPL-2.0
2-
/// Make sure (of/i2c/platform)_device_id tables are NULL terminated
2+
/// Make sure (of/i2c/platform/spi)_device_id tables are NULL terminated
33
//
44
// Keywords: of_table i2c_table platform_table
55
// Confidence: Medium
@@ -15,14 +15,14 @@ identifier var, arr;
1515
expression E;
1616
@@
1717
(
18-
struct \(of_device_id \| i2c_device_id \| platform_device_id\) arr[] = {
18+
struct \(of_device_id \| i2c_device_id \| platform_device_id \| spi_device_id\) arr[] = {
1919
...,
2020
{
2121
.var = E,
2222
* }
2323
};
2424
|
25-
struct \(of_device_id \| i2c_device_id \| platform_device_id\) arr[] = {
25+
struct \(of_device_id \| i2c_device_id \| platform_device_id \| spi_device_id\) arr[] = {
2626
...,
2727
* { ..., E, ... },
2828
};
@@ -33,7 +33,7 @@ identifier var, arr;
3333
expression E;
3434
@@
3535
(
36-
struct \(of_device_id \| i2c_device_id \| platform_device_id\) arr[] = {
36+
struct \(of_device_id \| i2c_device_id \| platform_device_id \| spi_device_id\) arr[] = {
3737
...,
3838
{
3939
.var = E,
@@ -42,7 +42,7 @@ struct \(of_device_id \| i2c_device_id \| platform_device_id\) arr[] = {
4242
+ { }
4343
};
4444
|
45-
struct \(of_device_id \| i2c_device_id \| platform_device_id\) arr[] = {
45+
struct \(of_device_id \| i2c_device_id \| platform_device_id \| spi_device_id\) arr[] = {
4646
...,
4747
{ ..., E, ... },
4848
+ { },
@@ -55,15 +55,15 @@ identifier var, arr;
5555
expression E;
5656
@@
5757
(
58-
struct \(of_device_id \| i2c_device_id \| platform_device_id\) arr[] = {
58+
struct \(of_device_id \| i2c_device_id \| platform_device_id \| spi_device_id\) arr[] = {
5959
...,
6060
{
6161
.var = E,
6262
}
6363
@p1
6464
};
6565
|
66-
struct \(of_device_id \| i2c_device_id \| platform_device_id\) arr[] = {
66+
struct \(of_device_id \| i2c_device_id \| platform_device_id \| spi_device_id\) arr[] = {
6767
...,
6868
{ ..., E, ... }
6969
@p1

0 commit comments

Comments
 (0)