{"id":964,"url":"http://patchwork.ozlabs.org/api/1.0/patches/964/?format=json","project":{"id":7,"url":"http://patchwork.ozlabs.org/api/1.0/projects/7/?format=json","name":"Linux network development","link_name":"netdev","list_id":"netdev.vger.kernel.org","list_email":"netdev@vger.kernel.org","web_url":null,"scm_url":null,"webscm_url":null},"msgid":"<200809222152.m8MLqTQ9032000@imap1.linux-foundation.org>","date":"2008-09-22T21:52:29","name":"[21/21] drivers/net/sfc/falcon.c: fix min() warnings","commit_ref":null,"pull_url":null,"state":"accepted","archived":true,"hash":"e88d46d1193e31c609b2ba935801744d30fd289e","submitter":{"id":107,"url":"http://patchwork.ozlabs.org/api/1.0/people/107/?format=json","name":"Andrew Morton","email":"akpm@linux-foundation.org"},"delegate":{"id":36,"url":"http://patchwork.ozlabs.org/api/1.0/users/36/?format=json","username":"jgarzik","first_name":"Jeff","last_name":"Garzik","email":"jgarzik@pobox.com"},"mbox":"http://patchwork.ozlabs.org/project/netdev/patch/200809222152.m8MLqTQ9032000@imap1.linux-foundation.org/mbox/","series":[],"check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/964/checks/","tags":{},"headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Received":["from vger.kernel.org (vger.kernel.org [209.132.176.167])\n\tby ozlabs.org (Postfix) with ESMTP id A9D3DDDF26\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 23 Sep 2008 07:54:45 +1000 (EST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1753598AbYIVVyj (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tMon, 22 Sep 2008 17:54:39 -0400","(majordomo@vger.kernel.org) by vger.kernel.org id S1753347AbYIVVyj\n\t(ORCPT <rfc822; netdev-outgoing>); Mon, 22 Sep 2008 17:54:39 -0400","from smtp1.linux-foundation.org ([140.211.169.13]:59063 \"EHLO\n\tsmtp1.linux-foundation.org\" rhost-flags-OK-OK-OK-OK)\n\tby vger.kernel.org with ESMTP id S1753462AbYIVVyg (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Mon, 22 Sep 2008 17:54:36 -0400","from imap1.linux-foundation.org (imap1.linux-foundation.org\n\t[140.211.169.55])\n\tby smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with\n\tESMTP id m8MLqUWr018392\n\t(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);\n\tMon, 22 Sep 2008 14:52:31 -0700","from localhost.localdomain (localhost [127.0.0.1])\n\tby imap1.linux-foundation.org\n\t(8.13.5.20060308/8.13.5/Debian-3ubuntu1.1) with ESMTP id\n\tm8MLqTQ9032000; Mon, 22 Sep 2008 14:52:30 -0700"],"Message-Id":"<200809222152.m8MLqTQ9032000@imap1.linux-foundation.org>","Subject":"[patch 21/21] drivers/net/sfc/falcon.c: fix min() warnings","To":"jeff@garzik.org","Cc":"netdev@vger.kernel.org, akpm@linux-foundation.org,\n\tbhutchings@solarflare.com, jgarzik@redhat.com","From":"akpm@linux-foundation.org","Date":"Mon, 22 Sep 2008 14:52:29 -0700","X-Spam-Status":"No, hits=-3.359 required=5 tests=AWL, BAYES_00,\n\tOSDL_HEADER_SUBJECT_BRACKETED","X-Spam-Checker-Version":"SpamAssassin 3.2.4-osdl_revision__1.47__","X-MIMEDefang-Filter":"lf$Revision: 1.188 $","X-Scanned-By":"MIMEDefang 2.63 on 140.211.169.13","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"},"content":"From: Andrew Morton <akpm@linux-foundation.org>\n\ndrivers/net/sfc/falcon.c: In function 'falcon_spi_write_limit':\ndrivers/net/sfc/falcon.c:1679: warning: comparison of distinct pointer types lacks a cast\ndrivers/net/sfc/falcon.c: In function 'falcon_spi_read':\ndrivers/net/sfc/falcon.c:1720: warning: comparison of distinct pointer types lacks a cast\n\nDriver seems rather confused about types.  Try to help it.\n\nCc: Ben Hutchings <bhutchings@solarflare.com>\nCc: Jeff Garzik <jgarzik@redhat.com>\nSigned-off-by: Andrew Morton <akpm@linux-foundation.org>\n---\n\n drivers/net/sfc/falcon.c |    9 ++++-----\n 1 file changed, 4 insertions(+), 5 deletions(-)","diff":"diff -puN drivers/net/sfc/falcon.c~drivers-net-sfc-falconc-fix-min-warnings drivers/net/sfc/falcon.c\n--- a/drivers/net/sfc/falcon.c~drivers-net-sfc-falconc-fix-min-warnings\n+++ a/drivers/net/sfc/falcon.c\n@@ -1673,8 +1673,8 @@ static int falcon_spi_cmd(const struct e\n \treturn 0;\n }\n \n-static unsigned int\n-falcon_spi_write_limit(const struct efx_spi_device *spi, unsigned int start)\n+static size_t\n+falcon_spi_write_limit(const struct efx_spi_device *spi, size_t start)\n {\n \treturn min(FALCON_SPI_MAX_LEN,\n \t\t   (spi->block_size - (start & (spi->block_size - 1))));\n@@ -1717,8 +1717,7 @@ int falcon_spi_read(const struct efx_spi\n \tint rc = 0;\n \n \twhile (pos < len) {\n-\t\tblock_len = min((unsigned int)len - pos,\n-\t\t\t\tFALCON_SPI_MAX_LEN);\n+\t\tblock_len = min(len - pos, FALCON_SPI_MAX_LEN);\n \n \t\tcommand = efx_spi_munge_command(spi, SPI_READ, start + pos);\n \t\trc = falcon_spi_cmd(spi, command, start + pos, NULL,\n@@ -1752,7 +1751,7 @@ int falcon_spi_write(const struct efx_sp\n \t\tif (rc)\n \t\t\tbreak;\n \n-\t\tblock_len = min((unsigned int)len - pos,\n+\t\tblock_len = min(len - pos,\n \t\t\t\tfalcon_spi_write_limit(spi, start + pos));\n \t\tcommand = efx_spi_munge_command(spi, SPI_WRITE, start + pos);\n \t\trc = falcon_spi_cmd(spi, command, start + pos,\n","prefixes":["21/21"]}