Re: [PATCH 7/9] arm64: sysreg: Reject a macro name defined twice

From: Steffen Eiden

Date: Mon Nov 23 2026 - 06:01:55 EST


On Mon, Nov 23, 2026 at 07:52:17AM +0000, Fuad Tabba wrote:
> The generator rejects a duplicate register, SysregFields block, prefix
> or enum value, but not two definitions of the same macro. Two fields
> called F in REG make it emit REG_F twice with different masks, which the
> compiler reports only as a redefinition warning against the generated
> header, in every file that includes it. Two values of one enum sharing a
> name do the same, and so do names that collide only once the generator
> joins them: a field A_B beside value B of field A, a field F_MASK beside
> F, or a field B_C in FOO beside a field C in FOO_B.
>
> Record every macro name the generator defines, and fail on the second
> definition. This covers a duplicate block or prefix too, but their own
> checks stay, since they report the duplicate at the block's own line, by
> block name.
>
> Signed-off-by: Fuad Tabba <fuad.tabba@xxxxxxxxx>

Reviewed-by: Steffen Eiden <seiden@xxxxxxxxxxxxx>