From: Angelo Dureghello <angelo@sysam.it>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] spi: cf_qspi: fix clamp macro type check compilation warnings
Date: Fri, 5 Jun 2015 01:23:23 +0200 [thread overview]
Message-ID: <1433460203-7043-1-git-send-email-angelo@sysam.it> (raw)
Fix clamp macro redefined warning, and clamp type check warnings.
Signed-off-by: Angelo Dureghello <angelo@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..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] */
--
2.1.4
next reply other threads:[~2015-06-04 23:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-04 23:23 Angelo Dureghello [this message]
2015-06-19 7:43 ` [U-Boot] [PATCH] spi: cf_qspi: fix clamp macro type check compilation warnings Jagan Teki
2015-06-21 9:09 ` Angelo Dureghello
2015-06-21 9:45 ` Jagan Teki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1433460203-7043-1-git-send-email-angelo@sysam.it \
--to=angelo@sysam.it \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.