Skip to content

drivers: eeprom: at2x: streamline codebase #158220

drivers: eeprom: at2x: streamline codebase

drivers: eeprom: at2x: streamline codebase #158220

Triggered via pull request October 31, 2024 07:59
Status Success
Total duration 2m 24s
Artifacts 1

compliance.yml

on: pull_request
Run compliance checks on patch series (PR)
2m 18s
Run compliance checks on patch series (PR)
Fit to window
Zoom out
Zoom in

Annotations

1 error, 1 warning, and 2 notices
Run compliance checks on patch series (PR)
Process completed with exit code 1.
Run compliance checks on patch series (PR): ClangFormat.txt#L1
See https://docs.zephyrproject.org/latest/contribute/guidelines.html#clang-format for more details. You may want to run clang-format on this change: - static const uint8_t rdsr[2] = { EEPROM_AT25_RDSR, 0 }; + static const uint8_t rdsr[2] = {EEPROM_AT25_RDSR, 0}; File:drivers/eeprom/eeprom_at2x.c Line:363 You may want to run clang-format on this change: -#define EEPROM_AT2X_DEVICE(n, t) \ - ASSERT_PAGESIZE_IS_POWER_OF_2(DT_PROP(INST_DT_AT2X(n, t), pagesize)); \ - ASSERT_SIZE_PAGESIZE_VALID(DT_PROP(INST_DT_AT2X(n, t), size), \ - DT_PROP(INST_DT_AT2X(n, t), pagesize)); \ - ASSERT_AT##t##_ADDR_W_VALID(DT_PROP(INST_DT_AT2X(n, t), \ - address_width)); \ - static const struct eeprom_at2x_config eeprom_at##t##_config_##n = { \ - .bus = EEPROM_AT##t##_BUS(n, t), \ - EEPROM_AT2X_WP_GPIOS(INST_DT_AT2X(n, t)) \ - .size = DT_PROP(INST_DT_AT2X(n, t), size), \ - .pagesize = DT_PROP(INST_DT_AT2X(n, t), pagesize), \ - .addr_width = DT_PROP(INST_DT_AT2X(n, t), address_width), \ - .readonly = DT_PROP(INST_DT_AT2X(n, t), read_only), \ - .timeout = DT_PROP(INST_DT_AT2X(n, t), timeout), \ - .bus_is_ready = eeprom_at##t##_bus_is_ready, \ - .read_fn = eeprom_at##t##_read, \ - .write_fn = eeprom_at##t##_write, \ - }; \ - static struct eeprom_at2x_data eeprom_at##t##_data_##n; \ - DEVICE_DT_DEFINE(INST_DT_AT2X(n, t), eeprom_at2x_init, \ - NULL, &eeprom_at##t##_data_##n, \ - &eeprom_at##t##_config_##n, POST_KERNEL, \ - CONFIG_EEPROM_AT2X_INIT_PRIORITY, \ - &eeprom_at2x_api) +#define EEPROM_AT2X_DEVICE(n, t) \ + ASSERT_PAGESIZE_IS_POWER_OF_2(DT_PROP(INST_DT_AT2X(n, t), pagesize)); \ + ASSERT_SIZE_PAGESIZE_VALID(DT_PROP(INST_DT_AT2X(n, t), size), \ + DT_PROP(INST_DT_AT2X(n, t), pagesize)); \ + ASSERT_AT##t##_ADDR_W_VALID(DT_PROP(INST_DT_AT2X(n, t), address_width)); \ + static const struct eeprom_at2x_config eeprom_at##t##_config_##n = { \ + .bus = EEPROM_AT##t##_BUS(n, t), \ + EEPROM_AT2X_WP_GPIOS(INST_DT_AT2X(n, t)).size = DT_PROP(INST_DT_AT2X(n, t), size), \ + .pagesize = DT_PROP(INST_DT_AT2X(n, t), pagesize), \ + .addr_width = DT_PROP(INST_DT_AT2X(n, t), address_width), \ + .readonly = DT_PROP(INST_DT_AT2X(n, t), read_only), \ + .timeout = DT_PROP(INST_DT_AT2X(n, t), timeout), \ + .bus_is_ready = eeprom_at##t##_bus_is_ready, \ + .read_fn = eeprom_at##t##_read, \ + .write_fn = eeprom_at##t##_write, \ + }; \ + static struct eeprom_at2x_data eeprom_at##t##_data_##n; \ + DEVICE_DT_DEFINE(INST_DT_AT2X(n, t), eeprom_at2x_init, NULL, &eeprom_at##t##_data_##n, \ + &eeprom_at##t##_config_##n, POST_KERNEL, \ + CONFIG_EEPROM_AT2X_INIT_PRIORITY, &eeprom_at2x_api) File:drivers/eeprom/eeprom_at2x.c Line:654
You may want to run clang-format on this change: drivers/eeprom/eeprom_at2x.c#L363
drivers/eeprom/eeprom_at2x.c:363 - static const uint8_t rdsr[2] = { EEPROM_AT25_RDSR, 0 }; + static const uint8_t rdsr[2] = {EEPROM_AT25_RDSR, 0};
You may want to run clang-format on this change: drivers/eeprom/eeprom_at2x.c#L654
drivers/eeprom/eeprom_at2x.c:654 -#define EEPROM_AT2X_DEVICE(n, t) \ - ASSERT_PAGESIZE_IS_POWER_OF_2(DT_PROP(INST_DT_AT2X(n, t), pagesize)); \ - ASSERT_SIZE_PAGESIZE_VALID(DT_PROP(INST_DT_AT2X(n, t), size), \ - DT_PROP(INST_DT_AT2X(n, t), pagesize)); \ - ASSERT_AT##t##_ADDR_W_VALID(DT_PROP(INST_DT_AT2X(n, t), \ - address_width)); \ - static const struct eeprom_at2x_config eeprom_at##t##_config_##n = { \ - .bus = EEPROM_AT##t##_BUS(n, t), \ - EEPROM_AT2X_WP_GPIOS(INST_DT_AT2X(n, t)) \ - .size = DT_PROP(INST_DT_AT2X(n, t), size), \ - .pagesize = DT_PROP(INST_DT_AT2X(n, t), pagesize), \ - .addr_width = DT_PROP(INST_DT_AT2X(n, t), address_width), \ - .readonly = DT_PROP(INST_DT_AT2X(n, t), read_only), \ - .timeout = DT_PROP(INST_DT_AT2X(n, t), timeout), \ - .bus_is_ready = eeprom_at##t##_bus_is_ready, \ - .read_fn = eeprom_at##t##_read, \ - .write_fn = eeprom_at##t##_write, \ - }; \ - static struct eeprom_at2x_data eeprom_at##t##_data_##n; \ - DEVICE_DT_DEFINE(INST_DT_AT2X(n, t), eeprom_at2x_init, \ - NULL, &eeprom_at##t##_data_##n, \ - &eeprom_at##t##_config_##n, POST_KERNEL, \ - CONFIG_EEPROM_AT2X_INIT_PRIORITY, \ - &eeprom_at2x_api) +#define EEPROM_AT2X_DEVICE(n, t) \ + ASSERT_PAGESIZE_IS_POWER_OF_2(DT_PROP(INST_DT_AT2X(n, t), pagesize)); \ + ASSERT_SIZE_PAGESIZE_VALID(DT_PROP(INST_DT_AT2X(n, t), size), \ + DT_PROP(INST_DT_AT2X(n, t), pagesize)); \ + ASSERT_AT##t##_ADDR_W_VALID(DT_PROP(INST_DT_AT2X(n, t), address_width)); \ + static const struct eeprom_at2x_config eeprom_at##t##_config_##n = { \ + .bus = EEPROM_AT##t##_BUS(n, t), \ + EEPROM_AT2X_WP_GPIOS(INST_DT_AT2X(n, t)).size = DT_PROP(INST_DT_AT2X(n, t), size), \ + .pagesize = DT_PROP(INST_DT_AT2X(n, t), pagesize), \ + .addr_width = DT_PROP(INST_DT_AT2X(n, t), address_width), \ + .readonly = DT_PROP(INST_DT_AT2X(n, t), read_only), \ + .timeout = DT_PROP(INST_DT_AT2X(n, t), timeout), \ + .bus_is_ready = eeprom_at##t##_bus_is_ready, \ + .read_fn = eeprom_at##t##_read, \ + .write_fn = eeprom_at##t##_write, \ + }; \ + static struct eeprom_at2x_data eeprom_at##t##_data_##n; \ + DEVICE_DT_DEFINE(INST_DT_AT2X(n, t), eeprom_at2x_init, NULL, &eeprom_at##t##_data_##n, \ + &eeprom_at##t##_config_##n, POST_KERNEL, \ + CONFIG_EEPROM_AT2X_INIT_PRIORITY, &eeprom_at2x_api)

Artifacts

Produced during runtime
Name Size
compliance.xml
1.18 KB