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 committed Oct 10, 2024
1 parent a4bce35 commit 9efae62
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/system/nuttx/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@

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 @@ -19,6 +19,7 @@ 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);
return ret;
Expand Down
6 changes: 6 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,
{
uint64_t value = 0;

metal_unused(order);
metal_io_block_read(io, offset, &value, width);
return value;
}
Expand All @@ -25,6 +26,7 @@ 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 +38,7 @@ static int metal_io_block_read_(struct metal_io_region *io,
{
void *va = metal_io_virt(io, offset);

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

metal_unused(order);
if (len == 1)
*(uint8_t *)va = *(uint8_t *)src;
else if (len == 2)
Expand All @@ -85,12 +89,14 @@ static void metal_io_block_set_(struct metal_io_region *io,
{
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 9efae62

Please sign in to comment.