[PATCH] irqchip/gic: Use GIC_SPI symbolic constant

Mason slash.tmp at free.fr
Sun Jul 16 14:29:27 PDT 2017


On 16/07/2017 23:08, Marc Zyngier wrote:

> Mason wrote:
>
>> On 16/07/2017 22:13, Marc Zyngier wrote:
>>
>>> Mason wrote:
>>>
>>>> Use GIC_SPI explicitly instead of an implicit 0.
>>>
>>> What bug is this fixing? What benefit does this bring?
>>
>> The patch aims to replace an (implicit) literal constant
>> with the corresponding symbolic macro. IMO, it makes the
>> intent somewhat clearer, and, more importantly, grepping
>> for said symbol now returns the respective file/line.
>> (It took me a while to find the line.)
>>
>> Are you saying that changing the code at this point is
>> not worth the trouble?
> 
> You're assuming that this GIC_SPI macro has anything to do with the GIC
> driver. It doesn't. That's just a convenience macro for people writing
> DT, and definitely not something I'd ever want to rely on in the Linux
> driver. The binding defines the raw value, and not this macro.

AFAIU, you're referring to
Documentation/devicetree/bindings/interrupt-controller/arm,gic.txt
"The 1st cell is the interrupt type;
0 for SPI interrupts, 1 for PPI interrupts."

Doesn't it make sense to have symbolic constants for
the 0 and 1 above? In linux/irqchip/arm-gic.h ?

IIUC, headers in include/dt-bindings are just convenience
macros, and are not to be included from driver code?

Regards.



More information about the linux-arm-kernel mailing list