Skip to content

Commit

Permalink
lib: system: nuttx: fix undeclared parameter compile error
Browse files Browse the repository at this point in the history
Fix compile error:
/nuttx/openamp/libmetal/lib/system/nuttx/device.c:16:22: error:
'io' undeclared (first use in this function)
   16 |         metal_unused(io);
/nuttx/openamp/libmetal/lib/system/nuttx/device.c:14:53: error:
unused parameter 'dev' [-Werror=unused-parameter]
   14 | int metal_generic_dev_sys_open(struct metal_device *dev)
...

Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
  • Loading branch information
wyr-7 authored and arnopo committed Oct 18, 2024
1 parent 0f03935 commit e2c504f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/system/nuttx/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,7 @@

int metal_generic_dev_sys_open(struct metal_device *dev)
{
metal_unused(dev);

return 0;
}
1 change: 1 addition & 0 deletions lib/system/nuttx/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ struct metal_state _metal;
int metal_sys_init(const struct metal_init_params *params)
{
int ret = metal_cntr_irq_init();
metal_unused(params);

if (ret >= 0)
ret = metal_bus_register(&metal_generic_bus);
Expand Down
7 changes: 7 additions & 0 deletions lib/system/nuttx/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ static uint64_t metal_io_read_(struct metal_io_region *io,
int width)
{
uint64_t value = 0;
metal_unused(order);

metal_io_block_read(io, offset, &value, width);
return value;
Expand All @@ -26,6 +27,8 @@ static void metal_io_write_(struct metal_io_region *io,
memory_order order,
int width)
{
metal_unused(order);

metal_io_block_write(io, offset, &value, width);
}

Expand All @@ -36,6 +39,7 @@ static int metal_io_block_read_(struct metal_io_region *io,
int len)
{
void *va = metal_io_virt(io, offset);
metal_unused(order);

metal_cache_invalidate(va, len);
if (len == 1)
Expand All @@ -60,6 +64,7 @@ static int metal_io_block_write_(struct metal_io_region *io,
int len)
{
void *va = metal_io_virt(io, offset);
metal_unused(order);

if (len == 1)
*(uint8_t *)va = *(uint8_t *)src;
Expand All @@ -85,13 +90,15 @@ static void metal_io_block_set_(struct metal_io_region *io,
int len)
{
void *va = metal_io_virt(io, offset);
metal_unused(order);

memset(va, value, len);
metal_cache_flush(va, len);
}

static void metal_io_close_(struct metal_io_region *io)
{
metal_unused(io);
}

static metal_phys_addr_t metal_io_offset_to_phys_(struct metal_io_region *io,
Expand Down
3 changes: 3 additions & 0 deletions lib/system/nuttx/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#ifndef __METAL_NUTTX_IO__H__
#define __METAL_NUTTX_IO__H__

#include <metal/utilities.h>

#ifdef __cplusplus
extern "C" {
#endif
Expand All @@ -39,6 +41,7 @@ struct metal_io_region *metal_io_get_region(void);
*/
static inline void metal_sys_io_mem_map(struct metal_io_region *io)
{
metal_unused(io);
}
#endif

Expand Down

0 comments on commit e2c504f

Please sign in to comment.