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
|
@ -39,7 +39,7 @@ struct ptp_clock_driver_api {
|
|||
*/
|
||||
static inline int ptp_clock_set(struct device *dev, struct net_ptp_time *tm)
|
||||
{
|
||||
const struct ptp_clock_driver_api *api = dev->driver_api;
|
||||
const struct ptp_clock_driver_api *api = (const struct ptp_clock_driver_api *)dev->driver_api;
|
||||
|
||||
return api->set(dev, tm);
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ __syscall int ptp_clock_get(struct device *dev, struct net_ptp_time *tm);
|
|||
static inline int z_impl_ptp_clock_get(struct device *dev,
|
||||
struct net_ptp_time *tm)
|
||||
{
|
||||
const struct ptp_clock_driver_api *api = dev->driver_api;
|
||||
const struct ptp_clock_driver_api *api = (const struct ptp_clock_driver_api *)dev->driver_api;
|
||||
|
||||
return api->get(dev, tm);
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ static inline int z_impl_ptp_clock_get(struct device *dev,
|
|||
*/
|
||||
static inline int ptp_clock_adjust(struct device *dev, int increment)
|
||||
{
|
||||
const struct ptp_clock_driver_api *api = dev->driver_api;
|
||||
const struct ptp_clock_driver_api *api = (const struct ptp_clock_driver_api *)dev->driver_api;
|
||||
|
||||
return api->adjust(dev, increment);
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ static inline int ptp_clock_adjust(struct device *dev, int increment)
|
|||
*/
|
||||
static inline int ptp_clock_rate_adjust(struct device *dev, float rate)
|
||||
{
|
||||
const struct ptp_clock_driver_api *api = dev->driver_api;
|
||||
const struct ptp_clock_driver_api *api = (const struct ptp_clock_driver_api *)dev->driver_api;
|
||||
|
||||
return api->rate_adjust(dev, rate);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue