[PATCH 5.15 16/20] panic: Consolidate open-coded panic_on_warn checks