Skip to content

Commit ada75b0

Browse files
anchaoxiaoxiang781216
authored andcommitted
drivers/rpmsg: fix compiler warning
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 <anchao.archer@bytedance.com>
1 parent 20f1513 commit ada75b0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/rpmsg/rpmsg_port_uart.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ rpmsg_port_uart_send_connect_req(FAR struct rpmsg_port_uart_s *rpuart)
216216
ssize_t ret = file_write(&rpuart->file, &ch, 1);
217217
if (ret != 1)
218218
{
219-
rpmsgerr("Send connect request failed, ret=%d\n", ret);
219+
rpmsgerr("Send connect request failed, ret=%zu\n", ret);
220220
PANIC();
221221
}
222222
}
@@ -232,7 +232,7 @@ rpmsg_port_uart_send_connect_ack(FAR struct rpmsg_port_uart_s *rpuart)
232232
ssize_t ret = file_write(&rpuart->file, &ch, 1);
233233
if (ret != 1)
234234
{
235-
rpmsgerr("Send connect ack failed, ret=%d\n", ret);
235+
rpmsgerr("Send connect ack failed, ret=%zu\n", ret);
236236
PANIC();
237237
}
238238
}

0 commit comments

Comments
 (0)