From patchwork Thu Jun 4 23:23:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Dureghello X-Patchwork-Id: 480923 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 5875514027F for ; Fri, 5 Jun 2015 09:30:26 +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=Bs/I7zUz; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B96F64B622; Fri, 5 Jun 2015 01:30:21 +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 0xCqND6FDLDL; Fri, 5 Jun 2015 01:30:21 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D0DA14B616; Fri, 5 Jun 2015 01:30:20 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F03324B616 for ; Fri, 5 Jun 2015 01:30:17 +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 seEf8azqQG6w for ; Fri, 5 Jun 2015 01:30:17 +0200 (CEST) X-Greylist: delayed 399 seconds by postgrey-1.34 at theia; Fri, 05 Jun 2015 01:30:13 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 tbjjbihbhecae.turbo-smtp.net (tbjjbihbhecae.turbo-smtp.net [199.187.174.204]) by theia.denx.de (Postfix) with SMTP id 4B1E14B615 for ; Fri, 5 Jun 2015 01:30:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sysam.it; s=turbo-smtp; x=1434065417; h=DomainKey-Signature:Received: Received:From:To:Cc:Subject:Date:Message-ID; bh=y2s6J9t3xb8Y+/KO Z3uFtmbnhC+4UK/zlAhvrD/sJ9c=; b=Bs/I7zUz2xb4bgOSJUaGBBIfaqsxKBW6 pKlkGY4S+9zVmuq38mXcSHTkPXIBBkZs91R68pmB+5FvjMoU9J/O1il/isDEsP5u 8/X3zb6qa8eRoywk60ZXvb9bxnotzrSznkbg7IyO8+GIXSBQ4vyR1Sl/R3uJ7zdK 8iib06d9Gl4= 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=cThjF+EXG38BjAga/uM8mP+Qc2BTYGqnnwkjXlz8UEtBiIN375AZIPqSZFMd9T gG0t96VzPqT9VDGW4Wkr9T2SvX7VIxlQFpX9CsQc+WqVuukwYC5MeN3RFq+MDEPE VwZTtOn9lbFe1mwl6tewRNjUarnM1kW6j4prZZRFMhDlk=; Received: (qmail 26139 invoked from network); 4 Jun 2015 23:23:33 -0000 Received: from unknown (HELO localhost.localdomain) (authenticated@82.58.204.48) by turbo-smtp.com with SMTP; 4 Jun 2015 23:23:33 -0000 X-TurboSMTP-Tracking: 2231235986 From: Angelo Dureghello To: u-boot@lists.denx.de Date: Fri, 5 Jun 2015 01:23:23 +0200 Message-ID: <1433460203-7043-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] 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 clamp macro redefined warning, and clamp type check warnings. 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..c4bafe0 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 { @@ -119,7 +118,7 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs, if (max_hz == 0) /* Go as fast as possible */ dev->qmr = 2u; else /* Get the closest baud rate */ - dev->qmr = clamp(((gd->bus_clk >> 2) + max_hz - 1)/max_hz, + dev->qmr = clamp_val(((gd->bus_clk >> 2) + max_hz - 1)/max_hz, 2u, 255u); /* Map mode to QMR[CPOL] and QMR[CPHA] */