summaryrefslogtreecommitdiff
path: root/src/drivers/spi/adesto.c
diff options
context:
space:
mode:
authorElyes HAOUAS <ehaouas@noos.fr>2019-12-18 21:26:33 +0100
committerPatrick Georgi <pgeorgi@google.com>2019-12-20 17:48:00 +0000
commit361a935332489c635192b39204c7ec7af1667c8f (patch)
treed9e7589a4c475ba8c991c873c5600d6631f4d62d /src/drivers/spi/adesto.c
parentf97c1c9d86ff56ba9d1de4fc7c9499742224d365 (diff)
downloadcoreboot-361a935332489c635192b39204c7ec7af1667c8f.tar.xz
{drivers,southbridge}: Replace min() with MIN()
This is to remove min/max() from <stdlib.h>. Change-Id: Ica03d9aec8a81f57709abcac655dfb0ebce3f8c6 Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr> Reviewed-on: https://review.coreboot.org/c/coreboot/+/37818 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>
Diffstat (limited to 'src/drivers/spi/adesto.c')
-rw-r--r--src/drivers/spi/adesto.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/drivers/spi/adesto.c b/src/drivers/spi/adesto.c
index f671247fba..974f8ad146 100644
--- a/src/drivers/spi/adesto.c
+++ b/src/drivers/spi/adesto.c
@@ -18,7 +18,7 @@
*/
#include <console/console.h>
-#include <stdlib.h>
+#include <commonlib/helpers.h>
#include <string.h>
#include <spi_flash.h>
#include <spi-generic.h>
@@ -162,7 +162,7 @@ static int adesto_write(const struct spi_flash *flash, u32 offset, size_t len,
for (actual = 0; actual < len; actual += chunk_len) {
byte_addr = offset % page_size;
- chunk_len = min(len - actual, page_size - byte_addr);
+ chunk_len = MIN(len - actual, page_size - byte_addr);
chunk_len = spi_crop_chunk(&flash->spi, sizeof(cmd), chunk_len);
cmd[0] = CMD_AT25DF_PP;