[PATCH v2 00/12 6.6.y] Backport minmax.h updates from v6.17-rc7