nano_work: Make use of ATOMIC_DEFINE for the flags

Use the ATOMIC_DEFINE helper that exists for defining bit fields with
a given name and number of needed bits.

Change-Id: I5262de29f9b2788a16cf61feef676cdc00615f00
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
Johan Hedberg 2016-08-23 10:44:47 +03:00 committed by Anas Nashif
parent e1dad060c3
commit a89b25eb50

View File

@ -52,6 +52,8 @@ struct nano_workqueue {
*/
enum {
NANO_WORK_STATE_IDLE, /* Work item idle state */
NANO_WORK_NUM_FLAGS, /* Number of flags - must be last */
};
/**
@ -60,7 +62,7 @@ enum {
struct nano_work {
void *_reserved; /* Used by nano_fifo implementation. */
work_handler_t handler;
atomic_t flags[1];
ATOMIC_DEFINE(flags, NANO_WORK_NUM_FLAGS);
};
/**