From: akpm@linux-foundation.org
To: jeff@garzik.org
Cc: netdev@vger.kernel.org, akpm@linux-foundation.org,
bhutchings@solarflare.com, jgarzik@redhat.com
Subject: [patch 6/7] drivers/net/sfc/falcon.c: fix min() warnings
Date: Wed, 29 Oct 2008 14:22:17 -0700 [thread overview]
Message-ID: <200810292122.m9TLMHts020208@imap1.linux-foundation.org> (raw)
From: Andrew Morton <akpm@linux-foundation.org>
drivers/net/sfc/falcon.c: In function 'falcon_spi_write_limit':
drivers/net/sfc/falcon.c:1679: warning: comparison of distinct pointer types lacks a cast
drivers/net/sfc/falcon.c: In function 'falcon_spi_read':
drivers/net/sfc/falcon.c:1720: warning: comparison of distinct pointer types lacks a cast
Driver seems rather confused about types. Try to help it.
Cc: Ben Hutchings <bhutchings@solarflare.com>
Cc: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/net/sfc/falcon.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff -puN drivers/net/sfc/falcon.c~drivers-net-sfc-falconc-fix-min-warnings drivers/net/sfc/falcon.c
--- a/drivers/net/sfc/falcon.c~drivers-net-sfc-falconc-fix-min-warnings
+++ a/drivers/net/sfc/falcon.c
@@ -1685,8 +1685,8 @@ static int falcon_spi_cmd(const struct e
return 0;
}
-static unsigned int
-falcon_spi_write_limit(const struct efx_spi_device *spi, unsigned int start)
+static size_t
+falcon_spi_write_limit(const struct efx_spi_device *spi, size_t start)
{
return min(FALCON_SPI_MAX_LEN,
(spi->block_size - (start & (spi->block_size - 1))));
@@ -1729,8 +1729,7 @@ int falcon_spi_read(const struct efx_spi
int rc = 0;
while (pos < len) {
- block_len = min((unsigned int)len - pos,
- FALCON_SPI_MAX_LEN);
+ block_len = min(len - pos, FALCON_SPI_MAX_LEN);
command = efx_spi_munge_command(spi, SPI_READ, start + pos);
rc = falcon_spi_cmd(spi, command, start + pos, NULL,
@@ -1764,7 +1763,7 @@ int falcon_spi_write(const struct efx_sp
if (rc)
break;
- block_len = min((unsigned int)len - pos,
+ block_len = min(len - pos,
falcon_spi_write_limit(spi, start + pos));
command = efx_spi_munge_command(spi, SPI_WRITE, start + pos);
rc = falcon_spi_cmd(spi, command, start + pos,
_
next reply other threads:[~2008-10-29 21:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-29 21:22 akpm [this message]
2008-10-29 21:29 ` [patch 6/7] drivers/net/sfc/falcon.c: fix min() warnings Ben Hutchings
2008-10-29 21:35 ` Andrew Morton
2008-11-06 5:39 ` Jeff Garzik
2008-11-06 12:33 ` Ben Hutchings
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=200810292122.m9TLMHts020208@imap1.linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=bhutchings@solarflare.com \
--cc=jeff@garzik.org \
--cc=jgarzik@redhat.com \
--cc=netdev@vger.kernel.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 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.