device: avoid casting away const from config_info pointer
The driver-specific config_info structure referenced from the device structure is marked const. Some drivers fail to preserve that qualifier when casting the pointer to the driver-specific structure, violating MISRA 11.8. Changes produced by scripts/coccinelle/const_config_info.cocci. Some changes proposed by the script are not included because they reveal mutation of state through the const pointer, though the code works as long as the driver-specific object is defined without the const qualifier. Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This commit is contained in:
parent
49e8c7080f
commit
4f16b419e8
18 changed files with 41 additions and 41 deletions
|
@ -20,7 +20,7 @@ extern "C" {
|
|||
#define MPXXDTYY_MAX_PDM_FREQ 3250000 /* 3.25MHz */
|
||||
|
||||
#define DEV_CFG(dev) \
|
||||
((struct mpxxdtyy_config *const)(dev)->config_info)
|
||||
((const struct mpxxdtyy_config *const)(dev)->config_info)
|
||||
#define DEV_DATA(dev) \
|
||||
((struct mpxxdtyy_data *const)(dev)->driver_data)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue