coccinelle: re-run timeout conversion semantic patch
Run the int_literal_to_timeout Coccinelle script to fix places where it is clear that an integer duration is being passed where a timeout value is required. Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This commit is contained in:
parent
d4bb09c083
commit
ecf3bdb5b3
|
@ -609,7 +609,7 @@ static int lmp90xxx_adc_read_channel(struct device *dev, u8_t channel,
|
||||||
&adc_done);
|
&adc_done);
|
||||||
if (adc_done == 0xFFU) {
|
if (adc_done == 0xFFU) {
|
||||||
LOG_DBG("sleeping for 1 ms");
|
LOG_DBG("sleeping for 1 ms");
|
||||||
k_sleep(1);
|
k_sleep(K_MSEC(1));
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,7 @@ static int mdio_bus_wait(ETH_TypeDef *eth)
|
||||||
return -ETIMEDOUT;
|
return -ETIMEDOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
k_sleep(10);
|
k_sleep(K_MSEC(10));
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -127,7 +127,7 @@ static int phy_soft_reset(const struct phy_gecko_dev *phy)
|
||||||
return -ETIMEDOUT;
|
return -ETIMEDOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
k_sleep(50);
|
k_sleep(K_MSEC(50));
|
||||||
|
|
||||||
retval = phy_read(phy, MII_BMCR, &phy_reg);
|
retval = phy_read(phy, MII_BMCR, &phy_reg);
|
||||||
if (retval < 0) {
|
if (retval < 0) {
|
||||||
|
@ -228,7 +228,7 @@ int phy_gecko_auto_negotiate(const struct phy_gecko_dev *phy,
|
||||||
goto auto_negotiate_exit;
|
goto auto_negotiate_exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
k_sleep(100);
|
k_sleep(K_MSEC(100));
|
||||||
|
|
||||||
retval = phy_read(phy, MII_BMSR, &val);
|
retval = phy_read(phy, MII_BMSR, &val);
|
||||||
if (retval < 0) {
|
if (retval < 0) {
|
||||||
|
|
|
@ -94,11 +94,11 @@ void SX1276Reset(void)
|
||||||
gpio_pin_configure(dev_data.reset, GPIO_RESET_PIN,
|
gpio_pin_configure(dev_data.reset, GPIO_RESET_PIN,
|
||||||
GPIO_OUTPUT_ACTIVE | GPIO_RESET_FLAGS);
|
GPIO_OUTPUT_ACTIVE | GPIO_RESET_FLAGS);
|
||||||
|
|
||||||
k_sleep(1);
|
k_sleep(K_MSEC(1));
|
||||||
|
|
||||||
gpio_pin_set(dev_data.reset, GPIO_RESET_PIN, 0);
|
gpio_pin_set(dev_data.reset, GPIO_RESET_PIN, 0);
|
||||||
|
|
||||||
k_sleep(6);
|
k_sleep(K_MSEC(6));
|
||||||
}
|
}
|
||||||
|
|
||||||
void BoardCriticalSectionBegin(uint32_t *mask)
|
void BoardCriticalSectionBegin(uint32_t *mask)
|
||||||
|
@ -489,9 +489,9 @@ static int sx1276_lora_init(struct device *dev)
|
||||||
ret = gpio_pin_configure(dev_data.reset, GPIO_RESET_PIN,
|
ret = gpio_pin_configure(dev_data.reset, GPIO_RESET_PIN,
|
||||||
GPIO_OUTPUT_ACTIVE | GPIO_RESET_FLAGS);
|
GPIO_OUTPUT_ACTIVE | GPIO_RESET_FLAGS);
|
||||||
|
|
||||||
k_sleep(100);
|
k_sleep(K_MSEC(100));
|
||||||
gpio_pin_set(dev_data.reset, GPIO_RESET_PIN, 0);
|
gpio_pin_set(dev_data.reset, GPIO_RESET_PIN, 0);
|
||||||
k_sleep(100);
|
k_sleep(K_MSEC(100));
|
||||||
|
|
||||||
ret = sx1276_read(SX1276_REG_VERSION, ®val, 1);
|
ret = sx1276_read(SX1276_REG_VERSION, ®val, 1);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
|
|
|
@ -351,7 +351,7 @@ static int gsm_init(struct device *device)
|
||||||
|
|
||||||
k_delayed_work_init(&gsm->gsm_configure_work, gsm_configure);
|
k_delayed_work_init(&gsm->gsm_configure_work, gsm_configure);
|
||||||
|
|
||||||
(void)k_delayed_work_submit(&gsm->gsm_configure_work, 0);
|
(void)k_delayed_work_submit(&gsm->gsm_configure_work, K_NO_WAIT);
|
||||||
|
|
||||||
LOG_DBG("iface->read %p iface->write %p",
|
LOG_DBG("iface->read %p iface->write %p",
|
||||||
gsm->context.iface.read, gsm->context.iface.write);
|
gsm->context.iface.read, gsm->context.iface.write);
|
||||||
|
|
|
@ -189,7 +189,7 @@ int ccs811_init_interrupt(struct device *dev)
|
||||||
CONFIG_CCS811_THREAD_STACK_SIZE,
|
CONFIG_CCS811_THREAD_STACK_SIZE,
|
||||||
(k_thread_entry_t)irq_thread, dev,
|
(k_thread_entry_t)irq_thread, dev,
|
||||||
0, NULL, K_PRIO_COOP(CONFIG_CCS811_THREAD_PRIORITY),
|
0, NULL, K_PRIO_COOP(CONFIG_CCS811_THREAD_PRIORITY),
|
||||||
0, 0);
|
0, K_NO_WAIT);
|
||||||
#elif defined(CONFIG_CCS811_TRIGGER_GLOBAL_THREAD)
|
#elif defined(CONFIG_CCS811_TRIGGER_GLOBAL_THREAD)
|
||||||
drv_data->work.handler = work_cb;
|
drv_data->work.handler = work_cb;
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -258,7 +258,7 @@ static int _sock_send(struct esp_data *dev, struct esp_socket *sock)
|
||||||
k_sem_give(&dev->iface_data.rx_sem);
|
k_sem_give(&dev->iface_data.rx_sem);
|
||||||
|
|
||||||
/* Wait for '>' */
|
/* Wait for '>' */
|
||||||
ret = k_sem_take(&dev->sem_tx_ready, 5000);
|
ret = k_sem_take(&dev->sem_tx_ready, K_MSEC(5000));
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
LOG_DBG("Timeout waiting for tx");
|
LOG_DBG("Timeout waiting for tx");
|
||||||
goto out;
|
goto out;
|
||||||
|
|
|
@ -89,6 +89,6 @@ void main(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
k_sleep(K_MSEC(MSEC_PER_SEC * 4U));
|
k_sleep(K_SECONDS(4U));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,6 +74,6 @@ void main(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
k_sleep(K_MSEC(MSEC_PER_SEC));
|
k_sleep(K_SECONDS(1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,7 +104,7 @@ void main(void)
|
||||||
printk("pin 2 write fails!\n");
|
printk("pin 2 write fails!\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
k_sleep(K_MSEC(MSEC_PER_SEC));
|
k_sleep(K_SECONDS(1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,6 +66,6 @@ void main(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
k_sleep(K_MSEC(MSEC_PER_SEC));
|
k_sleep(K_SECONDS(1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,6 +54,6 @@ void main(void)
|
||||||
LOG_INF("Data sent!");
|
LOG_INF("Data sent!");
|
||||||
|
|
||||||
/* Send data at 1s interval */
|
/* Send data at 1s interval */
|
||||||
k_sleep(1000);
|
k_sleep(K_MSEC(1000));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,7 +87,7 @@ int peci_get_tjmax(u8_t *tjmax)
|
||||||
|
|
||||||
peci_resp = packet.rx_buffer.buf[0];
|
peci_resp = packet.rx_buffer.buf[0];
|
||||||
rx_fcs = packet.rx_buffer.buf[PECI_RD_PKG_LEN_DWORD];
|
rx_fcs = packet.rx_buffer.buf[PECI_RD_PKG_LEN_DWORD];
|
||||||
k_sleep(1);
|
k_sleep(K_MSEC(1));
|
||||||
printk("\npeci_resp %x\n", peci_resp);
|
printk("\npeci_resp %x\n", peci_resp);
|
||||||
retries--;
|
retries--;
|
||||||
} while ((peci_resp != PECI_RW_PKG_CFG_RSP_PASS) && (retries > 0));
|
} while ((peci_resp != PECI_RW_PKG_CFG_RSP_PASS) && (retries > 0));
|
||||||
|
@ -167,7 +167,7 @@ void get_max_temp(void)
|
||||||
static void monitor_temperature_func(void *dummy1, void *dummy2, void *dummy3)
|
static void monitor_temperature_func(void *dummy1, void *dummy2, void *dummy3)
|
||||||
{
|
{
|
||||||
while (true) {
|
while (true) {
|
||||||
k_sleep(1000);
|
k_sleep(K_MSEC(1000));
|
||||||
if (peci_initialized) {
|
if (peci_initialized) {
|
||||||
read_temp();
|
read_temp();
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,6 +94,6 @@ void main(void)
|
||||||
resistance));
|
resistance));
|
||||||
}
|
}
|
||||||
|
|
||||||
k_sleep(1000);
|
k_sleep(K_MSEC(1000));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -232,7 +232,7 @@ static void seg_tx_unblock_check(struct seg_tx *tx)
|
||||||
BT_DBG("Unblocked 0x%04x",
|
BT_DBG("Unblocked 0x%04x",
|
||||||
(u16_t)(blocked->seq_auth & TRANS_SEQ_ZERO_MASK));
|
(u16_t)(blocked->seq_auth & TRANS_SEQ_ZERO_MASK));
|
||||||
blocked->blocked = false;
|
blocked->blocked = false;
|
||||||
k_delayed_work_submit(&blocked->retransmit, 0);
|
k_delayed_work_submit(&blocked->retransmit, K_NO_WAIT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,4 +47,4 @@ static void canopen_sync_thread(void *p1, void *p2, void *p3)
|
||||||
|
|
||||||
K_THREAD_DEFINE(canopen_sync, CONFIG_CANOPEN_SYNC_THREAD_STACK_SIZE,
|
K_THREAD_DEFINE(canopen_sync, CONFIG_CANOPEN_SYNC_THREAD_STACK_SIZE,
|
||||||
canopen_sync_thread, NULL, NULL, NULL,
|
canopen_sync_thread, NULL, NULL, NULL,
|
||||||
CONFIG_CANOPEN_SYNC_THREAD_PRIORITY, 0, K_MSEC(1));
|
CONFIG_CANOPEN_SYNC_THREAD_PRIORITY, 0, 1);
|
||||||
|
|
Loading…
Reference in a new issue