spi: cf_qspi: fix clamp macro type check compilation warnings
authorAngelo Dureghello <angelo@sysam.it>
Sun, 21 Jun 2015 21:40:46 +0000 (23:40 +0200)
committerJagan Teki <jteki@openedev.com>
Wed, 1 Jul 2015 17:28:50 +0000 (22:58 +0530)
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>
drivers/spi/cf_qspi.c

index 834c5bd259d3fd2f2e4dcb7e0a27c86c52e3422f..e57e63eb47a0f63989dff7fbd1e242c413668e6f 100644 (file)
@@ -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)