From 4f1f118a8d440884e60fe86f36f4237b0a00e775 Mon Sep 17 00:00:00 2001 From: Sasha Smundak Date: Thu, 4 Nov 2021 17:57:39 -0700 Subject: [PATCH] Fix: negate the condition for is-vendor-board-qcom Bug: 193540681 Test: internal Change-Id: Ia4087574f7cbcd5282687234892314c9a5fcc174 --- mk2rbc/mk2rbc.go | 4 +++- mk2rbc/mk2rbc_test.go | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mk2rbc/mk2rbc.go b/mk2rbc/mk2rbc.go index 6227164e1..d4ff5855e 100644 --- a/mk2rbc/mk2rbc.go +++ b/mk2rbc/mk2rbc.go @@ -1167,10 +1167,12 @@ func (ctx *parseContext) parseCheckFunctionCallResult(directive *mkparser.Direct return ctx.newBadExpr(directive, fmt.Sprintf("the result of %s can be compared only to empty", x.name)), true } + // if the expression is ifneq (,$(call is-vendor-board-platform,...)), negate==true, + // so we should set inExpr.isNot to false return &inExpr{ expr: &variableRefExpr{ctx.addVariable("TARGET_BOARD_PLATFORM"), false}, list: &variableRefExpr{ctx.addVariable("QCOM_BOARD_PLATFORMS"), true}, - isNot: negate, + isNot: !negate, }, true default: return ctx.newBadExpr(directive, "Unknown function in ifeq: %s", x.name), true diff --git a/mk2rbc/mk2rbc_test.go b/mk2rbc/mk2rbc_test.go index 511bb0f87..083d0bc06 100644 --- a/mk2rbc/mk2rbc_test.go +++ b/mk2rbc/mk2rbc_test.go @@ -579,7 +579,7 @@ def init(g, handle): pass elif not rblf.board_platform_is(g, "copper"): pass - elif g.get("TARGET_BOARD_PLATFORM", "") not in g["QCOM_BOARD_PLATFORMS"]: + elif g.get("TARGET_BOARD_PLATFORM", "") in g["QCOM_BOARD_PLATFORMS"]: pass `, },