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:
Peter Bigot 2020-05-07 08:27:12 -05:00 committed by Carles Cufí
commit 93884a4fe1
4 changed files with 4 additions and 4 deletions

View file

@ -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) {

View file

@ -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);