You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The device config_info structure is intended to be read-only, and so
the generic pointer stored in struct device is a pointer-to-const.
The tlv320dac310x driver removes this qualifier when casting the pointer to
the device-specific type. This removal is a violation of MISRA 11.8
as it evokes undefined behavior.
When the qualifier is preserved the driver does not build, because it modifies the object content at runtime. Consequently the fix for this driver has been removed from #25248.
/home/buildslave/src/github.com/zephyrproject-rtos/zephyr/drivers/audio/tlv320dac310x.c: In function 'codec_initialize':
/home/buildslave/src/github.com/zephyrproject-rtos/zephyr/drivers/audio/tlv320dac310x.c:81:22: error: assignment of member 'i2c_device' in read-only object
81 | dev_cfg->i2c_device = device_get_binding(dev_cfg->i2c_dev_name);
| ^
/home/buildslave/src/github.com/zephyrproject-rtos/zephyr/drivers/audio/tlv320dac310x.c:89:23: error: assignment of member 'gpio_device' in read-only object
89 | dev_cfg->gpio_device = device_get_binding(dev_cfg->gpio_dev_name);
The driver must be updated to resolve this and incorporate the change from the referenced branch.
The text was updated successfully, but these errors were encountered:
This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.
The device config_info structure is intended to be read-only, and so
the generic pointer stored in struct device is a pointer-to-const.
The tlv320dac310x driver removes this qualifier when casting the pointer to
the device-specific type. This removal is a violation of MISRA 11.8
as it evokes undefined behavior.
When the qualifier is preserved the driver does not build, because it modifies the object content at runtime. Consequently the fix for this driver has been removed from #25248.
https://github.com/pabigot/zephyr/commits/nordic/issue/24745b provides
the changes necessary to preserve const correctness. When applied it
produces the following diagnostic, among others:
The driver must be updated to resolve this and incorporate the change from the referenced branch.
The text was updated successfully, but these errors were encountered: