[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 3/9] arm/gic: Get rid of READ/WRITE_SYSREG32



Hi Michal,

On 21/04/2021 08:48, Michal Orzel wrote:
On 20.04.2021 15:28, Julien Grall wrote:
On 20/04/2021 08:08, Michal Orzel wrote:
Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
     static unsigned int gicv3_read_irq(void)
   {
-    unsigned int irq = READ_SYSREG32(ICC_IAR1_EL1);
+    register_t irq = READ_SYSREG(ICC_IAR1_EL1);
         dsb(sy);
   -    return irq;
+    /* Number of IRQs do not exceed 32bit. */

If we want to be pedantic, the IRQs are encoded using 23-bit. So maybe we want 
to mask them below.

+    return (unsigned int)irq;

NIT: We tend to avoid explicit cast unless they are strictly necessary because 
they can be more harmful than implicit cast (the compiler may not cast every 
conversion). So I would drop it and just keep the comment.

Ok. I will do:
return (irq & 0xffffff);

Sounds good, so long we the value is not hardoced but provided through a define :).

Cheers,

--
Julien Grall



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.