diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2015-02-20 07:07:36 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2015-02-20 07:07:36 -0600 |
commit | 8d0aef2bb6ecc27f628b8d7cb8a7feb5d32f27f5 (patch) | |
tree | 452731d08eef8191e285e175b31ce1d29aa2f0e6 | |
parent | 07b5b43b323334b02fab26754dc6e0cdd3154631 (diff) | |
download | px4-nuttx-8d0aef2bb6ecc27f628b8d7cb8a7feb5d32f27f5.tar.gz px4-nuttx-8d0aef2bb6ecc27f628b8d7cb8a7feb5d32f27f5.tar.bz2 px4-nuttx-8d0aef2bb6ecc27f628b8d7cb8a7feb5d32f27f5.zip |
Fix some time value changes; mostly changing greater than 1000000000 to greater than or equal to 1000000000. From Juha Niskanen
-rw-r--r-- | apps/nshlib/nsh_netinit.c | 2 | ||||
-rw-r--r-- | nuttx/arch/arm/src/stm32/stm32_i2c.c | 4 | ||||
-rwxr-xr-x | nuttx/arch/arm/src/stm32/stm32_i2c_alt.c | 4 | ||||
-rw-r--r-- | nuttx/arch/arm/src/stm32/stm32f30xxx_i2c.c | 4 | ||||
-rw-r--r-- | nuttx/arch/arm/src/tiva/tiva_i2c.c | 4 | ||||
-rw-r--r-- | nuttx/fs/vfs/fs_poll.c | 2 | ||||
-rw-r--r-- | nuttx/net/arp/arp_notify.c | 2 | ||||
-rw-r--r-- | nuttx/net/icmpv6/icmpv6_notify.c | 2 | ||||
-rw-r--r-- | nuttx/net/icmpv6/icmpv6_rnotify.c | 2 | ||||
-rw-r--r-- | nuttx/sched/mqueue/mq_timedreceive.c | 2 | ||||
-rw-r--r-- | nuttx/sched/mqueue/mq_timedsend.c | 2 | ||||
-rw-r--r-- | nuttx/sched/semaphore/sem_timedwait.c | 6 |
12 files changed, 18 insertions, 18 deletions
diff --git a/apps/nshlib/nsh_netinit.c b/apps/nshlib/nsh_netinit.c index e0457f97f..11e924f72 100644 --- a/apps/nshlib/nsh_netinit.c +++ b/apps/nshlib/nsh_netinit.c @@ -572,7 +572,7 @@ static int nsh_netinit_monitor(void) abstime.tv_sec += reltime.tv_sec; abstime.tv_nsec += reltime.tv_nsec; - if (abstime.tv_nsec > 1000000000) + if (abstime.tv_nsec >= 1000000000) { abstime.tv_sec++; abstime.tv_nsec -= 1000000000; diff --git a/nuttx/arch/arm/src/stm32/stm32_i2c.c b/nuttx/arch/arm/src/stm32/stm32_i2c.c index fdf94ed78..ce150fd3a 100644 --- a/nuttx/arch/arm/src/stm32/stm32_i2c.c +++ b/nuttx/arch/arm/src/stm32/stm32_i2c.c @@ -638,7 +638,7 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv) #ifdef CONFIG_STM32_I2C_DYNTIMEO abstime.tv_nsec += 1000 * stm32_i2c_tousecs(priv->msgc, priv->msgv); - if (abstime.tv_nsec > 1000 * 1000 * 1000) + if (abstime.tv_nsec >= 1000 * 1000 * 1000) { abstime.tv_sec++; abstime.tv_nsec -= 1000 * 1000 * 1000; @@ -646,7 +646,7 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv) #elif CONFIG_STM32_I2CTIMEOMS > 0 abstime.tv_nsec += CONFIG_STM32_I2CTIMEOMS * 1000 * 1000; - if (abstime.tv_nsec > 1000 * 1000 * 1000) + if (abstime.tv_nsec >= 1000 * 1000 * 1000) { abstime.tv_sec++; abstime.tv_nsec -= 1000 * 1000 * 1000; diff --git a/nuttx/arch/arm/src/stm32/stm32_i2c_alt.c b/nuttx/arch/arm/src/stm32/stm32_i2c_alt.c index b1107aafe..592fb3290 100755 --- a/nuttx/arch/arm/src/stm32/stm32_i2c_alt.c +++ b/nuttx/arch/arm/src/stm32/stm32_i2c_alt.c @@ -646,7 +646,7 @@ static int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv) #ifdef CONFIG_STM32_I2C_DYNTIMEO abstime.tv_nsec += 1000 * stm32_i2c_tousecs(priv->msgc, priv->msgv); - if (abstime.tv_nsec > 1000 * 1000 * 1000) + if (abstime.tv_nsec >= 1000 * 1000 * 1000) { abstime.tv_sec++; abstime.tv_nsec -= 1000 * 1000 * 1000; @@ -654,7 +654,7 @@ static int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv) #elif CONFIG_STM32_I2CTIMEOMS > 0 abstime.tv_nsec += CONFIG_STM32_I2CTIMEOMS * 1000 * 1000; - if (abstime.tv_nsec > 1000 * 1000 * 1000) + if (abstime.tv_nsec >= 1000 * 1000 * 1000) { abstime.tv_sec++; abstime.tv_nsec -= 1000 * 1000 * 1000; diff --git a/nuttx/arch/arm/src/stm32/stm32f30xxx_i2c.c b/nuttx/arch/arm/src/stm32/stm32f30xxx_i2c.c index 8118133c0..d9c29c722 100644 --- a/nuttx/arch/arm/src/stm32/stm32f30xxx_i2c.c +++ b/nuttx/arch/arm/src/stm32/stm32f30xxx_i2c.c @@ -673,7 +673,7 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv) #ifdef CONFIG_STM32_I2C_DYNTIMEO abstime.tv_nsec += 1000 * stm32_i2c_tousecs(priv->msgc, priv->msgv); - if (abstime.tv_nsec > 1000 * 1000 * 1000) + if (abstime.tv_nsec >= 1000 * 1000 * 1000) { abstime.tv_sec++; abstime.tv_nsec -= 1000 * 1000 * 1000; @@ -681,7 +681,7 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv) #elif CONFIG_STM32_I2CTIMEOMS > 0 abstime.tv_nsec += CONFIG_STM32_I2CTIMEOMS * 1000 * 1000; - if (abstime.tv_nsec > 1000 * 1000 * 1000) + if (abstime.tv_nsec >= 1000 * 1000 * 1000) { abstime.tv_sec++; abstime.tv_nsec -= 1000 * 1000 * 1000; diff --git a/nuttx/arch/arm/src/tiva/tiva_i2c.c b/nuttx/arch/arm/src/tiva/tiva_i2c.c index fa6f05eb1..9124993c0 100644 --- a/nuttx/arch/arm/src/tiva/tiva_i2c.c +++ b/nuttx/arch/arm/src/tiva/tiva_i2c.c @@ -812,7 +812,7 @@ static inline int tiva_i2c_sem_waitdone(struct tiva_i2c_priv_s *priv) #ifdef CONFIG_TIVA_I2C_DYNTIMEO abstime.tv_nsec += 1000 * tiva_i2c_tousecs(priv->msgc, priv->msgv); - if (abstime.tv_nsec > 1000 * 1000 * 1000) + if (abstime.tv_nsec >= 1000 * 1000 * 1000) { abstime.tv_sec++; abstime.tv_nsec -= 1000 * 1000 * 1000; @@ -820,7 +820,7 @@ static inline int tiva_i2c_sem_waitdone(struct tiva_i2c_priv_s *priv) #elif CONFIG_TIVA_I2C_TIMEOMS > 0 abstime.tv_nsec += CONFIG_TIVA_I2C_TIMEOMS * 1000 * 1000; - if (abstime.tv_nsec > 1000 * 1000 * 1000) + if (abstime.tv_nsec >= 1000 * 1000 * 1000) { abstime.tv_sec++; abstime.tv_nsec -= 1000 * 1000 * 1000; diff --git a/nuttx/fs/vfs/fs_poll.c b/nuttx/fs/vfs/fs_poll.c index d968defb6..a471f655f 100644 --- a/nuttx/fs/vfs/fs_poll.c +++ b/nuttx/fs/vfs/fs_poll.c @@ -327,7 +327,7 @@ int poll(FAR struct pollfd *fds, nfds_t nfds, int timeout) abstime.tv_sec += sec; abstime.tv_nsec += nsec; - if (abstime.tv_nsec > NSEC_PER_SEC) + if (abstime.tv_nsec >= NSEC_PER_SEC) { abstime.tv_sec++; abstime.tv_nsec -= NSEC_PER_SEC; diff --git a/nuttx/net/arp/arp_notify.c b/nuttx/net/arp/arp_notify.c index d2f4c0689..4326d23c1 100644 --- a/nuttx/net/arp/arp_notify.c +++ b/nuttx/net/arp/arp_notify.c @@ -187,7 +187,7 @@ int arp_wait(FAR struct arp_notify_s *notify, FAR struct timespec *timeout) abstime.tv_sec += timeout->tv_sec; abstime.tv_nsec += timeout->tv_nsec; - if (abstime.tv_nsec > 1000000000) + if (abstime.tv_nsec >= 1000000000) { abstime.tv_sec++; abstime.tv_nsec -= 1000000000; diff --git a/nuttx/net/icmpv6/icmpv6_notify.c b/nuttx/net/icmpv6/icmpv6_notify.c index 6c324d32d..2302b3b2a 100644 --- a/nuttx/net/icmpv6/icmpv6_notify.c +++ b/nuttx/net/icmpv6/icmpv6_notify.c @@ -191,7 +191,7 @@ int icmpv6_wait(FAR struct icmpv6_notify_s *notify, abstime.tv_sec += timeout->tv_sec; abstime.tv_nsec += timeout->tv_nsec; - if (abstime.tv_nsec > 1000000000) + if (abstime.tv_nsec >= 1000000000) { abstime.tv_sec++; abstime.tv_nsec -= 1000000000; diff --git a/nuttx/net/icmpv6/icmpv6_rnotify.c b/nuttx/net/icmpv6/icmpv6_rnotify.c index 174c8c16a..9a1767719 100644 --- a/nuttx/net/icmpv6/icmpv6_rnotify.c +++ b/nuttx/net/icmpv6/icmpv6_rnotify.c @@ -287,7 +287,7 @@ int icmpv6_rwait(FAR struct icmpv6_rnotify_s *notify, abstime.tv_sec += timeout->tv_sec; abstime.tv_nsec += timeout->tv_nsec; - if (abstime.tv_nsec > 1000000000) + if (abstime.tv_nsec >= 1000000000) { abstime.tv_sec++; abstime.tv_nsec -= 1000000000; diff --git a/nuttx/sched/mqueue/mq_timedreceive.c b/nuttx/sched/mqueue/mq_timedreceive.c index ef9f0b6a5..858d9a3bf 100644 --- a/nuttx/sched/mqueue/mq_timedreceive.c +++ b/nuttx/sched/mqueue/mq_timedreceive.c @@ -198,7 +198,7 @@ ssize_t mq_timedreceive(mqd_t mqdes, FAR char *msg, size_t msglen, return ERROR; } - if (!abstime || abstime->tv_sec < 0 || abstime->tv_nsec > 1000000000) + if (!abstime || abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000) { set_errno(EINVAL); return ERROR; diff --git a/nuttx/sched/mqueue/mq_timedsend.c b/nuttx/sched/mqueue/mq_timedsend.c index a5aa11c84..e14495649 100644 --- a/nuttx/sched/mqueue/mq_timedsend.c +++ b/nuttx/sched/mqueue/mq_timedsend.c @@ -200,7 +200,7 @@ int mq_timedsend(mqd_t mqdes, FAR const char *msg, size_t msglen, int prio, return ERROR; } - if (!abstime || abstime->tv_sec < 0 || abstime->tv_nsec > 1000000000) + if (!abstime || abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000) { set_errno(EINVAL); return ERROR; diff --git a/nuttx/sched/semaphore/sem_timedwait.c b/nuttx/sched/semaphore/sem_timedwait.c index 1ac69e68b..b7d850728 100644 --- a/nuttx/sched/semaphore/sem_timedwait.c +++ b/nuttx/sched/semaphore/sem_timedwait.c @@ -147,7 +147,7 @@ static void sem_timeout(int argc, uint32_t pid) * abstime - The absolute time to wait until a timeout is declared. * * Return Value: - * One success, the length of the selected message in bytes.is + * One success, the length of the selected message in bytes is * returned. On failure, -1 (ERROR) is returned and the errno * is set appropriately: * @@ -198,7 +198,7 @@ int sem_timedwait(FAR sem_t *sem, FAR const struct timespec *abstime) /* We will disable interrupts until we have completed the semaphore * wait. We need to do this (as opposed to just disabling pre-emption) - * because there could be interrupt handlers that are asynchronoulsy + * because there could be interrupt handlers that are asynchronously * posting semaphores and to prevent race conditions with watchdog * timeout. This is not too bad because interrupts will be re- * enabled while we are blocked waiting for the semaphore. @@ -223,7 +223,7 @@ int sem_timedwait(FAR sem_t *sem, FAR const struct timespec *abstime) * with a valid timeout. */ - if (abstime->tv_sec < 0 || abstime->tv_nsec > 1000000000) + if (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000) { err = EINVAL; goto errout_disabled; |