The region access permission check in __fdt_parse_region() can be
simplified as masking SBI_DOMAIN_MEMREGION_{M,SU}_ACCESS_MASK is
enough.
While we are here, update the confusing comments to match the codes.
Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Anup Patel <anup@brainfault.org>
* access permissions. M-mode regions can only be part of
* root domain.
*
- * SU permission bits can't be all zeroes and M-mode permission
- * bits must be all set.
+ * SU permission bits can't be all zeroes when M-mode permission
+ * bits have at least one bit set.
*/
- if (!((region_access & SBI_DOMAIN_MEMREGION_SU_ACCESS_MASK)
- & SBI_DOMAIN_MEMREGION_SU_RWX)
- && ((region_access & SBI_DOMAIN_MEMREGION_M_ACCESS_MASK)
- & SBI_DOMAIN_MEMREGION_M_RWX))
+ if (!(region_access & SBI_DOMAIN_MEMREGION_SU_ACCESS_MASK)
+ && (region_access & SBI_DOMAIN_MEMREGION_M_ACCESS_MASK))
return SBI_EINVAL;
/* Find next region of the domain */