{nb,soc}: Replace min/max() with MIN/MAX()

Use MIN() and MAX() defined in commonlib/helpers.h

Change-Id: I02d0a47937bc2d6ab2cd01995a2c6b6db245da15
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/37454
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/src/soc/intel/common/block/fast_spi/fast_spi_flash.c b/src/soc/intel/common/block/fast_spi/fast_spi_flash.c
index 0a43442..f887b3c 100644
--- a/src/soc/intel/common/block/fast_spi/fast_spi_flash.c
+++ b/src/soc/intel/common/block/fast_spi/fast_spi_flash.c
@@ -14,6 +14,7 @@
  */
 
 #include <device/mmio.h>
+#include <commonlib/helpers.h>
 #include <console/console.h>
 #include <fast_spi_def.h>
 #include <intelblocks/fast_spi.h>
@@ -157,11 +158,11 @@
 static size_t get_xfer_len(const struct spi_flash *flash, uint32_t addr,
 			   size_t len)
 {
-	size_t xfer_len = min(len, SPIBAR_FDATA_FIFO_SIZE);
+	size_t xfer_len = MIN(len, SPIBAR_FDATA_FIFO_SIZE);
 	size_t bytes_left = ALIGN_UP(addr, flash->page_size) - addr;
 
 	if (bytes_left)
-		xfer_len = min(xfer_len, bytes_left);
+		xfer_len = MIN(xfer_len, bytes_left);
 
 	return xfer_len;
 }