Skip to content

Commit 91c10f1

Browse files
rexutkartben
authored andcommitted
drivers: mipi-dbi-spi: rename underscored macro names
Rename _XFR_.*BITS and _WRITE_ONLY_ABSENT according to MISRA-C standard rules 21.1 and 21.2 (Zephyr rules 121 and 122). For details see Zephyr coding guidelines in table "Main rules". Signed-off-by: Stephan Linz <[email protected]>
1 parent 7cd7c82 commit 91c10f1

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

drivers/mipi_dbi/mipi_dbi_spi.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,26 +33,28 @@ struct mipi_dbi_spi_data {
3333
};
3434

3535
/* Expands to 1 if the node does not have the `write-only` property */
36-
#define _WRITE_ONLY_ABSENT(n) (!DT_INST_PROP(n, write_only)) |
36+
#define MIPI_DBI_SPI_WRITE_ONLY_ABSENT(n) (!DT_INST_PROP(n, write_only)) |
3737

3838
/* This macro will evaluate to 1 if any of the nodes with zephyr,mipi-dbi-spi
3939
* lack a `write-only` property. The intention here is to allow the entire
4040
* command_read function to be optimized out when it is not needed.
4141
*/
42-
#define MIPI_DBI_SPI_READ_REQUIRED DT_INST_FOREACH_STATUS_OKAY(_WRITE_ONLY_ABSENT) 0
42+
#define MIPI_DBI_SPI_READ_REQUIRED DT_INST_FOREACH_STATUS_OKAY(MIPI_DBI_SPI_WRITE_ONLY_ABSENT) 0
4343
uint32_t var = MIPI_DBI_SPI_READ_REQUIRED;
4444

4545
/* Expands to 1 if the node does reflect the enum in `xfr-min-bits` property */
46-
#define _XFR_8BITS(n) (DT_INST_STRING_UPPER_TOKEN(n, xfr_min_bits) == MIPI_DBI_SPI_XFR_8BIT) |
47-
#define _XFR_16BITS(n) (DT_INST_STRING_UPPER_TOKEN(n, xfr_min_bits) == MIPI_DBI_SPI_XFR_16BIT) |
46+
#define MIPI_DBI_SPI_XFR_8BITS(n) (DT_INST_STRING_UPPER_TOKEN(n, xfr_min_bits) \
47+
== MIPI_DBI_SPI_XFR_8BIT) |
48+
#define MIPI_DBI_SPI_XFR_16BITS(n) (DT_INST_STRING_UPPER_TOKEN(n, xfr_min_bits) \
49+
== MIPI_DBI_SPI_XFR_16BIT) |
4850

4951
/* This macros will evaluate to 1 if any of the nodes with zephyr,mipi-dbi-spi
5052
* have the `xfr-min-bits` property to corresponding enum value. The intention
5153
* here is to allow the write helper functions to be optimized out when not all
5254
* minimum transfer bits will be needed.
5355
*/
54-
#define MIPI_DBI_SPI_WRITE_8BIT_REQUIRED DT_INST_FOREACH_STATUS_OKAY(_XFR_8BITS) 0
55-
#define MIPI_DBI_SPI_WRITE_16BIT_REQUIRED DT_INST_FOREACH_STATUS_OKAY(_XFR_16BITS) 0
56+
#define MIPI_DBI_SPI_WRITE_8BIT_REQUIRED DT_INST_FOREACH_STATUS_OKAY(MIPI_DBI_SPI_XFR_8BITS) 0
57+
#define MIPI_DBI_SPI_WRITE_16BIT_REQUIRED DT_INST_FOREACH_STATUS_OKAY(MIPI_DBI_SPI_XFR_16BITS) 0
5658

5759
/* In Type C mode 1 MIPI BIT communication, the 9th bit of the word
5860
* (first bit sent in each word) indicates if the word is a command or

0 commit comments

Comments
 (0)