On 24.09.2025 22:35, Dmytro Prokopchuk1 wrote: > MISRA C Rule 2.1 states: "A project shall not contain unreachable code". > In certain build configurations the following functions 'prepare_acpi()' > and 'gicv3_its_setup_collection()' are defined as inline functions and > contain the macro 'BUG()'. This resulted in violations due to these > functions became non-returning. > > To ensure compliance with MISRA C Rule 2.1 remove inline function > implementations and their 'BUG()'-based unreachable code. Provide > unconditional function declarations for 'gicv3_its_setup_collection()' > and 'prepare_acpi()'. Rely on the compiler's DCE to remove unused function > calls in builds where these configs 'CONFIG_ACPI' or 'CONFIG_HAS_ITS' are > not enabled.
Imo it would have helped if you had stated the respective predicates which end up compile-time constant. (Likely the two changes also could have been done separately, as they're entirely independent of one another afaict.) > Signed-off-by: Dmytro Prokopchuk <[email protected]> Reviewed-by: Jan Beulich <[email protected]> Jan
