From 912387598bfaac6ad8a58e1810844daa27e0781e Mon Sep 17 00:00:00 2001
From: chenjiayi <chenjiayi22@huawei.com>
Date: Fri, 17 Nov 2023 07:44:31 +0800
Subject: [PATCH 071/103] fix(devmaster): CONST can only take arch or virt as
 attribute

The inverse operator '!' is missed previously.
---
 exts/devmaster/src/lib/rules/rules_load.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/exts/devmaster/src/lib/rules/rules_load.rs b/exts/devmaster/src/lib/rules/rules_load.rs
index eee77e63..57ff19ac 100644
--- a/exts/devmaster/src/lib/rules/rules_load.rs
+++ b/exts/devmaster/src/lib/rules/rules_load.rs
@@ -832,7 +832,7 @@ impl RuleToken {
                 }
             }
             "CONST" => {
-                if attr.is_none() || matches!(attr.as_ref().unwrap().as_str(), "arch" | "virt") {
+                if attr.is_none() || !matches!(attr.as_ref().unwrap().as_str(), "arch" | "virt") {
                     return Err(Error::RulesLoadError {
                         msg: "Key 'CONST' has invalid attribute.".location(&context),
                     });
-- 
2.33.0

