[PATCH v3 14/29] patman: Move warning collection to a function