Hi,

On 10/15/19 11:01 AM, Andrii Anisov wrote:
From: Andrii Anisov <[email protected]>

ARM Compiler complains about assertion conditions being always true,
because sgi is of enum type what has all its values under 16.
In order to preserve those asserts, specify the available SGI number
right in the enum and use it for the assertions. This also eliminates
nasty hardcoded values.

To be honest, those ASSERTIONs are pointless. If we are really worry of enum gic_sgi to have more than 16 values, then it would be best to use a BUILD_BUG_ON(). So you can get a build failure if that's every happening.

Something like:

static void __init __maybe_unused build_assertions(void)
{
      BUILD_BUG_ON(GIC_SGI_MAX > NR_GIC_SGI);
}

enum
{
     /* Use for sanity check on the size of the enum */
     GIC_MAX_SGI;
}

Cheers,

--
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to