shell: use correct data type for atomic variables

The variable needs to be an atomic_t, and in one case it was
being incremented outside of an atomic_inc/atomic_add.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
Andrew Boie 2020-02-19 16:59:12 -08:00 committed by Anas Nashif
commit 831f6d5051
2 changed files with 2 additions and 2 deletions

View file

@ -475,7 +475,7 @@ struct shell_transport {
* @brief Shell statistics structure.
*/
struct shell_stats {
u32_t log_lost_cnt; /*!< Lost log counter.*/
atomic_t log_lost_cnt; /*!< Lost log counter.*/
};
#ifdef CONFIG_SHELL_STATS

View file

@ -73,7 +73,7 @@ static void flush_expired_messages(const struct shell *shell)
log_msg_put(msg.msg);
if (IS_ENABLED(CONFIG_SHELL_STATS)) {
shell->stats->log_lost_cnt++;
atomic_inc(&shell->stats->log_lost_cnt);
}
} else {
break;