Coverity fixes
[keystone-rtos/rm-lld.git] / src / rm_policy.c
index 3eba1b495e47a5cabca79aaa2e3e58ec5eb47e44..63f1dc0e1cd136aa9639a7aafd1aa8fe894a6a8f 100644 (file)
@@ -664,7 +664,7 @@ int rmPolicyCheckPrivilege(Rm_PolicyCheckCfg *privilegeCfg, int32_t *result)
  *              Policy DTB.
  */
 uint32_t rmPolicyGetResourceBase(void *policyDtb, Rm_PolicyValidInstNode *validInstNode, 
-                                 int32_t resourceOffset, uint32_t allocType, 
+                                 int32_t resourceOffset, Rm_PolicyCheckType policyCheckType, 
                                  int32_t *result)
 
 {
@@ -699,12 +699,12 @@ uint32_t rmPolicyGetResourceBase(void *policyDtb, Rm_PolicyValidInstNode *validI
             if ((strncmp(permission->instName, validInstNode->name, RM_NAME_MAX_CHARS) == 0) ||
                 (strncmp(permission->instName, Rm_policyAllInstances, RM_NAME_MAX_CHARS) == 0)) {
                 /* Check instance's permissions */
-                if (RM_policy_GET_PERM(allocType, RM_POLICY_PERM_INIT_SHIFT) &&
+                if ((policyCheckType == Rm_policyCheck_INIT) &&
                     RM_policy_GET_PERM(permission->permissionBits, RM_POLICY_PERM_INIT_SHIFT)) {
                     resourceBase = assignment->resourceBase;
                     break;
                 }
-                else if (RM_policy_GET_PERM(allocType, RM_POLICY_PERM_USE_SHIFT) &&
+                else if ((policyCheckType == Rm_policyCheck_USE) &&
                          RM_policy_GET_PERM(permission->permissionBits, RM_POLICY_PERM_USE_SHIFT)) {
                     resourceBase = assignment->resourceBase;
                     break;