| From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> |
| Subject: coccinelle: of_table: handle SPI device ID tables |
| Date: Thu, 11 Sep 2025 21:33:55 +0200 |
| |
| 'struct spi_device_id' tables also need to be NULL terminated. |
| |
| Link: https://lkml.kernel.org/r/20250911193354.56262-2-krzysztof.kozlowski@linaro.org |
| Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> |
| Cc: Julia Lawall <julia.lawall@inria.fr> |
| Cc: Nathan Chancellor <nathan@kernel.org> |
| Cc: Nicolas Palix <nicolas.palix@imag.fr> |
| Signed-off-by: Andrew Morton <akpm@linux-foundation.org> |
| --- |
| |
| scripts/coccinelle/misc/of_table.cocci | 14 +++++++------- |
| 1 file changed, 7 insertions(+), 7 deletions(-) |
| |
| --- a/scripts/coccinelle/misc/of_table.cocci~coccinelle-of_table-handle-spi-device-id-tables |
| +++ a/scripts/coccinelle/misc/of_table.cocci |
| @@ -1,5 +1,5 @@ |
| // SPDX-License-Identifier: GPL-2.0 |
| -/// Make sure (of/i2c/platform)_device_id tables are NULL terminated |
| +/// Make sure (of/i2c/platform/spi)_device_id tables are NULL terminated |
| // |
| // Keywords: of_table i2c_table platform_table |
| // Confidence: Medium |
| @@ -15,14 +15,14 @@ identifier var, arr; |
| expression E; |
| @@ |
| ( |
| -struct \(of_device_id \| i2c_device_id \| platform_device_id\) arr[] = { |
| +struct \(of_device_id \| i2c_device_id \| platform_device_id \| spi_device_id\) arr[] = { |
| ..., |
| { |
| .var = E, |
| * } |
| }; |
| | |
| -struct \(of_device_id \| i2c_device_id \| platform_device_id\) arr[] = { |
| +struct \(of_device_id \| i2c_device_id \| platform_device_id \| spi_device_id\) arr[] = { |
| ..., |
| * { ..., E, ... }, |
| }; |
| @@ -33,7 +33,7 @@ identifier var, arr; |
| expression E; |
| @@ |
| ( |
| -struct \(of_device_id \| i2c_device_id \| platform_device_id\) arr[] = { |
| +struct \(of_device_id \| i2c_device_id \| platform_device_id \| spi_device_id\) arr[] = { |
| ..., |
| { |
| .var = E, |
| @@ -42,7 +42,7 @@ struct \(of_device_id \| i2c_device_id \ |
| + { } |
| }; |
| | |
| -struct \(of_device_id \| i2c_device_id \| platform_device_id\) arr[] = { |
| +struct \(of_device_id \| i2c_device_id \| platform_device_id \| spi_device_id\) arr[] = { |
| ..., |
| { ..., E, ... }, |
| + { }, |
| @@ -55,7 +55,7 @@ identifier var, arr; |
| expression E; |
| @@ |
| ( |
| -struct \(of_device_id \| i2c_device_id \| platform_device_id\) arr[] = { |
| +struct \(of_device_id \| i2c_device_id \| platform_device_id \| spi_device_id\) arr[] = { |
| ..., |
| { |
| .var = E, |
| @@ -63,7 +63,7 @@ struct \(of_device_id \| i2c_device_id \ |
| @p1 |
| }; |
| | |
| -struct \(of_device_id \| i2c_device_id \| platform_device_id\) arr[] = { |
| +struct \(of_device_id \| i2c_device_id \| platform_device_id \| spi_device_id\) arr[] = { |
| ..., |
| { ..., E, ... } |
| @p1 |
| _ |