summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAngelo Dureghello <angelo@sysam.it>2015-06-21 23:40:46 +0200
committerJagan Teki <jteki@openedev.com>2015-07-01 22:58:50 +0530
commit8aa5f1d971df0f668144759991e19b5195606a32 (patch)
treedef699aea3a2566035ebb7d473d088fc6586e40f /drivers
parent23cbd16db6551b2d5e7d6dfaa5d75a27bad28f3b (diff)
downloadtalos-obmc-uboot-8aa5f1d971df0f668144759991e19b5195606a32.tar.gz
talos-obmc-uboot-8aa5f1d971df0f668144759991e19b5195606a32.zip
spi: cf_qspi: fix clamp macro type check compilation warnings
Fix compilation warnings for redefined 'clamp' macro and non-uniform clamp macro types. Signed-off-by: Angelo Dureghello <angelo@sysam.it> Reviewed-by: Jagannadh Teki <jteki@openedev.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/spi/cf_qspi.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/spi/cf_qspi.c b/drivers/spi/cf_qspi.c
index 834c5bd259..e57e63eb47 100644
--- a/drivers/spi/cf_qspi.c
+++ b/drivers/spi/cf_qspi.c
@@ -19,7 +19,6 @@
DECLARE_GLOBAL_DATA_PTR;
-#define clamp(x, low, high) (min(max(low, x), high))
#define to_cf_qspi_slave(s) container_of(s, struct cf_qspi_slave, slave)
struct cf_qspi_slave {
@@ -120,7 +119,7 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
dev->qmr = 2u;
else /* Get the closest baud rate */
dev->qmr = clamp(((gd->bus_clk >> 2) + max_hz - 1)/max_hz,
- 2u, 255u);
+ 2lu, 255lu);
/* Map mode to QMR[CPOL] and QMR[CPHA] */
if (mode & SPI_CPOL)
OpenPOWER on IntegriCloud