Skip to content

Commit

Permalink
[Review] drivers: stm32_risab: rework regs_access_granted()
Browse files Browse the repository at this point in the history
Simplify conditions.

Signed-off-by: Gatien Chevallier <[email protected]>
  • Loading branch information
GseoC committed Feb 6, 2025
1 parent c761142 commit 7b955b9
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions core/drivers/firewall/stm32_risab.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,11 @@ static bool regs_access_granted(struct stm32_risab_pdata *risab_d,
return true;

/* Trusted CID access */
if (is_tdcid &&
(cidcfgr & _RISAB_PG_CIDCFGR_CFEN &&
!(cidcfgr & _RISAB_PG_CIDCFGR_DCEN)))
if (is_tdcid && !(cidcfgr & _RISAB_PG_CIDCFGR_DCEN))
return true;

/* Delegated CID access check */
if (cidcfgr & _RISAB_PG_CIDCFGR_CFEN &&
cidcfgr & _RISAB_PG_CIDCFGR_DCEN &&
if (cidcfgr & _RISAB_PG_CIDCFGR_DCEN &&
((cidcfgr & _RISAB_PG_CIDCFGR_DDCID_MASK) >>
_RISAB_PG_CIDCFGR_DDCID_SHIFT) == RIF_CID1)
return true;
Expand Down

0 comments on commit 7b955b9

Please sign in to comment.