[U-Boot] [PATCH v2] spi: cf_qspi: fix clamp macro type check compilation warnings

Jagan Teki jteki at openedev.com
Mon Jun 22 08:44:43 CEST 2015


On 22 June 2015 at 03:10, Angelo Dureghello <angelo at sysam.it> wrote:
> Fix compilation warnings for redefined 'clamp' macro and non-uniform
> clamp macro types.
>
> Signed-off-by: Angelo Dureghello <angelo at sysam.it>
> ---
>  drivers/spi/cf_qspi.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/spi/cf_qspi.c b/drivers/spi/cf_qspi.c
> index 834c5bd..e57e63e 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);

Any Tested-by ?

>
>         /* Map mode to QMR[CPOL] and QMR[CPHA] */
>         if (mode & SPI_CPOL)
> --
> 2.1.4
>

thanks!
-- 
Jagan | openedev.


More information about the U-Boot mailing list