On Tue, 23 May 2023 at 15:04, Sami Mujawar <sami.muja...@arm.com> wrote: > > According to edk2 coding standard specification, Non-Boolean > comparisons must use a compare operator (==, !=, >, < >=, <=). > See Section 5.7.2.1 at https://edk2-docs.gitbook.io/ > edk-ii-c-coding-standards-specification/5_source_files/ > 57_c_programming > > Therefore, fix the comparison in ArmGicEnableDistributor() > > Signed-off-by: Sami Mujawar <sami.muja...@arm.com> > --- > ArmPkg/Drivers/ArmGic/ArmGicNonSecLib.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/ArmPkg/Drivers/ArmGic/ArmGicNonSecLib.c > b/ArmPkg/Drivers/ArmGic/ArmGicNonSecLib.c > index > c17cbe041e8a9ceb8c8c3a6b953ff88b75f6f206..1ca66a40940434d6d89e243650f3e81aa3f588b5 > 100644 > --- a/ArmPkg/Drivers/ArmGic/ArmGicNonSecLib.c > +++ b/ArmPkg/Drivers/ArmGic/ArmGicNonSecLib.c > @@ -26,7 +26,10 @@ ArmGicEnableDistributor ( > if (Revision == ARM_GIC_ARCH_REVISION_2) { > MmioWrite32 (GicDistributorBase + ARM_GIC_ICDDCR, 0x1); > } else { > - if (MmioRead32 (GicDistributorBase + ARM_GIC_ICDDCR) & > ARM_GIC_ICDDCR_ARE) { > + if ((MmioRead32 ( > + GicDistributorBase + ARM_GIC_ICDDCR > + ) & ARM_GIC_ICDDCR_ARE) != 0) > + {
This coding style is terrible. Mind using a temporary variable for the result of the MmioRead32() instead? > MmioOr32 (GicDistributorBase + ARM_GIC_ICDDCR, 0x2); > } else { > MmioOr32 (GicDistributorBase + ARM_GIC_ICDDCR, 0x1); > -- > 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#105189): https://edk2.groups.io/g/devel/message/105189 Mute This Topic: https://groups.io/mt/99086468/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-