Skip to content

Commit

Permalink
zephyr: spinlock: Fix compile time warnings
Browse files Browse the repository at this point in the history
With Zephyr, spinlock.h needs to know `struct k_spinlock`
definition.

Include, Zephyr's <kernel.h> header.

This fixes compile time warnings like this:

z/modules/audio/sof/zephyr/../src/include/sof/schedule/ll_schedule_domain.h:
In function 'domain_init'"
z/modules/audio/sof/zephyr/../src/include/sof/schedule/ll_schedule_domain.h:93:18:
warning: passing argument 1 of 'k_spinlock_init' from incompatible
pointer type [-Wincompatible-pointer-types]

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
  • Loading branch information
dbaluta authored and lgirdwood committed Feb 28, 2022
1 parent 57e0e14 commit ab715d8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/include/sof/spinlock.h
Expand Up @@ -166,6 +166,8 @@ void _k_spin_unlock_irq(struct k_spinlock *lock, k_spinlock_key_t key, int line)

#else

#include <kernel.h>

/* This has to be moved to Zephyr */
static inline void k_spinlock_init(struct k_spinlock *lock)
{
Expand Down

0 comments on commit ab715d8

Please sign in to comment.