coccinelle: run int_ms_to_timeout conversion semantic patch
This fixes some cases where an integer timeout received as a parameter was not converted to a timeout before being used in standard API. Changes to the POSIX library were not included as that's being reworked in a separate PR. Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This commit is contained in:
parent
f77e03bb44
commit
93884a4fe1
4 changed files with 4 additions and 4 deletions
|
@ -289,7 +289,7 @@ int modem_socket_poll(struct modem_socket_config *cfg,
|
|||
return found_count;
|
||||
}
|
||||
|
||||
ret = k_sem_take(&cfg->sem_poll, msecs);
|
||||
ret = k_sem_take(&cfg->sem_poll, K_MSEC(msecs));
|
||||
for (i = 0; i < nfds; i++) {
|
||||
sock = modem_socket_from_fd(cfg, fds[i].fd);
|
||||
if (!sock) {
|
||||
|
|
|
@ -252,7 +252,7 @@ static ssize_t send_socket_data(struct modem_socket *sock,
|
|||
}
|
||||
|
||||
k_sem_reset(&mdata.sem_response);
|
||||
ret = k_sem_take(&mdata.sem_response, timeout);
|
||||
ret = k_sem_take(&mdata.sem_response, K_MSEC(timeout));
|
||||
|
||||
if (ret == 0) {
|
||||
ret = modem_cmd_handler_get_error(&mdata.cmd_handler_data);
|
||||
|
|
|
@ -586,7 +586,7 @@ static int esp_recv(struct net_context *context,
|
|||
return 0;
|
||||
}
|
||||
|
||||
ret = k_sem_take(&sock->sem_data_ready, timeout);
|
||||
ret = k_sem_take(&sock->sem_data_ready, K_MSEC(timeout));
|
||||
|
||||
sock->recv_cb = NULL;
|
||||
|
||||
|
|
|
@ -401,7 +401,7 @@ static int winc1500_connect(struct net_context *context,
|
|||
}
|
||||
|
||||
if (timeout != 0 &&
|
||||
k_sem_take(&w1500_data.socket_data[socket].wait_sem, timeout)) {
|
||||
k_sem_take(&w1500_data.socket_data[socket].wait_sem, K_MSEC(timeout))) {
|
||||
return -ETIMEDOUT;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue