From patchwork Sun Jun 21 21:40:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Dureghello X-Patchwork-Id: 487081 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 6C84A14010F for ; Mon, 22 Jun 2015 07:41:05 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=sysam.it header.i=@sysam.it header.b=XKRBAGQB; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id ECC0B4B717; Sun, 21 Jun 2015 23:41:00 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hYEqpo6txrfk; Sun, 21 Jun 2015 23:41:00 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0D1474B70C; Sun, 21 Jun 2015 23:41:00 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B84A54B70C for ; Sun, 21 Jun 2015 23:40:57 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZkLO_RTxzY9A for ; Sun, 21 Jun 2015 23:40:57 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from tbjjbihbheccf.turbo-smtp.net (tbjjbihbheccf.turbo-smtp.net [199.187.174.225]) by theia.denx.de (Postfix) with SMTP id 13FB74B70B for ; Sun, 21 Jun 2015 23:40:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sysam.it; s=turbo-smtp; x=1435527657; h=DomainKey-Signature:Received: Received:From:To:Cc:Subject:Date:Message-ID; bh=B1sT0Er7BYE3mmyQ 6Uqx0jGVyc66EgOnB+QTb3YYgVc=; b=XKRBAGQBhFXdz1JsJJcFU5Qs2QZpQz1x gd2JH4PsIBOgiMGYlukc0nhsedINsVr1vu8O2OVogj6U9n+vzxhPl5yMexN+0We4 AdBCOqqRXDyVVD9870j0QOq6K/5aYjzbaarsh+cpj/dD0fYS3IOe2z0uQ64VV0Yo PNZ6AYh93OI= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=turbo-smtp; d=sysam.it; h=Received:Received:X-TurboSMTP-Tracking:From:To:Cc:Subject:Date:Message-ID:X-Mailer; b=BaAXss+Rlf1NSLK1J8+ISPKZRfBfqiKP07/qP0LGAGIIUhAHlZ8kx8oECbb4Q0 VyqiAI1JvKaTmLnOH9yX76UXr2A2ftJrqZfT1sJawvDjxlPt6YS7A4JvAM0lSPJ/ O3Nc9AMjPkyoF4X97f/rKWO3UXwJXZjWlps+1Rru5kpWU=; Received: (qmail 32079 invoked from network); 21 Jun 2015 21:40:52 -0000 Received: from unknown (HELO localhost.localdomain) (authenticated@79.21.232.104) by turbo-smtp.com with SMTP; 21 Jun 2015 21:40:52 -0000 X-TurboSMTP-Tracking: 2271088215 From: Angelo Dureghello To: u-boot@lists.denx.de Date: Sun, 21 Jun 2015 23:40:46 +0200 Message-ID: <1434922846-9650-1-git-send-email-angelo@sysam.it> X-Mailer: git-send-email 2.1.4 Cc: jteki@openedev.com, trini@ti.com, Angelo Dureghello , alison.wang@freescale.com Subject: [U-Boot] [PATCH v2] spi: cf_qspi: fix clamp macro type check compilation warnings X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Fix compilation warnings for redefined 'clamp' macro and non-uniform clamp macro types. Signed-off-by: Angelo Dureghello --- 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); /* Map mode to QMR[CPOL] and QMR[CPHA] */ if (mode & SPI_CPOL)