include/drivers: remove implicit casts from api pointer initialization
C++ disallows implicit cast of void pointers to a non-void pointer type. Presence of implicit casts prevents use of these headers in C++ applications. Process: Run the following coccinelle script: @@ identifier V; identifier TAG =~ "driver_api"; type T; expression E; @@ T* V = +(T *) E->TAG; in this command line from $ZEPHYR_BASE: spatch --sp-file expcast.cocci \ --include-headers --dir include/ --very-quiet \ | sed -e '/^\+/s@\*) @*)@' \ | (cd include/ ; patch -p1) Signed-off-by: Peter A. Bigot <pab@pabigot.com>
This commit is contained in:
parent
6e260af889
commit
2e358f11d0
12 changed files with 49 additions and 49 deletions
|
@ -59,7 +59,7 @@ struct shared_irq_runtime {
|
|||
static inline int shared_irq_isr_register(struct device *dev, isr_t isr_func,
|
||||
struct device *isr_dev)
|
||||
{
|
||||
const struct shared_irq_driver_api *api = dev->driver_api;
|
||||
const struct shared_irq_driver_api *api = (const struct shared_irq_driver_api *)dev->driver_api;
|
||||
|
||||
return api->isr_register(dev, isr_func, isr_dev);
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ static inline int shared_irq_isr_register(struct device *dev, isr_t isr_func,
|
|||
*/
|
||||
static inline int shared_irq_enable(struct device *dev, struct device *isr_dev)
|
||||
{
|
||||
const struct shared_irq_driver_api *api = dev->driver_api;
|
||||
const struct shared_irq_driver_api *api = (const struct shared_irq_driver_api *)dev->driver_api;
|
||||
|
||||
return api->enable(dev, isr_dev);
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ static inline int shared_irq_enable(struct device *dev, struct device *isr_dev)
|
|||
*/
|
||||
static inline int shared_irq_disable(struct device *dev, struct device *isr_dev)
|
||||
{
|
||||
const struct shared_irq_driver_api *api = dev->driver_api;
|
||||
const struct shared_irq_driver_api *api = (const struct shared_irq_driver_api *)dev->driver_api;
|
||||
|
||||
return api->disable(dev, isr_dev);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue