[PATCH 4.19 12/16] panic: Consolidate open-coded panic_on_warn checks