[PATCH v3 11/19 5.15.y] minmax: improve macro expansion and type checking