Skip to content

Commit

Permalink
Add __maybe_unused attribute
Browse files Browse the repository at this point in the history
And then apply it in src/register.c:io_uring_register_buf_ring() as we
don't currently use the flags argument.

Link: #622
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
axboe committed Jun 30, 2022
1 parent 41d82e1 commit 98c14a0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
})
#endif

#define __maybe_unused __attribute__((__unused__))

void *__uring_malloc(size_t len);
void __uring_free(void *p);

Expand Down
3 changes: 2 additions & 1 deletion src/register.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,8 @@ int io_uring_unregister_ring_fd(struct io_uring *ring)
}

int io_uring_register_buf_ring(struct io_uring *ring,
struct io_uring_buf_reg *reg, unsigned int flags)
struct io_uring_buf_reg *reg,
unsigned int __maybe_unused flags)
{
return ____sys_io_uring_register(ring->ring_fd,
IORING_REGISTER_PBUF_RING, reg, 1);
Expand Down

0 comments on commit 98c14a0

Please sign in to comment.