From 0be498db5c8687ecd7feaa6d3a8b7902d1459e2e Mon Sep 17 00:00:00 2001 From: Leandro Pereira Date: Fri, 4 Nov 2016 15:40:38 -0700 Subject: [PATCH] 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 --- arch/x86/soc/intel_quark/quark_se/soc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/soc/intel_quark/quark_se/soc.c b/arch/x86/soc/intel_quark/quark_se/soc.c index 6de3d126b54..a3c1ea028a3 100644 --- a/arch/x86/soc/intel_quark/quark_se/soc.c +++ b/arch/x86/soc/intel_quark/quark_se/soc.c @@ -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: