quark_se: Correctly wait for ARC_READY flag while initializing ARC

The bitwise AND operator was being applied to the boolean expression
"!shared_data->flags" instead of the whole expression because a
parenthesis was lacking.

This bug has been found using Coccinelle using the following spatch,
after finding a similar bug somewhere else in the code base:

      @@
      expression E1;
      expression E2;
      @@

      - !E1 & E2
      + !(E1 & E2)

No other instance of this defect has been found with this spatch.

Change-Id: I6b9ca092f4015c80ddc83c31ce540a92e67cdb11
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
This commit is contained in:
Leandro Pereira 2016-11-04 15:40:38 -07:00 committed by Anas Nashif
commit 0be498db5c

View file

@ -85,7 +85,7 @@ static int arc_init(struct device *arg)
/* Block until ARC's quark_se_init() sets a flag indicating it is ready,
* if we get stuck here ARC has run but has exploded very early */
SYS_LOG_DBG("Waiting for arc to init...");
while (!shared_data->flags & ARC_READY) {
while (!(shared_data->flags & ARC_READY)) {
}
skip_arc_init: