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:
parent
06d19213c4
commit
831f6d5051
2 changed files with 2 additions and 2 deletions
|
@ -475,7 +475,7 @@ struct shell_transport {
|
||||||
* @brief Shell statistics structure.
|
* @brief Shell statistics structure.
|
||||||
*/
|
*/
|
||||||
struct shell_stats {
|
struct shell_stats {
|
||||||
u32_t log_lost_cnt; /*!< Lost log counter.*/
|
atomic_t log_lost_cnt; /*!< Lost log counter.*/
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef CONFIG_SHELL_STATS
|
#ifdef CONFIG_SHELL_STATS
|
||||||
|
|
|
@ -73,7 +73,7 @@ static void flush_expired_messages(const struct shell *shell)
|
||||||
log_msg_put(msg.msg);
|
log_msg_put(msg.msg);
|
||||||
|
|
||||||
if (IS_ENABLED(CONFIG_SHELL_STATS)) {
|
if (IS_ENABLED(CONFIG_SHELL_STATS)) {
|
||||||
shell->stats->log_lost_cnt++;
|
atomic_inc(&shell->stats->log_lost_cnt);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue