[PATCH 4.14 v2 11/15] panic: Consolidate open-coded panic_on_warn checks