Skip to content

Commit

Permalink
soc: intel_adsp: added casting for C++ compiler in soc.h
Browse files Browse the repository at this point in the history
Header soc.h is included during C++ source file compilation
and required adding C++ casts as implicit casting from void*
is forbidden. Fixed minor warning comparing signed with unsigned
integer.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
  • Loading branch information
Andrey Borisovich committed Jul 6, 2022
1 parent aa87a95 commit a132e5d
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions soc/xtensa/intel_adsp/common/include/soc.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,11 @@ static ALWAYS_INLINE void z_idelay(int n)
/* memcopy used by boot loader */
static ALWAYS_INLINE void bmemcpy(void *dest, void *src, size_t bytes)
{
uint32_t *d = dest;
uint32_t *s = src;
int i;
uint32_t *d = (uint32_t *)dest;
uint32_t *s = (uint32_t *)src;

z_xtensa_cache_inv(src, bytes);
for (i = 0; i < (bytes >> 2); i++)
for (size_t i = 0; i < (bytes >> 2); i++)
d[i] = s[i];

z_xtensa_cache_flush(dest, bytes);
Expand All @@ -150,10 +149,9 @@ static ALWAYS_INLINE void bmemcpy(void *dest, void *src, size_t bytes)
/* bzero used by bootloader */
static ALWAYS_INLINE void bbzero(void *dest, size_t bytes)
{
uint32_t *d = dest;
int i;
uint32_t *d = (uint32_t *)dest;

for (i = 0; i < (bytes >> 2); i++)
for (size_t i = 0; i < (bytes >> 2); i++)
d[i] = 0;

z_xtensa_cache_flush(dest, bytes);
Expand Down

0 comments on commit a132e5d

Please sign in to comment.