From: Fabio Estevam <fabio.estevam-3arQi8VN3Tc@public.gmane.org>
To: <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: <linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
<geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>,
Fabio Estevam <fabio.estevam-3arQi8VN3Tc@public.gmane.org>
Subject: [PATCH v2 2/2] spi: core: Use min_t(size_t,..)
Date: Wed, 17 Feb 2016 15:42:28 -0200 [thread overview]
Message-ID: <1455730948-24938-2-git-send-email-fabio.estevam@nxp.com> (raw)
In-Reply-To: <1455730948-24938-1-git-send-email-fabio.estevam-3arQi8VN3Tc@public.gmane.org>
Use min_t(size_t,..) in order to avoid the following
build warning on ARM64:
include/linux/kernel.h:754:17: warning: comparison of distinct pointer types lacks a cast
(void) (&_min1 == &_min2); \
^
drivers/spi/spi.c:2304:17: note: in expansion of macro 'min'
xfers[0].len = min(maxsize, xfer[0].len);
Suggested-by: Geert Uytterhoeven <geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
Signed-off-by: Fabio Estevam <fabio.estevam-3arQi8VN3Tc@public.gmane.org>
---
Changes since v1:
- Use min_t(size_t (Geert).
drivers/spi/spi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 0725ffa..4f42f09 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -2301,7 +2301,7 @@ static int __spi_split_transfer_maxsize(struct spi_master *master,
/* the first transfer just needs the length modified, so we
* run it outside the loop
*/
- xfers[0].len = min(maxsize, xfer[0].len);
+ xfers[0].len = min_t(size_t, maxsize, xfer[0].len);
/* all the others need rx_buf/tx_buf also set */
for (i = 1, offset = maxsize; i < count; offset += maxsize, i++) {
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2016-02-17 17:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-17 17:42 [PATCH v2 1/2] spi: core: Use %zu for printing 'size_t' type Fabio Estevam
[not found] ` <1455730948-24938-1-git-send-email-fabio.estevam-3arQi8VN3Tc@public.gmane.org>
2016-02-17 17:42 ` Fabio Estevam [this message]
[not found] ` <1455730948-24938-2-git-send-email-fabio.estevam-3arQi8VN3Tc@public.gmane.org>
2016-02-17 18:23 ` [PATCH v2 2/2] spi: core: Use min_t(size_t,..) Martin Sperl
2016-02-17 19:18 ` Applied "spi: core: Use min_t(size_t,..)" to the spi tree Mark Brown
2016-02-17 18:23 ` [PATCH v2 1/2] spi: core: Use %zu for printing 'size_t' type Martin Sperl
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=1455730948-24938-2-git-send-email-fabio.estevam@nxp.com \
--to=fabio.estevam-3arqi8vn3tc@public.gmane.org \
--cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org \
--cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).