Skip to content

Commit

Permalink
drivers/rpmsg: fix compiler warning
Browse files Browse the repository at this point in the history
In file included from nuttx/drivers/rpmsg/rpmsg_port_uart.c:27:
nuttx/drivers/rpmsg/rpmsg_port_uart.c: In function ‘rpmsg_port_uart_send_connect_req’:
nuttx/drivers/rpmsg/rpmsg_port_uart.c:219:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘ssize_t’ {aka ‘long int’} [-Wformat=]
  219 |       rpmsgerr("Send connect request failed, ret=%d\n", ret);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~
      |                                                         |
      |                                                         ssize_t {aka long int}
nuttx/drivers/rpmsg/rpmsg_port_uart.c:219:51: note: format string is defined here
  219 |       rpmsgerr("Send connect request failed, ret=%d\n", ret);
      |                                                  ~^
      |                                                   |
      |                                                   int
      |                                                  %ld
nuttx/drivers/rpmsg/rpmsg_port_uart.c: In function ‘rpmsg_port_uart_send_connect_ack’:
nuttx/drivers/rpmsg/rpmsg_port_uart.c:235:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘ssize_t’ {aka ‘long int’} [-Wformat=]
  235 |       rpmsgerr("Send connect ack failed, ret=%d\n", ret);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~
      |                                                     |
      |                                                     ssize_t {aka long int}
nuttx/drivers/rpmsg/rpmsg_port_uart.c:235:47: note: format string is defined here
  235 |       rpmsgerr("Send connect ack failed, ret=%d\n", ret);
      |                                              ~^
      |                                               |
      |                                               int
      |                                              %ld

Signed-off-by: chao an <[email protected]>
  • Loading branch information
anchao authored and xiaoxiang781216 committed Jan 22, 2025
1 parent 20f1513 commit ada75b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/rpmsg/rpmsg_port_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ rpmsg_port_uart_send_connect_req(FAR struct rpmsg_port_uart_s *rpuart)
ssize_t ret = file_write(&rpuart->file, &ch, 1);
if (ret != 1)
{
rpmsgerr("Send connect request failed, ret=%d\n", ret);
rpmsgerr("Send connect request failed, ret=%zu\n", ret);
PANIC();
}
}
Expand All @@ -232,7 +232,7 @@ rpmsg_port_uart_send_connect_ack(FAR struct rpmsg_port_uart_s *rpuart)
ssize_t ret = file_write(&rpuart->file, &ch, 1);
if (ret != 1)
{
rpmsgerr("Send connect ack failed, ret=%d\n", ret);
rpmsgerr("Send connect ack failed, ret=%zu\n", ret);
PANIC();
}
}
Expand Down

0 comments on commit ada75b0

Please sign in to comment.